/* IBDAA · إبداع dashboard styles. Colours, type and sizes come from /ibdaa/tokens.css (--ib-*). */
@import url('/ibdaa/fonts.css');
@import url('/ibdaa/tokens.css');

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--ib-paper); color: var(--ib-ink); font-family: var(--ib-font); font-size: var(--ib-fs-md); font-variant-numeric: tabular-nums; line-height: 1.45; }
button, input, textarea, select { font-family: inherit; }
a { color: var(--ib-ink); text-decoration: none; }
main a:not(.btn):not(.kpi):not(.list-row):not(.card):hover { text-decoration: underline; }
code, pre, textarea.code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12.5px; }
h1 { font-size: var(--ib-fs-h1); font-weight: 600; margin: 0 0 4px; line-height: 1.2; }
h2 { font-size: var(--ib-fs-h2); font-weight: 600; margin: 0 0 12px; }
h3 { font-size: var(--ib-fs-md); font-weight: 600; margin: 16px 0 8px; }
[hidden] { display: none !important; }
[lang="ar"], .ar, [dir="rtl"] { line-height: 1.6; }
[dir=auto], .auto { unicode-bidi: plaintext; line-height: 1.6; }
.muted { color: var(--ib-text-muted); }
.small { font-size: 12px; }
.error { color: var(--ib-blocked-fg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--ib-ink); outline-offset: 2px; }
.side :focus-visible { outline-color: var(--ib-lemon); }

