/* Al Najah Al Daem owner panel. A working tool: calm, legible, Arabic first. Rubik is the site's own text face. */
@font-face { font-family: "Rubik"; src: url("/panel/ui/rubik.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }
:root {
  --ink: #1a1a18; --ink-2: #55524b; --line: #dcd8cf; --paper: #f6f4ef; --card: #fff;
  --accent: #1a1a18; --accent-ink: #fff; --mark: #e8b400; --bad: #b3261e; --good: #1e6b3a;
  --r: 10px; --gap: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.6 "Rubik", system-ui, sans-serif; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.1rem; margin-top: 1.4em; }
.muted { color: var(--ink-2); margin: 0 0 1em; }
small.muted { display: block; margin: .25em 0 0; font-size: .85rem; }
.err { color: var(--bad); min-height: 1.4em; margin: .5em 0 0; }
a { color: inherit; }
input, button, textarea, select { font: inherit; color: inherit; }
input[type="text"], input:not([type]), input[type="password"], input[type="number"] {
  width: 100%; padding: .55em .7em; border: 1px solid var(--line); border-radius: 8px; background: #fff; min-height: 44px;
}
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
input[dir="ltr"] { text-align: left; }
label { display: block; font-weight: 500; margin-bottom: 14px; }
label > input { margin-top: 4px; font-weight: 400; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 500; padding: 0 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--ink); background: transparent; text-decoration: none; cursor: pointer; font-weight: 500; white-space: nowrap; }
.btn--main { background: var(--accent); color: var(--accent-ink); }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
.btn--small { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.link { background: none; border: 0; padding: 4px; text-decoration: underline; cursor: pointer; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 14px; cursor: pointer; min-height: 36px; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: .6em 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: var(--gap); }

/* gate */
.gate { min-height: 100svh; display: grid; place-items: center; padding: 16px; }
.gate__card { width: min(400px, 100%); }
.gate__mark { display: block; margin-bottom: 12px; }
.gate h1 { font-size: 1.35rem; }

/* bar */
.bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 10px 20px;
  background: var(--ink); color: #fff; }
.bar__brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.bar__brand img { background: #fff; border-radius: 50%; padding: 3px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.tabs button { background: none; border: 0; color: #fff; opacity: .75; padding: 8px 12px; border-radius: 8px; cursor: pointer; min-height: 40px; }
.tabs button[aria-current="page"] { opacity: 1; background: rgba(255, 255, 255, .14); box-shadow: inset 0 -3px 0 var(--mark); }
.bar__user { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.bar__user .link { color: #fff; }

.savebar { position: sticky; top: 60px; z-index: 4; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end;
  padding: 10px 20px; background: #fff7d6; border-bottom: 1px solid #e9d78a; }
.savebar span { margin-inline-end: auto; font-weight: 500; }
.toast { position: fixed; inset-inline-start: 20px; bottom: 20px; z-index: 9; margin: 0; padding: 10px 16px; border-radius: 8px;
  background: var(--ink); color: #fff; opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; pointer-events: none; max-width: calc(100vw - 40px); }
.toast.on { opacity: 1; transform: none; }
.toast.bad { background: var(--bad); }

.page { max-width: 980px; margin: 0 auto; padding: 24px 16px 80px; }

/* texts */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pair__h { grid-column: 1 / -1; display: flex; justify-content: space-between; font-weight: 600; }
.pair__h small { color: var(--ink-2); font-weight: 400; }
.pair label { margin: 0; font-weight: 400; font-size: .85rem; color: var(--ink-2); }

/* galleries */
.gal { margin-bottom: 28px; }
.gal__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.ph { position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ph img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--line); }
.ph__n { position: absolute; top: 6px; inset-inline-start: 6px; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 9px; font-size: .8rem; }
.ph__lead { position: absolute; top: 6px; inset-inline-end: 6px; background: var(--mark); color: var(--ink); border-radius: 999px; padding: 0 9px; font-size: .75rem; }
.ph__tools { display: flex; justify-content: space-between; padding: 6px; gap: 4px; }
.ph__tools button { flex: 1; min-height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; }
.ph__tools button[disabled] { opacity: .3; cursor: default; }
.ph__tools .del { color: var(--bad); }
.ph--new { border-color: var(--mark); box-shadow: 0 0 0 2px var(--mark); }
.add { display: grid; place-items: center; min-height: 200px; border: 2px dashed var(--line); border-radius: var(--r); background: none; cursor: pointer; color: var(--ink-2); }
.add:hover { border-color: var(--ink); color: var(--ink); }

/* counter */
.bays { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.bay { display: flex; flex-direction: column; gap: 10px; }
.bay img { display: block; width: 100%; height: 260px; object-fit: contain; background: var(--paper); border-radius: 8px; }
.bay.off img { opacity: .35; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.check input { width: 20px; height: 20px; }

/* emails */
.email { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }

/* publish */
.steps { padding: 8px 20px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.step:last-child { border: 0; }
.step > b { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; }
.step h3 { margin-top: 4px; }
.frame { margin-top: 10px; }
.frame iframe { display: block; width: 100%; height: 640px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin-inline: auto; }
.frame.w390 iframe { width: 390px; max-width: 100%; }
.progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.progress span { display: block; height: 100%; width: 0; background: var(--good); transition: width .3s; }
.history { padding: 0; list-style: none; margin: 0; }
.history li { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history li span { color: var(--ink-2); font-size: .9rem; }
.history li .link { margin-inline-start: auto; }
.users { list-style: none; padding: 0; margin: 0 0 12px; }
.users li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.users li b { margin-inline-end: auto; }
.users li i { font-style: normal; color: var(--ink-2); font-size: .9rem; }
#user-form input { flex: 1 1 160px; width: auto; }

/* photo dialog */
.dlg { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100svh - 24px); }
.dlg::backdrop { background: rgba(26, 26, 24, .55); }
.dlg__in { padding: 20px; }
.crop { position: relative; margin: 12px 0; user-select: none; cursor: crosshair; }
.crop img { display: block; max-width: 100%; max-height: 52svh; margin-inline: auto; }
.crop__box { position: absolute; border: 2px solid var(--mark); box-shadow: 0 0 0 9999px rgba(26, 26, 24, .45); pointer-events: none; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.sliders label { font-weight: 400; font-size: .9rem; margin-bottom: 6px; }
.sliders input { width: 100%; }

/* the studio credit (global rule): text and character, both linking to NIVO */
.credit { display: flex; justify-content: center; padding: 8px 16px 28px; }
.nivo-credit { display: inline-flex; align-items: center; gap: 10px; color: var(--ink-2); text-decoration: none; font-size: .85rem; }
.nivo-credit:hover { color: var(--ink); }
.nivo-it { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: #fff; border: 1px solid var(--line); }
.nivo-it img { display: block; }
.gate { min-height: calc(100svh - 80px); }

@media (max-width: 720px) {
  .bar { padding: 8px 12px; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .tabs button { flex: none; }
  .savebar { top: 0; position: sticky; }
  .pair { grid-template-columns: 1fr; }
  .card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
