/* ==========================================================
   MANATEQ — Staff portal design system
   Identity from the Manateq logo: gold rgb(135,117,78) · burgundy rgb(134,38,51)
   Tajawal (local files) · light / dark · one stylesheet for RTL (Arabic, default) and LTR
   (logical properties only).
   ========================================================== */
@font-face { font-family: "Tajawal"; font-weight: 300; font-display: swap; src: url("../fonts/Tajawal-Light.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 400; font-display: swap; src: url("../fonts/Tajawal-Regular.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 500; font-display: swap; src: url("../fonts/Tajawal-Medium.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 700; font-display: swap; src: url("../fonts/Tajawal-Bold.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 800; font-display: swap; src: url("../fonts/Tajawal-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Tajawal"; font-weight: 900; font-display: swap; src: url("../fonts/Tajawal-Black.ttf") format("truetype"); }

:root {
  color-scheme: light;
  --bg: #F5F2EC; --bg-2: #EFEAE1; --panel: #FFFFFF; --panel-2: #FAF7F2; --panel-3: #F3EEE5;
  --ink: #1F1915; --ink-2: #6B6157; --ink-3: #9A8F82; --line: #E6DFD3; --line-2: #D9D0C1;
  --gold: #87754E; --gold-600: #6E5F3E; --gold-300: #B9A77F; --gold-soft: #F2EDE1; --gold-ink: #5B4E31;
  --red: #862633; --red-600: #6B1D28; --red-300: #C46B78; --red-soft: #F8EAEC; --red-ink: #74202C;
  --ok: #2E7D4F; --ok-soft: #E6F3EB; --warn: #A26B12; --warn-soft: #FBF1DC; --danger: #B3261E; --danger-soft: #FBE9E7;
  --info: #2B5E87; --info-soft: #E7EFF6; --grey-soft: #EEEAE3;
  --side-bg: linear-gradient(180deg, #221A16 0%, #2B201B 55%, #3A1A20 100%);
  --side-ink: rgba(255,248,236,.78); --side-ink-strong: #FFF8EC; --side-hover: rgba(255,255,255,.06); --side-on: rgba(199,178,133,.16);
  --shadow-sm: 0 1px 2px rgba(31,25,21,.05);
  --shadow: 0 1px 2px rgba(31,25,21,.04), 0 10px 30px -14px rgba(31,25,21,.18);
  --shadow-lg: 0 30px 60px -24px rgba(31,25,21,.35);
  --radius: 18px; --radius-sm: 12px; --side-w: 280px;
  --focus: 0 0 0 4px rgba(135,117,78,.22);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #100E0C; --bg-2: #15120F; --panel: #1A1714; --panel-2: #201C18; --panel-3: #26211C;
  --ink: #F2ECE3; --ink-2: #ABA193; --ink-3: #7D7468; --line: #2F2A24; --line-2: #3B342C;
  --gold: #C9B48A; --gold-600: #DCC9A0; --gold-300: #8C7A55; --gold-soft: rgba(201,180,138,.12); --gold-ink: #E3D3B0;
  --red: #D36B7B; --red-600: #E38492; --red-300: #8E3644; --red-soft: rgba(211,107,123,.13); --red-ink: #F0A3AE;
  --ok: #6BCB93; --ok-soft: rgba(107,203,147,.12); --warn: #E2B060; --warn-soft: rgba(226,176,96,.12); --danger: #F08A80; --danger-soft: rgba(240,138,128,.12);
  --info: #85B4DA; --info-soft: rgba(133,180,218,.12); --grey-soft: #2A251F;
  --side-bg: linear-gradient(180deg, #0C0A09 0%, #120F0D 60%, #1C0F12 100%);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 34px -18px rgba(0,0,0,.8);
  --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.85);
  --focus: 0 0 0 4px rgba(201,180,138,.25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #100E0C; --bg-2: #15120F; --panel: #1A1714; --panel-2: #201C18; --panel-3: #26211C;
    --ink: #F2ECE3; --ink-2: #ABA193; --ink-3: #7D7468; --line: #2F2A24; --line-2: #3B342C;
    --gold: #C9B48A; --gold-600: #DCC9A0; --gold-300: #8C7A55; --gold-soft: rgba(201,180,138,.12); --gold-ink: #E3D3B0;
    --red: #D36B7B; --red-600: #E38492; --red-300: #8E3644; --red-soft: rgba(211,107,123,.13); --red-ink: #F0A3AE;
    --ok: #6BCB93; --ok-soft: rgba(107,203,147,.12); --warn: #E2B060; --warn-soft: rgba(226,176,96,.12); --danger: #F08A80; --danger-soft: rgba(240,138,128,.12);
    --info: #85B4DA; --info-soft: rgba(133,180,218,.12); --grey-soft: #2A251F;
    --side-bg: linear-gradient(180deg, #0C0A09 0%, #120F0D 60%, #1C0F12 100%);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 14px 34px -18px rgba(0,0,0,.8);
    --shadow-lg: 0 30px 60px -20px rgba(0,0,0,.85);
    --focus: 0 0 0 4px rgba(201,180,138,.25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Tajawal", system-ui, sans-serif; font-size: 15.5px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.3; font-weight: 800; }
p { margin: 0; }
.mi { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; line-height: 1; vertical-align: middle; font-size: 21px; letter-spacing: normal; text-transform: none; white-space: nowrap; direction: ltr; font-feature-settings: "liga"; -webkit-font-feature-settings: "liga"; font-variation-settings: "FILL" 0, "wght" 450; }
.mi.fill { font-variation-settings: "FILL" 1, "wght" 500; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono, .ltr-num { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; direction: ltr; unicode-bidi: embed; font-size: .94em; }
.ltr { direction: ltr; unicode-bidi: embed; display: inline-block; }
.hidden { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
::selection { background: rgba(135,117,78,.25); }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column;
  background: var(--side-bg); color: var(--side-ink); padding: 20px 14px 14px; isolation: isolate;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent;
}
.side::before { /* the Manateq knot as a faint lattice */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .07; pointer-events: none;
  background: url("../img/pattern.svg") center/180px repeat;
}
.side .brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; margin-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.07); }
.side .brand .mark { width: 46px; height: 46px; border-radius: 14px; background: #FFF; display: grid; place-items: center; box-shadow: 0 8px 18px -8px rgba(0,0,0,.6); flex: none; }
.side .brand .mark img { width: 34px; height: 34px; }
.side .brand b { display: block; color: var(--side-ink-strong); font-size: 17px; font-weight: 800; letter-spacing: .01em; }
.side .brand small { display: block; font-size: 12px; color: #C9B48A; font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav h6 { margin: 18px 12px 6px; font-size: 11.5px; letter-spacing: .12em; color: rgba(201,180,138,.75); font-weight: 700; text-transform: uppercase; }
.nav a {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 12px; border-radius: 12px;
  color: var(--side-ink); font-weight: 500; font-size: 15px; position: relative; transition: background .15s, color .15s;
}
.nav a .mi { font-size: 21px; color: rgba(201,180,138,.85); }
.nav a:hover { background: var(--side-hover); color: var(--side-ink-strong); }
.nav a.on { background: var(--side-on); color: #FFF; font-weight: 700; }
.nav a.on .mi { color: #E3CFA2; font-variation-settings: "FILL" 1, "wght" 500; }
.nav a.on::before { content: ""; position: absolute; inset-inline-start: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 4px; background: linear-gradient(#E3CFA2, #87754E); }
.nav a .badge { margin-inline-start: auto; background: var(--red); color: #fff; font-size: 11.5px; font-weight: 800; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; display: inline-grid; place-items: center; }
:root[data-theme="dark"] .nav a .badge { background: #A33343; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; padding: 12px 28px; min-height: 70px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 20px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .crumb { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.icon-btn.menu-btn { display: none; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; transition: .15s; }
.icon-btn:hover { color: var(--gold-600); border-color: var(--gold-300); }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); font: 700 13.5px "Tajawal", sans-serif; color: var(--ink-2); cursor: pointer; transition: .15s; }
.chip-btn:hover { color: var(--gold-600); border-color: var(--gold-300); }
.theme-toggle .when-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .when-dark { display: inline; }
:root[data-theme="dark"] .theme-toggle .when-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .when-dark { display: inline; }
  :root:not([data-theme="light"]) .theme-toggle .when-light { display: none; }
}
.user-menu { position: relative; }
.user-menu summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.user-menu summary::-webkit-details-marker { display: none; }
.avatar { width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, var(--red), #A2394A); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; flex: none; }
.user-menu .who { line-height: 1.2; text-align: start; }
.user-menu .who b { display: block; font-size: 13.5px; }
.user-menu .who span { font-size: 11.5px; color: var(--ink-3); }
.user-menu .drop { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.user-menu .drop a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.user-menu .drop a:hover { background: var(--panel-2); }
.user-menu .drop a.danger { color: var(--danger); }

.page { padding: 26px 28px 70px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -.01em; }
.page-head p { margin-top: 4px; color: var(--ink-2); max-width: 70ch; }
.page-head .eyebrow { font-size: 12px; font-weight: 800; color: var(--gold); letter-spacing: .12em; text-transform: uppercase; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.crumbs a:hover { color: var(--gold-600); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: 14px; margin-bottom: 18px; font-weight: 500; border: 1px solid; animation: pop .25s ease-out; }
.alert .mi { margin-top: 1px; }
.alert.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); color: var(--ok); }
.alert.err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.alert.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 28%, transparent); color: var(--info); }
.alert.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); color: var(--warn); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border-radius: 12px; border: 1px solid transparent; font: 700 14.5px/1 "Tajawal", sans-serif; cursor: pointer;
  transition: transform .12s, box-shadow .15s, background .15s, border-color .15s; white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }
.btn:focus-visible, .icon-btn:focus-visible, .chip-btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn .mi { font-size: 19px; }
.btn-primary { background: linear-gradient(180deg, #93303E, var(--red)); color: #fff; box-shadow: 0 10px 22px -12px rgba(134,38,51,.75), inset 0 1px 0 rgba(255,255,255,.12); }
:root[data-theme="dark"] .btn-primary { background: linear-gradient(180deg, #A13A4A, #862633); color: #fff; }
.btn-primary:hover { box-shadow: 0 14px 26px -12px rgba(134,38,51,.8); }
.btn-gold { background: linear-gradient(180deg, #96835A, var(--gold-600)); color: #fff; box-shadow: 0 10px 22px -12px rgba(110,95,62,.7); }
:root[data-theme="dark"] .btn-gold { background: linear-gradient(180deg, #A8956A, #7C6B46); }
.btn-outline { background: var(--panel); color: var(--ink); border-color: var(--line-2); }
.btn-outline:hover { border-color: var(--gold-300); color: var(--gold-600); }
.btn-ghost { background: var(--gold-soft); color: var(--gold-ink); }
.btn-ghost:hover { background: color-mix(in srgb, var(--gold-soft) 70%, var(--gold) 10%); }
.btn-soft-red { background: var(--red-soft); color: var(--red-ink); }
.btn-danger { background: var(--panel); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ok { background: var(--ok); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .mi { font-size: 17px; }
.btn-icon { width: 34px; padding: 0; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 18px; }
.card-pad { padding: 20px 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; }
.card-head h3 .ic { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-600); display: grid; place-items: center; }
.card-head h3 .ic .mi { font-size: 19px; }
.card-head .sub { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.card-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--panel-2); border-radius: 0 0 var(--radius) var(--radius); }
.card[data-collapse] > .card-head { cursor: pointer; user-select: none; }
.card[data-collapse] > .card-head h3 { margin-inline-end: auto; }
.card-head .collapse-ic { color: var(--ink-3); font-size: 24px; transition: transform .2s; }
.card.is-collapsed > .card-head { border-bottom: 0; }
.card.is-collapsed > .card-head .collapse-ic { transform: rotate(-90deg); }
[dir="rtl"] .card.is-collapsed > .card-head .collapse-ic { transform: rotate(90deg); }
.card.is-collapsed > :not(.card-head) { display: none; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; overflow: hidden; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.kpi .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.kpi .ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.kpi .ic .mi { font-size: 23px; font-variation-settings: "FILL" 1, "wght" 500; }
.kpi .label { color: var(--ink-2); font-size: 13.5px; font-weight: 700; }
.kpi b { font-size: 32px; font-weight: 800; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3); }
.kpi .delta.up { color: var(--ok); }
.kpi::after { content: ""; position: absolute; inset-inline-end: -30px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; background: currentColor; opacity: .05; }
.kpi.c-gold { color: var(--gold); } .kpi.c-red { color: var(--red); } .kpi.c-ok { color: var(--ok); } .kpi.c-info { color: var(--info); }
.kpi.c-gold .ic { background: var(--gold-soft); } .kpi.c-red .ic { background: var(--red-soft); } .kpi.c-ok .ic { background: var(--ok-soft); } .kpi.c-info .ic { background: var(--info-soft); }
.kpi b, .kpi .label { color: var(--ink); } .kpi .label { color: var(--ink-2); }
a.kpi:hover { border-color: var(--gold-300); }

/* hero banner on the dashboard */
.hero {
  position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px; margin-bottom: 20px; color: #FFF8EC; isolation: isolate;
  background: radial-gradient(600px 300px at 100% 0%, rgba(201,180,138,.35), transparent 60%), linear-gradient(120deg, #3A1A20, #5B1F2B 45%, #862633);
  box-shadow: var(--shadow);
}
[dir="rtl"] .hero { background: radial-gradient(600px 300px at 0% 0%, rgba(201,180,138,.35), transparent 60%), linear-gradient(240deg, #3A1A20, #5B1F2B 45%, #862633); }
.hero::before { content: ""; position: absolute; inset: 0; background: url("../img/pattern.svg") center/150px repeat; opacity: .08; z-index: -1; }
.hero h2 { font-size: 24px; font-weight: 800; }
.hero p { opacity: .85; margin-top: 6px; max-width: 60ch; }
.hero .hero-stats { display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; }
.hero .hero-stats b { display: block; font-size: 24px; font-weight: 800; color: #F1E2BE; font-variant-numeric: tabular-nums; }
.hero .hero-stats span { font-size: 12.5px; opacity: .8; }
.hero .logos { position: absolute; inset-inline-end: 26px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 12px; }
.hero .logos .lg { background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 16px 30px -18px rgba(0,0,0,.6); }
.hero .logos .lg img { height: 54px; width: auto; }
.hero .logos .x { font-size: 22px; color: #E3CFA2; font-weight: 300; }

/* ---------- filters / toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 1 1 260px; min-width: 200px; }
.toolbar .search .mi { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 20px; }
.toolbar .search input { padding-inline-start: 40px; }
.toolbar select, .toolbar input[type=text], .toolbar input[type=search] { width: auto; min-height: 40px; }
.tabs { display: flex; gap: 4px; padding: 10px 14px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 10px 10px 0 0; font-weight: 700; font-size: 14px; color: var(--ink-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--red); border-bottom-color: var(--red); }
.tabs a .count { font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--panel-3); color: var(--ink-2); }
.tabs a.on .count { background: var(--red-soft); color: var(--red-ink); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field[hidden] { display: none; }
.field > label, .lbl { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.field.req > label::after, .field.req > .lbl::after { content: " *"; color: var(--red); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.help-link { color: var(--gold-600); font-weight: 700; white-space: nowrap; }
.help-link:hover { text-decoration: underline; }
.help-link .mi { font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=tel], input[type=search], select, textarea, .input {
  width: 100%; min-height: 44px; padding: 9px 13px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink);
  font: 500 14.5px/1.5 "Tajawal", sans-serif; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--ink-3); }
textarea { min-height: 110px; resize: vertical; }
textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; direction: ltr; text-align: left; min-height: 150px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--focus); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--red); vertical-align: middle; }
input[type=file] { font: 500 13.5px "Tajawal", sans-serif; }
select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2387754E' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
[dir="rtl"] select { background-position: left 14px center; }
.check { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; min-height: 36px; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.form-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-section { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 6px 0 12px; display: flex; align-items: center; gap: 10px; }
.form-section::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.pass-wrap { position: relative; }
.pass-wrap input { padding-inline-end: 48px; }
/* Typed values that must stay left-to-right (e-mail, password, codes, URLs, numbers) keep dir="ltr" so their characters
   never reorder, but on an Arabic page they line up on the right like every other field and its label.
   The password's eye button sits at the PAGE's inline end, so the room for it is reserved on that physical side. */
[dir="rtl"] input[dir="ltr"] { text-align: right; }
[dir="rtl"] input[dir="ltr"]::placeholder { text-align: right; }
[dir="rtl"] .pass-wrap input[dir="ltr"] { padding-inline-end: 13px; padding-left: 48px; }
[dir="ltr"] .pass-wrap input[dir="ltr"] { padding-right: 48px; }
.pass-wrap button { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; color: var(--ink-3); width: 38px; height: 38px; border-radius: 10px; }
.pass-wrap button:hover { color: var(--gold-600); }
/* a fixed code on the Settings card: blurred until pointed at / focused */
.secret-code { filter: blur(5px); transition: filter .15s; cursor: pointer; padding: 2px 8px; border-radius: 8px; background: var(--panel-3); font-weight: 800; letter-spacing: .12em; }
.secret-code:hover, .secret-code:focus { filter: none; outline: none; }
/* sign-in CAPTCHA: code field + image box with its refresh button */
.captcha { display: flex; gap: 10px; align-items: stretch; }
.captcha input { flex: 1; min-width: 0; letter-spacing: .18em; font-weight: 800; text-transform: uppercase; }
.captcha input::placeholder { letter-spacing: 0; font-weight: 500; text-transform: none; }
.captcha-box { flex: none; display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: #F8F5EF; }
.captcha-box img { display: block; width: 150px; height: 48px; }
.captcha-box button { align-self: stretch; width: 42px; border: 0; border-inline-end: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); cursor: pointer; }
.captcha-box button:hover, .captcha-box button:focus-visible { color: var(--red); }
.captcha-box button.spin .mi { animation: captcha-spin .6s linear infinite; }
@keyframes captcha-spin { to { transform: rotate(360deg); } }
@media (max-width: 380px) { .captcha { flex-direction: column; } .captcha-box { align-self: flex-start; } }
.input-group { display: flex; align-items: stretch; }
.input-group > span { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--ink-2); font-weight: 700; direction: ltr; }
.input-group > span:first-child { border-radius: 12px 0 0 12px; border-inline-end: 0; }
[dir="rtl"] .input-group > span:first-child { border-radius: 0 12px 12px 0; }
.input-group > input { border-radius: 0 12px 12px 0; }
[dir="rtl"] .input-group > input { border-radius: 12px 0 0 12px; }
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--panel-3); border-radius: 12px; border: 1px solid var(--line); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 9px; font-weight: 700; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--panel); color: var(--red); box-shadow: var(--shadow-sm); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 44px; height: 26px; border-radius: 26px; background: var(--line-2); position: relative; transition: .2s; flex: none; }
.switch .track::before { content: ""; position: absolute; width: 20px; height: 20px; inset-inline-start: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--ok); }
.switch input:checked + .track::before { inset-inline-start: 21px; }
.switch input:focus-visible + .track { box-shadow: var(--focus); }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl th { text-align: start; font-size: 12px; font-weight: 800; color: var(--ink-3); letter-spacing: .04em; padding: 11px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: color-mix(in srgb, var(--panel-2) 70%, transparent); }
.tbl td.num, .tbl th.num { text-align: end; }
.tbl td.mono, .tbl td.nowrap { white-space: nowrap; }
.tbl .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.tbl a.link { color: var(--ink); font-weight: 700; }
.tbl a.link:hover { color: var(--red); }
.cell-user { display: flex; align-items: center; gap: 10px; }
.cell-user .av { width: 34px; height: 34px; border-radius: 10px; background: var(--gold-soft); color: var(--gold-600); display: grid; place-items: center; font-weight: 800; flex: none; }
.cell-user b { display: block; line-height: 1.25; }
.cell-user small { color: var(--ink-3); font-size: 12px; }
.thumb { width: 54px; height: 42px; border-radius: 10px; object-fit: cover; background: var(--panel-3); border: 1px solid var(--line); flex: none; display: grid; place-items: center; color: var(--ink-3); }
.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty .mi { font-size: 46px; color: var(--line-2); display: block; margin-bottom: 8px; }
.pager { display: flex; gap: 6px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager a, .pager .cur { min-width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); font-weight: 700; padding: 0 6px; font-size: 13.5px; }
.pager a:hover { border-color: var(--gold-300); color: var(--gold-600); }
.pager .cur { background: var(--red); color: #fff; border-color: var(--red); }
.pager .total { margin-inline-start: auto; color: var(--ink-3); font-size: 13px; }

/* ---------- pills / tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.gold { background: var(--gold-soft); color: var(--gold-ink); }
.pill.yellow { background: var(--warn-soft); color: var(--warn); }
.pill.blue { background: var(--info-soft); color: var(--info); }
.pill.green { background: var(--ok-soft); color: var(--ok); }
.pill.red { background: var(--red-soft); color: var(--red-ink); }
.pill.grey { background: var(--grey-soft); color: var(--ink-2); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 8px; background: var(--panel-3); color: var(--ink-2); font-size: 12px; font-weight: 700; margin: 2px; }
.tag.gold { background: var(--gold-soft); color: var(--gold-ink); }
.tag.red { background: var(--red-soft); color: var(--red-ink); }
.tag.mq { background: #E6F1F5; color: #1B5A79; }
:root[data-theme="dark"] .tag.mq { background: rgba(102,170,200,.14); color: #8CC5DE; }
.tag .mi { font-size: 15px; }
.link-badge { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.link-badge .mi { font-size: 17px; }
.link-badge.ok { color: var(--ok); } .link-badge.err { color: var(--danger); } .link-badge.none { color: var(--ink-3); }

/* ---------- key/value + timeline ---------- */
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); }
.kv dt, .kv dd { margin: 0; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.kv dt { color: var(--ink-3); font-weight: 500; font-size: 13.5px; }
.kv dd { font-weight: 600; word-break: break-word; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 30px 18px; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 7px; top: 22px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 0; top: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); border: 3px solid var(--panel); box-shadow: 0 0 0 2px var(--gold); }
.timeline li.internal::after { background: var(--warn); box-shadow: 0 0 0 2px var(--warn); }
.timeline b { display: block; }
.timeline .note { margin-top: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 14px; }
.timeline li.internal .note { background: var(--warn-soft); border-style: dashed; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.gallery .g { position: relative; border-radius: 14px; overflow: hidden; aspect-ratio: 4/3; background: var(--panel-3); border: 1px solid var(--line); }
.gallery .g img { width: 100%; height: 100%; object-fit: cover; }
.gallery .g label { position: absolute; top: 6px; inset-inline-end: 6px; background: rgba(0,0,0,.55); color: #fff; border-radius: 8px; padding: 2px 6px; font-size: 12px; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.gallery .g label input { width: 14px; height: 14px; }
.gallery .g .first { position: absolute; bottom: 6px; inset-inline-start: 6px; background: var(--gold); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 8px; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 16px; padding: 18px; text-align: center; color: var(--ink-3); background: var(--panel-2); }
.dropzone .mi { font-size: 32px; color: var(--gold); display: block; margin: 0 auto 4px; }

/* ---------- charts (CSS only) ---------- */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding: 10px 4px 0; }
.bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; font-size: 11px; color: var(--ink-3); min-width: 0; }
.bars .bar i { display: block; width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--gold-300), var(--gold)); min-height: 4px; position: relative; transition: height .4s; }
.bars .bar i:hover { background: linear-gradient(180deg, var(--red-300), var(--red)); }
.bars .bar b { color: var(--ink); font-size: 11.5px; }
.hbar { display: grid; grid-template-columns: minmax(0, 170px) 1fr 44px; gap: 12px; align-items: center; margin-bottom: 12px; font-size: 13.5px; }
.hbar .name { display: flex; align-items: center; gap: 8px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 600; }
.hbar .name .mi { color: var(--gold); font-size: 18px; }
.hbar .track { height: 10px; background: var(--panel-3); border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 99px; }
[dir="rtl"] .hbar .track i { background: linear-gradient(270deg, var(--gold), var(--red)); }
.hbar b { text-align: end; font-variant-numeric: tabular-nums; }
.donut-legend { display: grid; gap: 8px; }
.donut-legend div { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 12px; padding: 11px 22px; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .ic { width: 38px; height: 38px; border-radius: 12px; background: var(--gold-soft); color: var(--gold-600); display: grid; place-items: center; flex: none; }

/* ---------- permission matrix ---------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: start; position: sticky; inset-inline-start: 0; background: var(--panel); z-index: 1; font-weight: 700; }
.matrix th:first-child { background: var(--panel-2); }
.matrix .cell { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-width: 160px; }
.matrix .cell label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--panel-3); cursor: pointer; font-weight: 600; border: 1px solid transparent; }
.matrix .cell label:has(input:checked) { background: var(--gold-soft); color: var(--gold-ink); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.matrix .cell input { width: 14px; height: 14px; }
.matrix .full { color: var(--ok); font-weight: 800; }
.mod-ic { display: inline-flex; align-items: center; gap: 8px; }
.mod-ic .mi { color: var(--gold); }

/* ---------- repeater rows (service fields, journey steps) ---------- */
.rep { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; background: var(--panel-2); position: relative; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; background: var(--panel); }
.steps li .n { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--gold), var(--gold-600)); color: #fff; font-weight: 800; display: grid; place-items: center; flex: none; }
.steps li .handle { cursor: grab; color: var(--ink-3); }
.steps li.dragging { opacity: .5; }

/* ticker preview */
.ticker-preview { overflow: hidden; border-radius: 14px; background: linear-gradient(90deg, #2B201B, #3A1A20); color: #F6EBD3; padding: 10px 0; position: relative; }
.ticker-preview .track { display: inline-flex; gap: 40px; white-space: nowrap; animation: tick 28s linear infinite; padding-inline-start: 100%; }
.ticker-preview .it { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ticker-preview .it .mi { color: #E3CFA2; font-size: 19px; }
@keyframes tick { to { transform: translateX(-100%); } }
[dir="rtl"] .ticker-preview .track { animation-name: tick-rtl; }
@keyframes tick-rtl { to { transform: translateX(100%); } }
.tone-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.tone-dot.gold { background: #87754E; } .tone-dot.red { background: #862633; } .tone-dot.info { background: #2B5E87; } .tone-dot.success { background: #2E7D4F; }

/* listing card in the review list */
.l-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; padding: 18px; }
.l-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--panel); display: flex; flex-direction: column; transition: .15s; }
.l-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.l-card .ph { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--gold-soft), var(--panel-3)); display: grid; place-items: center; color: var(--gold); }
.l-card .ph img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.l-card .ph .mi { font-size: 44px; }
.l-card .ph .tl { position: absolute; top: 10px; inset-inline-start: 10px; display: flex; gap: 6px; }
.l-card .ph .tr { position: absolute; top: 10px; inset-inline-end: 10px; }
.l-card .bd { padding: 12px 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.l-card .bd b { font-size: 15px; line-height: 1.35; }
.l-card .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-3); }
.l-card .meta span { display: inline-flex; align-items: center; gap: 4px; }
.l-card .meta .mi { font-size: 16px; }
.l-card .price { font-weight: 800; color: var(--red); font-size: 16px; }
.l-card .ft { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); background: var(--bg); }
.auth-brand {
  position: relative; overflow: hidden; color: #FFF8EC; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate;
  background: radial-gradient(700px 420px at 100% 0%, rgba(201,180,138,.32), transparent 62%), radial-gradient(600px 460px at 0% 100%, rgba(134,38,51,.65), transparent 60%), linear-gradient(160deg, #1E1714, #2E1F1A 50%, #47161F);
}
.auth-brand::before { content: ""; position: absolute; inset: -40px; background: url("../img/pattern.svg") center/170px repeat; opacity: .09; z-index: -1; }
.auth-brand .logos { display: flex; align-items: center; gap: 14px; }
.auth-brand .logos .lg { background: #fff; border-radius: 18px; padding: 12px 16px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.6); }
.auth-brand .logos .lg img { height: 64px; width: auto; }
.auth-brand .logos .x { font-size: 26px; color: #E3CFA2; font-weight: 300; }
.auth-brand h1 { font-size: 40px; font-weight: 900; margin: 30px 0 12px; line-height: 1.2; letter-spacing: -.01em; }
.auth-brand h1 em { font-style: normal; color: #E3CFA2; }
.auth-brand p { font-size: 17px; opacity: .82; max-width: 40ch; }
.auth-brand ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; max-width: 460px; }
.auth-brand li { display: flex; align-items: center; gap: 12px; font-weight: 500; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.auth-brand li .mi { color: #E3CFA2; background: rgba(201,180,138,.14); border-radius: 10px; padding: 7px; }
.auth-brand .foot { font-size: 12.5px; opacity: .6; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 24px; position: relative; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card .mark { width: 64px; height: 64px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: center; margin-bottom: 22px; }
.auth-card .mark img { width: 46px; }
.auth-card h2 { font-size: 28px; font-weight: 900; margin-bottom: 6px; letter-spacing: -.01em; }
.auth-card > p, .auth-card .lead { color: var(--ink-2); margin: 0 0 24px; }
.auth-tools { position: absolute; top: 20px; inset-inline-end: 24px; display: flex; gap: 8px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px 0 18px; flex-wrap: wrap; }
.auth-row a { color: var(--red); font-weight: 700; }
.auth-row a:hover { text-decoration: underline; }
.auth-foot { text-align: center; margin-top: 22px; color: var(--ink-3); font-size: 13px; }
.auth-card .btn { min-height: 50px; font-size: 16px; }
.strength { height: 6px; background: var(--panel-3); border-radius: 6px; overflow: hidden; margin-top: 4px; }
.strength i { display: block; height: 100%; width: 0; background: var(--danger); transition: width .2s, background .2s; }

.scrim { display: none; }

/* ---------- idle sign-out warning (Assets/js/session.js) ---------- */
.idle { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(20,14,12,.55); backdrop-filter: blur(4px); animation: idle-fade .18s ease-out; }
.idle[hidden] { display: none; }
.idle-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 30px 26px 22px; text-align: center; animation: idle-pop .22s ease-out; }
.idle-ring { position: relative; width: 96px; height: 96px; margin: 0 auto 16px; }
.idle-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.idle-ring circle { fill: none; stroke-width: 6; }
.idle-ring .track { stroke: var(--gold-soft); }
.idle-ring .bar { stroke: var(--red); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.idle-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 22px; color: var(--red); direction: ltr; font-variant-numeric: tabular-nums; }
.idle-card h2 { font-size: 21px; font-weight: 800; margin-bottom: 6px; }
.idle-card p { margin: 0 0 20px; color: var(--ink-2); }
.idle-card p b { color: var(--ink); font-variant-numeric: tabular-nums; }
.idle-actions { display: flex; flex-direction: column; gap: 10px; }
@keyframes idle-fade { from { opacity: 0; } }
@keyframes idle-pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- misc ---------- */
.note-box { border-radius: 14px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.code-box { direction: ltr; text-align: left; font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: #1B1714; color: #EDE3D1; border-radius: 12px; padding: 12px 14px; white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; }
.placeholders { display: flex; flex-wrap: wrap; gap: 6px; }
.placeholders code { direction: ltr; font-size: 12px; padding: 2px 8px; border-radius: 8px; background: var(--gold-soft); color: var(--gold-ink); cursor: copy; }
.stat-inline { display: flex; gap: 22px; flex-wrap: wrap; }
.stat-inline div b { display: block; font-size: 20px; font-weight: 800; }
.stat-inline div span { color: var(--ink-3); font-size: 12.5px; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head .big-av { width: 64px; height: 64px; border-radius: 18px; background: linear-gradient(135deg, var(--gold), var(--gold-600)); color: #fff; font-size: 26px; font-weight: 800; display: grid; place-items: center; flex: none; }
.profile-head h3 { font-size: 20px; }

/* ---------- project indicators ---------- */
/* direction colours: shortage = opportunity (green), balanced (blue), surplus (gold) */
.ind-kpis .kpi .delta { color: var(--ink-3); font-weight: 600; }
.ind-kpis .kpi.c-ok .delta { color: var(--ok); font-weight: 700; }
.ind-kpis .kpi .delta .mi { font-size: 16px; }
.ind-tbl td { vertical-align: top; }
.ind-grid { grid-template-columns: minmax(0, 2.1fr) minmax(340px, 1fr); }
.ind-tbl td:first-child { min-width: 180px; }
.ind-tbl th, .ind-tbl td { padding-inline: 12px; }
.ind-opp, .ind-upd { white-space: nowrap; }
.ind-tbl .ind-mini { font-size: 13px; margin-inline-end: 3px; }
.ind-tbl .tag .mi { font-size: 14px; }
.ind-row.is-editing td { background: var(--gold-soft); }
.ind-row td:first-child { border-inline-start: 3px solid transparent; }
.ind-row.shortage td:first-child { border-inline-start-color: var(--ok); }
.ind-row.balanced td:first-child { border-inline-start-color: var(--info); }
.ind-row.surplus td:first-child { border-inline-start-color: var(--gold); }
.ind-note { margin-top: 4px; max-width: 52ch; line-height: 1.55; }
.ind-opp { color: var(--ok); font-weight: 700; margin-top: 4px; }
.ind-val { display: inline-flex; align-items: baseline; gap: 6px; direction: ltr; font-variant-numeric: tabular-nums; }
[dir="rtl"] .ind-val { flex-direction: row-reverse; }
.ind-val b { font-size: 16px; font-weight: 800; }
.ind-val small { color: var(--ink-3); font-weight: 600; direction: rtl; unicode-bidi: isolate; }
.ind-val .mi { font-size: 18px; align-self: center; }
.ind-val.shortage .mi { color: var(--ok); } .ind-val.balanced .mi { color: var(--info); } .ind-val.surplus .mi { color: var(--gold); }
.ind-dirs { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.ind-dirs legend { grid-column: 1 / -1; padding: 0; margin-bottom: 6px; }
.ind-dir { position: relative; cursor: pointer; }
.field.req.ind-dirs > label.ind-dir::after { content: none; }
.ind-dir input { position: absolute; opacity: 0; pointer-events: none; }
.ind-dir .box { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; row-gap: 1px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line-2); background: var(--panel); transition: border-color .15s, background .15s, transform .1s; }
.ind-dir .box .mi { grid-row: 1 / span 2; font-size: 24px; color: var(--ink-3); }
.ind-dir .box b { font-size: 14.5px; }
.ind-dir .box small { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.ind-dir:active .box { transform: scale(.98); }
.ind-dir input:focus-visible + .box { box-shadow: var(--focus); }
.ind-dir.shortage input:checked + .box { border-color: var(--ok); background: var(--ok-soft); }
.ind-dir.shortage input:checked + .box .mi, .ind-dir.shortage input:checked + .box b { color: var(--ok); }
.ind-dir.balanced input:checked + .box { border-color: var(--info); background: var(--info-soft); }
.ind-dir.balanced input:checked + .box .mi, .ind-dir.balanced input:checked + .box b { color: var(--info); }
.ind-dir.surplus input:checked + .box { border-color: var(--gold); background: var(--gold-soft); }
.ind-dir.surplus input:checked + .box .mi, .ind-dir.surplus input:checked + .box b { color: var(--gold-ink); }
.ind-zero[hidden] { display: none; }
.ind-zero { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; color: var(--info); background: var(--info-soft); border-color: transparent; }
.ind-help { margin: -8px 0 16px; }
.ind-preview { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.ind-preview .lbl { display: block; margin-bottom: 8px; color: var(--ink-3); font-size: 12.5px; }
.ind-pv { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.ind-pv .bar { align-self: stretch; border-radius: 4px; background: var(--line-2); }
.ind-pv.shortage .bar { background: var(--ok); } .ind-pv.balanced .bar { background: var(--info); } .ind-pv.surplus .bar { background: var(--gold); }
.ind-pv .txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ind-pv .txt small { color: var(--ink-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ind-pv .val { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ind-pv .val b { font-size: 16px; font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
@media (max-width: 1100px) { .ind-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- responsive ---------- */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero .logos { display: none; }
}
@media (max-width: 1100px) {
  .grid-main, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 60; inset-block: 0; inset-inline-start: 0; width: min(86vw, 300px); transition: transform .25s ease; }
  [dir=rtl] .side { transform: translateX(105%); }
  [dir=ltr] .side { transform: translateX(-105%); }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(15,10,8,.5); }
  .icon-btn.menu-btn { display: inline-grid; }
  .topbar { padding: 10px 14px; }
  .page { padding: 18px 14px 50px; }
  .grid-2, .form-row, .form-row.three, .form-row.four { grid-template-columns: minmax(0, 1fr); }
  .user-menu .who, .chip-btn .lbl { display: none; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .kv { grid-template-columns: 120px minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .kpis, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .topbar h1 { font-size: 17px; }
  .hbar { grid-template-columns: 100px 1fr 34px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .topbar, .actions, .toolbar, .pager, .btn { display: none !important; } .app { display: block; } .page { padding: 0; } }