/* ---------- app shell ---------- */
.app { min-height: 100vh; display: flex; }
.main { flex: 1; min-width: 0; padding: 32px clamp(16px, 3vw, 40px) 60px; }
.side { width: var(--ib-side-w); flex: none; padding: 20px 14px; background: var(--ib-side-bg); color: #F6F5F1; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-logo { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; color: #F6F5F1; }
.side-logo b { display: block; font-size: 18px; font-weight: 700; letter-spacing: 0.04em; line-height: 1.1; }
.side-logo span { display: block; font-size: 14px; font-weight: 500; color: #BDBBB2; text-align: left; }
.grp { font-size: 11px; font-weight: 500; letter-spacing: 0.14em; color: var(--ib-side-muted); padding: 18px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ib-side-text); font-size: 14px; }
.nav-link:hover { background: var(--ib-side-hover); color: #FFFFFF; }
.nav-link[aria-current="page"] { background: var(--ib-lemon); color: var(--ib-on-lemon); font-weight: 600; }
.nav-link .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: var(--ib-r-pill); background: var(--ib-lemon); color: #161616; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.nav-link[aria-current="page"] .count { background: #161616; color: var(--ib-lemon); }
.side-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 8px 0; border-top: 1px solid var(--ib-side-line); font-size: 13px; color: var(--ib-side-text); }
.side-foot .nav-link { min-height: 36px; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: var(--ib-r-pill); background: var(--ib-lemon); display: inline-block; margin-right: 8px; }
.dot.production { background: #E5534B; }
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side { width: 100%; position: static; height: auto; }
  .side-foot { margin-top: 12px; }
}

/* brand switcher */
.switcher { position: relative; margin-bottom: 6px; }
.brand-switch { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 1px solid var(--ib-side-line); border-radius: var(--ib-r-md); background: var(--ib-side-raised); color: #F6F5F1; text-align: left; cursor: pointer; }
.brand-switch:hover { background: var(--ib-side-hover); }
.brand-switch small { display: block; font-size: 11px; letter-spacing: 0.12em; color: var(--ib-side-muted); }
.brand-switch strong { display: block; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pmenu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; min-width: 240px; background: var(--ib-side-raised); border: 1px solid var(--ib-side-line); border-radius: var(--ib-r-md); padding: 6px; max-height: 70vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); }
.pitem { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border: none; border-radius: 10px; background: transparent; color: #F6F5F1; text-align: left; cursor: pointer; font-size: 14px; }
.pitem { justify-content: flex-start; }
.pitem > span:last-child { flex: 1; min-width: 0; }
.pitem b, .pitem .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pitem:hover { background: var(--ib-side-hover); border-color: transparent; }
.pitem[aria-pressed="true"] { background: var(--ib-lemon); color: #161616; }
.pitem b { display: block; font-weight: 500; }
.pitem .small { font-size: 10.5px; letter-spacing: 0.04em; color: var(--ib-side-muted); }
.pitem[aria-pressed="true"] .small { color: #3D3A1A; }
.pbadge { flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: #3A3A3A; color: #fff; font-weight: 700; font-size: 12px; object-fit: cover; }

/* ---------- page header ---------- */
.head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.head > div > .muted, .head > .muted, .head p { font-size: var(--ib-fs-lg); margin: 0; }
.head h1 .muted { font-weight: 400; }
.stack > * + * { margin-top: 20px; }
.card .stack > * + *, .tight > * + * { margin-top: 10px; }

/* ---------- buttons ---------- */
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ib-tap); padding: 0 16px; border-radius: var(--ib-r-md); border: 1px solid var(--ib-line-strong); background: var(--ib-surface); color: var(--ib-ink); font-size: var(--ib-fs-md); font-weight: 500; cursor: pointer; text-decoration: none; }
button:hover, .btn:hover { border-color: var(--ib-text-muted); }
button.primary, .btn.primary, .btn-primary { background: var(--ib-lemon); color: var(--ib-on-lemon); border-color: var(--ib-lemon); font-weight: 600; }
button.primary:hover, .btn.primary:hover, .btn-primary:hover { filter: brightness(0.96); border-color: var(--ib-lemon); }
.btn-secondary { background: transparent; color: var(--ib-ink); border: 1.5px solid var(--ib-ink); }
button.danger { color: var(--ib-blocked-fg); }
button.small, .btn.small { min-height: 36px; padding: 0 12px; font-size: var(--ib-fs-sm); border-radius: 10px; }
button:disabled { opacity: 0.5; cursor: default; }
.btn-lg { min-height: 48px; font-size: 16px; padding: 0 20px; }
.kbd { padding: 2px 6px; border-radius: 6px; background: rgba(22, 22, 22, 0.12); font-size: 12px; font-weight: 500; }
.icon-btn { width: 36px; min-height: 36px; height: 36px; padding: 0; border: 1px solid var(--ib-line); border-radius: 10px; }

/* ---------- forms ---------- */
label { display: block; font-size: var(--ib-fs-sm); color: var(--ib-ink); margin-bottom: 6px; font-weight: 600; }
label.row { font-weight: 400; margin: 0; }
input, select, textarea { width: 100%; min-height: var(--ib-tap); padding: 0 12px; border: 1px solid var(--ib-line-strong); border-radius: var(--ib-r-md); background: var(--ib-surface); color: var(--ib-ink); font-size: var(--ib-fs-md); }
textarea { min-height: 96px; padding: 12px 14px; line-height: 1.7; resize: vertical; }
textarea.code { min-height: 420px; white-space: pre; tab-size: 2; line-height: 1.5; }
input[type=color] { padding: 2px; }
input[type=checkbox], input[type=radio] { width: 18px; min-height: 18px; height: 18px; accent-color: var(--ib-ink); flex: none; }
input[type=file] { padding: 9px 12px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ib-ink); outline-offset: 2px; }
.field { margin-bottom: 14px; }
.field .small { margin-top: 4px; }
fieldset { border: none; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin: 0 0 10px; font-size: var(--ib-fs-md); font-weight: 600; }
.f { font-size: var(--ib-fs-md); font-weight: 600; margin: 0 0 10px; }

/* ---------- panels, grids, tables ---------- */
.card, .panel { display: block; padding: 20px; border-radius: var(--ib-r-lg); background: var(--ib-surface); border: 1px solid var(--ib-line); min-width: 0; color: var(--ib-ink); }
a.card:hover { border-color: var(--ib-line-strong); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.panel-head h2 { margin: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .g2, .g3, .g4, .split { grid-template-columns: 1fr !important; } }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.scroll-x { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: start; padding: 11px 10px; border-top: 1px solid var(--ib-line-soft); vertical-align: top; }
tr:first-child > th, tr:first-child > td { border-top: none; }
th { font-size: 12px; color: var(--ib-text-muted); font-weight: 600; }
td a { font-weight: 500; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); font-size: var(--ib-fs-md); }
.kv > * { padding: 11px 0; border-top: 1px solid var(--ib-line-soft); }
.kv > :nth-child(odd) { font-weight: 600; }
.list-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--ib-line-soft); color: var(--ib-ink); }
a.list-row:hover b, a.list-row:hover .t { text-decoration: underline; }
.mini { width: 44px; height: 56px; border-radius: var(--ib-r-sm); background: var(--ib-surface-2); border: 1px solid var(--ib-line-soft); flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.mini img { width: 100%; height: 100%; object-fit: cover; }
.bar { height: 10px; border-radius: var(--ib-r-pill); background: var(--ib-line-soft); }
.bar > i { display: block; height: 10px; border-radius: var(--ib-r-pill); background: var(--ib-ink); }
.card img, .card video { max-width: 100%; height: auto; }
/* Installation checklist: three even columns that line up across its sections, stacked on phones. */
.install table { table-layout: fixed; }
.install td { overflow-wrap: anywhere; }
.install td:nth-child(1) { width: 34%; }
.install td:nth-child(2) { width: 30%; }
@media (max-width: 720px) {
  .install tr { display: block; padding: 10px 0; border-top: 1px solid var(--ib-line-soft); }
  .install tr:first-child { border-top: none; }
  .install td, .install td:nth-child(1), .install td:nth-child(2) { display: block; width: auto; border: none; padding: 4px 0; }
}

/* ---------- status pills ---------- */
.pill { display: inline-block; padding: 3px 9px; border-radius: var(--ib-r-pill); font-size: var(--ib-fs-xs); font-weight: 600; white-space: nowrap; background: var(--ib-surface-3); color: var(--ib-text-soft); }
.pill.needs-review, .pill.running, .pill.draft, .pill.new, .pill.planned { background: var(--ib-review-bg); color: var(--ib-review-fg); }
.pill.blocked, .pill.fail, .pill.failed, .pill.block, .pill.production { background: var(--ib-blocked-bg); color: var(--ib-blocked-fg); }
.pill.approved, .pill.ok, .pill.done, .pill.produced { background: var(--ib-approved-bg); color: var(--ib-approved-fg); }
.pill.changes-requested, .pill.warn, .pill.queued { background: var(--ib-changes-bg); color: var(--ib-changes-fg); }
.pill.ink { background: #161616; color: var(--ib-lemon); }

/* ---------- segmented control, tabs, chips ---------- */
.seg, .tabs { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: 14px; background: var(--ib-segment); }
.tabs { margin-bottom: 16px; }
.seg button, .tabs button { min-height: 40px; padding: 0 14px; border: none; border-radius: 10px; background: transparent; color: var(--ib-text-soft); font-size: var(--ib-fs-md); font-weight: 500; }
.seg button[aria-pressed="true"], .tabs button.active { background: var(--ib-surface); color: var(--ib-ink); font-weight: 600; box-shadow: var(--ib-shadow-seg); }
.seg .n { font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: var(--ib-r-pill); background: #DAD7CE; color: #3D3C36; }
.seg button[aria-pressed="true"] .n { background: var(--ib-lemon); color: #161616; }
.seg.fill { display: flex; border-radius: 12px; background: var(--ib-surface-3); }
.seg.fill button { flex: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 36px; padding: 0 12px; border-radius: var(--ib-r-pill); border: 1px solid var(--ib-line-strong); background: var(--ib-surface); color: var(--ib-ink); font-size: var(--ib-fs-sm); font-weight: 500; }
.chip[aria-pressed="true"] { border: 1.5px solid var(--ib-ink); background: var(--ib-ink); color: var(--ib-paper); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; }
.tags span { padding: 4px 8px; border-radius: var(--ib-r-sm); background: var(--ib-surface-3); color: var(--ib-text-muted); }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { padding: 20px; border-radius: var(--ib-r-lg); background: var(--ib-surface); border: 1px solid var(--ib-line); display: flex; flex-direction: column; gap: 6px; color: var(--ib-ink); }
.kpi .v { font-size: var(--ib-fs-kpi); font-weight: 600; line-height: 1.1; }
.kpi .l { font-size: var(--ib-fs-sm); color: var(--ib-text-muted); }
.kpi.hero { background: #161616; border-color: #161616; color: #F6F5F1; }
.kpi.hero .v { color: var(--ib-lemon); }
.kpi.hero .l { color: #CFCDC4; }
a.kpi.hero:hover { background: #262626; }

/* ---------- review ---------- */
.search { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--ib-line); border-radius: 12px; background: var(--ib-surface); min-width: min(260px, 100%); color: var(--ib-text-muted); }
.search:focus-within { outline: 2px solid var(--ib-ink); outline-offset: 2px; }
.search input { border: none; outline: none; min-height: 40px; padding: 0; flex: 1; background: transparent; }
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.review { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.review-list { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.assets { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.asset { display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; min-height: 0; padding: 0; border: 1px solid var(--ib-line); border-radius: var(--ib-r-lg); background: var(--ib-surface); overflow: hidden; text-align: left; font-weight: 400; }
.asset[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ib-ink); border-color: var(--ib-ink); }
.asset .thumb { position: relative; aspect-ratio: 4 / 5; width: 100%; background: var(--ib-surface-2); border-bottom: 1px solid var(--ib-line-soft); }
.asset .thumb img, .asset .thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.asset .fmt { position: absolute; top: 10px; left: 10px; z-index: 1; padding: 3px 8px; border-radius: 6px; background: #161616; color: #F6F5F1; font-size: 11px; font-weight: 500; letter-spacing: 0.04em; }
.asset .play { position: absolute; right: 12px; bottom: 12px; z-index: 1; width: 36px; height: 36px; border-radius: var(--ib-r-pill); background: #161616; display: flex; align-items: center; justify-content: center; }
.asset .meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.asset .meta .top { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ib-text-muted); }
.asset .meta .hl { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; unicode-bidi: plaintext; text-align: start; }
.asset .meta .sub { font-size: 12px; color: var(--ib-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail { flex: 1 1 340px; max-width: 420px; border: 1px solid var(--ib-line); border-radius: var(--ib-r-xl); background: var(--ib-surface); display: flex; flex-direction: column; overflow: hidden; position: sticky; top: 16px; max-height: calc(100vh - 32px); }
@media (max-width: 1000px) { .detail { max-width: none; position: static; max-height: none; } }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--ib-line-soft); font-size: var(--ib-fs-sm); color: var(--ib-text-muted); }
.detail-body { padding: 16px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; min-height: 0; }
.detail-body .sec { display: flex; flex-direction: column; gap: 10px; }
.detail-body b.t { font-size: var(--ib-fs-md); }
.preview { border-radius: var(--ib-r-md); background: var(--ib-surface-2); border: 1px solid var(--ib-line-soft); overflow: hidden; display: flex; justify-content: center; }
.preview img, .preview video { display: block; width: 100%; max-height: 60vh; object-fit: contain; }
.note { padding: 12px; border-radius: var(--ib-r-md); background: var(--ib-warn-well); display: flex; flex-direction: column; gap: 6px; font-size: var(--ib-fs-sm); line-height: 1.5; color: var(--ib-text-soft); }
.note.block { background: var(--ib-blocked-bg); }
.note .t { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; color: var(--ib-ink); }
.caption { margin: 0; padding: 12px; border-radius: var(--ib-r-md); background: var(--ib-paper); font-size: var(--ib-fs-md); line-height: 1.8; white-space: pre-line; unicode-bidi: plaintext; }
.decide { padding: 14px 16px; border-top: 1px solid var(--ib-line-soft); background: var(--ib-surface-2); display: flex; flex-direction: column; gap: 10px; }
.decide textarea { min-height: 64px; line-height: 1.5; }
.decide label { margin: 0; font-weight: 500; }
.decide .btns { display: flex; gap: 10px; }
.decide .btns button { flex: 1 1 0; min-height: 46px; font-size: var(--ib-fs-lg); font-weight: 600; }
details { border-top: 1px solid var(--ib-line-soft); padding-top: 10px; }
details summary { cursor: pointer; font-weight: 600; font-size: var(--ib-fs-md); min-height: 32px; }
details table { font-size: var(--ib-fs-sm); }
details td, details th { padding: 7px 6px; }

/* ---------- create ---------- */
.brand-pick { min-height: var(--ib-tap); padding: 0 16px 0 8px; border-radius: var(--ib-r-pill); }
.brand-pick .b { width: 28px; height: 28px; border-radius: var(--ib-r-pill); background: var(--ib-surface-3); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.brand-pick[aria-pressed="true"] { border: 1.5px solid var(--ib-ink); background: var(--ib-ink); color: var(--ib-paper); }
.brand-pick[aria-pressed="true"] .b { background: var(--ib-lemon); color: #161616; }
.format { flex: 1 1 140px; justify-content: flex-start; gap: 14px; min-height: 76px; padding: 12px 16px; border-radius: 14px; text-align: left; }
.format b { display: block; font-size: 15px; font-weight: 600; }
.format .d { font-size: 12px; color: var(--ib-text-muted); font-weight: 400; }
.format[aria-pressed="true"] { border: 2px solid var(--ib-ink); background: var(--ib-lemon-tint); color: var(--ib-on-lemon); }
.format[aria-pressed="true"] .d { color: #57564F; }
.format .box { width: 40px; height: 48px; display: flex; align-items: center; justify-content: center; flex: none; }
.format .shape { border: 2px solid currentColor; border-radius: 5px; }
.create-form { flex: 999 1 520px; padding: 24px; border-radius: var(--ib-r-xl); display: flex; flex-direction: column; gap: 22px; }
.create-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 16px; border-top: 1px solid var(--ib-line-soft); }
.steps { flex: 1 1 300px; max-width: 400px; padding: 24px; border-radius: var(--ib-r-xl); background: #161616; color: #F6F5F1; display: flex; flex-direction: column; gap: 18px; }
@media (max-width: 1000px) { .steps { max-width: none; } }
.steps h2 { margin: 0; }
.step { display: flex; gap: 14px; }
.step .n { width: 30px; height: 30px; flex: none; border-radius: var(--ib-r-pill); border: 1.5px solid var(--ib-lemon); color: var(--ib-lemon); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.step .n.on { background: var(--ib-lemon); color: #161616; }
.step b { display: block; font-size: var(--ib-fs-lg); }
.step span { display: block; font-size: var(--ib-fs-sm); line-height: 1.5; color: #CFCDC4; }

/* ---------- misc ---------- */
pre.log { background: #0E0E0E; color: #D6D4CB; padding: 12px; border-radius: var(--ib-r-md); max-height: 420px; overflow: auto; white-space: pre-wrap; margin: 0; }
.swatch { width: 18px; height: 18px; border-radius: 5px; display: inline-block; border: 1px solid var(--ib-line); vertical-align: middle; }
.chain { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.list-edit .item { display: flex; gap: 6px; margin-bottom: 6px; }
.list-edit .item input { flex: 1; }
.side-list a { display: flex; align-items: center; min-height: 40px; padding: 0 10px; border-radius: 10px; }
.side-list a.active { background: var(--ib-lemon); color: var(--ib-on-lemon); font-weight: 600; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #161616; color: #F6F5F1; padding: 12px 16px; border-radius: var(--ib-r-md); max-width: min(460px, calc(100vw - 40px)); z-index: 30; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25); white-space: pre-wrap; }
.toast.err { background: #A1281D; color: #fff; }
.empty { padding: 48px 24px; border: 1.5px dashed var(--ib-line-strong); border-radius: var(--ib-r-lg); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ib-text-muted); }
.empty b { font-size: var(--ib-fs-h2); color: var(--ib-ink); }
.card.empty, .card .empty { border-style: dashed; }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: flex; flex-wrap: wrap; }
.signin-brand { flex: 1 1 420px; padding: clamp(32px, 6vw, 72px); background: var(--ib-lemon); color: #161616; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.signin-brand .tag { display: flex; align-items: center; gap: 14px; font-size: 13px; font-weight: 600; letter-spacing: 0.16em; }
.signin-brand .name { font-size: clamp(64px, 9vw, 120px); font-weight: 700; line-height: 1; letter-spacing: 0.02em; display: block; }
.signin-brand .name-ar { font-size: clamp(48px, 6.5vw, 88px); font-weight: 600; line-height: 1.6; text-align: left; display: block; }
.signin-brand p { margin: 0; font-size: 18px; font-weight: 500; line-height: 1.5; max-width: 460px; }
.signin-brand p[lang="ar"] { line-height: 1.8; text-align: left; }
.signin-brand p.brands { margin-top: 8px; font-size: 14px; font-weight: 400; color: #3D3A1A; }
.signin-form { flex: 1 1 420px; padding: clamp(32px, 6vw, 72px); display: flex; align-items: center; justify-content: center; }
.signin-form form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 18px; }
.signin-form input { min-height: 48px; border: 1.5px solid var(--ib-ink); font-size: 15px; }
.signin-form .go { min-height: 50px; background: #161616; color: var(--ib-lemon); border-color: #161616; font-size: 16px; font-weight: 600; }
.signin-form .hint { font-size: var(--ib-fs-sm); line-height: 1.6; color: var(--ib-text-muted); }

/* ---------- fixes found in the browser ---------- */
.detail-body > * { flex: none; }
@media (max-width: 900px) {
  #nav { display: flex; flex-wrap: wrap; gap: 4px; }
  #nav .grp { display: none; }
  #nav .nav-link { min-height: 44px; }
  #nav .nav-link .count { margin-left: 4px; }
  .side-logo { padding-bottom: 12px; }
}
.decide .btns button { white-space: nowrap; padding: 0 10px; }

/* ---------- dark mode and review layout fixes ---------- */
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
.side { color-scheme: dark; scrollbar-width: thin; scrollbar-color: #3A3A3A transparent; }
.review-list, .detail-body { scrollbar-width: thin; }

/* In dark mode the ink hero card and ink count pill would vanish into the page, so they take a lemon edge / fill. */
:root[data-theme="dark"] .kpi.hero { background: #1B1B1B; border-color: var(--ib-lemon); }
:root[data-theme="dark"] .pill.ink { background: var(--ib-lemon); color: #161616; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kpi.hero { background: #1B1B1B; border-color: var(--ib-lemon); }
  :root:not([data-theme="light"]) .pill.ink { background: var(--ib-lemon); color: #161616; }
}

.search { min-width: min(320px, 100%); }
.preview img, .preview video { max-height: 44vh; }

/* Wide screens: Review fills the window. The grid scrolls on its own and the detail panel
   (with Approve / Request changes) always stays fully visible beside it. */
@media (min-width: 1001px) {
  .review-page { display: flex; flex-direction: column; height: calc(100vh - 92px); min-height: 520px; }
  .review-page > * { flex: none; }
  .review-page > .review { flex: 1 1 0; min-height: 0; flex-wrap: nowrap; align-items: stretch; }
  .review-page .review-list { flex: 1 1 0; overflow-y: auto; padding: 3px 8px 3px 3px; margin: -3px; }
  .review-page .detail { flex: 0 0 clamp(340px, 30vw, 420px); position: static; max-height: none; }
  .review-page .detail-body { flex: 1 1 0; }
}
@media (min-width: 1001px) {
  .review-page .preview img, .review-page .preview video { max-height: 32vh; }
  .review-page .decide { padding: 12px 16px; gap: 8px; }
  .review-page .decide textarea { min-height: 44px; padding: 10px 12px; }
}

/* ---------- projects ---------- */
.pbadge { border-radius: 26%; }
.proj-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-top: 1px solid var(--ib-line-soft); }
.proj-row:first-child { border-top: none; }
.proj-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; color: var(--ib-ink); }
.proj-main .t { font-size: var(--ib-fs-lg); font-weight: 600; }
.proj-main:hover .t { text-decoration: underline; }
.proj-main .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.pill:hover { text-decoration: none; }
.btn.icon-btn { min-height: 36px; }
.icon-btn.danger { color: var(--ib-blocked-fg); }
.grp-title { margin: 24px 0 -8px; font-size: var(--ib-fs-md); font-weight: 600; }
.conn { padding: 16px 20px; }
.conn-head { display: flex; align-items: center; gap: 12px; }
.conn .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; color: var(--ib-text-muted); margin: 2px 0; overflow-wrap: anywhere; }
.conn details { margin-top: 12px; }
.brand-pick img.b { object-fit: cover; background: #fff; }
/* on/off switch */
.switch { position: relative; display: inline-flex; margin: 0; flex: none; cursor: pointer; min-height: 36px; align-items: center; }
.switch input { position: absolute; opacity: 0; width: 48px; height: 28px; min-height: 0; margin: 0; cursor: pointer; }
.switch span { width: 48px; height: 28px; border-radius: var(--ib-r-pill); background: var(--ib-line-strong); transition: background 0.15s; position: relative; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked + span { background: var(--ib-ink); }
.switch input:checked + span::after { transform: translateX(20px); background: var(--ib-paper); }
.switch input:focus-visible + span { outline: 2px solid var(--ib-ink); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch span, .switch span::after { transition: none; } }
