/* ═══════════════════════════════════════════════════════════════
   ARIDO Dishdasha — design system (the ARIDO family layout and components, re-coloured to SPEC §3)
   Navy #0B2545 · Sky #0EA5E9 · Off-white #F7F5F0 · Cairo · 8px grid · RTL
   ═══════════════════════════════════════════════════════════════ */

@font-face { font-family: Cairo; src: url(/fonts/cairo-arabic-400.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-arabic-500.woff2) format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-arabic-600.woff2) format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-arabic-700.woff2) format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-latin-400.woff2) format('woff2'); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-latin-500.woff2) format('woff2'); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-latin-600.woff2) format('woff2'); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF; }
@font-face { font-family: Cairo; src: url(/fonts/cairo-latin-700.woff2) format('woff2'); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2190-21FF; }

:root {
  /* SPEC §3 */
  --navy: #0B2545; --navy-2: #13315C; --navy-3: #1D4E89;
  --sky: #0EA5E9; --sky-2: #0284C7; --sky-light: #38BDF8; --sky-soft: #E0F2FE;
  --bg: #F7F5F0; --card: #FFFFFF; --card-2: #FCFBF8;
  --text: #0F172A; --muted: #64748B; --faint: #94A3B8; --border: #E5E1D8; --border-2: #EFECE6; --row: #FBFAF7;
  --green: #15803D; --green-soft: #DCFCE7;
  --red: #B91C1C; --red-soft: #FEE2E2;
  --amber: #B45309; --amber-soft: #FEF3C7;
  --orange: #B45309; --orange-soft: #FEF3C7;         /* warnings use the SPEC amber */
  --violet: #6D28D9; --violet-soft: #EDE9FE;
  --teal: #0F766E; --teal-soft: #CCFBF1;
  --slate: #334155; --slate-soft: #E2E8F0;
  /* derived */
  --ink: #102A4C;              /* headings and active labels on light backgrounds (between navy and navy-2) */
  --head: #F3F1EB;             /* table headers, footers */
  --hover: #F4F2EC;            /* ghost hover */
  --focus: rgba(14, 165, 233, .45);
  --radius: 10px; --radius-lg: 12px; --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 18px 48px rgba(11, 37, 69, .24);
  --topbar: 56px; --sidebar: 92px;
  --font: Cairo, 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); font-size: 14px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sky-2); text-decoration: none; }
a:hover { color: var(--navy-3); }
[v-cloak] { display: none; }
.num, .ltr { direction: ltr; unicode-bidi: isolate; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.b { font-weight: 700; } .sb { font-weight: 600; } .md { font-weight: 500; }
.green { color: var(--green); } .red { color: var(--red); } .orange, .amber { color: var(--amber); } .sky { color: var(--sky-2); } .navy { color: var(--navy-3); } .violet { color: var(--violet); }
.grow { flex: 1 1 auto; min-width: 0; } .nowrap { white-space: nowrap; } .ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 8px; } .row.wrap { flex-wrap: wrap; } .row.top { align-items: flex-start; } .row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 8px; }
.gap-4 { gap: 4px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.center { text-align: center; } .end { text-align: left; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
::selection { background: rgba(14, 165, 233, .28); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D3CEC3; border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #B9B3A6; background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
@media (max-width: 1100px) { .hide-md { display: none !important; } }
@media (max-width: 860px) { .hide-sm { display: none !important; } }

/* ───────────── Shell layout ───────────── */
.app { height: 100vh; height: 100dvh; display: grid; grid-template-columns: var(--sidebar) 1fr; grid-template-rows: var(--topbar) 1fr; grid-template-areas: "side top" "side main"; }
/* the main PC stopped answering: a full-width red line above everything (SPEC §6.12 «انقطاع الحاسبة الرئيسية») */
.app.has-banner { grid-template-rows: auto var(--topbar) 1fr; grid-template-areas: "banner banner" "side top" "side main"; }
.offline-banner { grid-area: banner; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 9px 16px; background: var(--red); color: #fff; font-weight: 700; font-size: 14.5px; text-align: center; z-index: 60; box-shadow: 0 2px 8px rgba(185, 28, 28, .35); }
.offline-banner svg { width: 20px; height: 20px; flex: none; }
.offline-banner .spinner { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
.offline-banner.fixed { position: fixed; inset: 0 0 auto 0; }
.offline-banner .btn { height: 30px; font-size: 12.5px; padding: 0 10px; background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .4); color: #fff; }
.offline-banner .btn:hover { background: rgba(255, 255, 255, .25); }

.topbar { grid-area: top; background: var(--navy); color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 16px; min-width: 0; border-bottom: 2px solid var(--sky); }
.sidebar { grid-area: side; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy-3) 100%); color: #C9D8EE; display: flex; flex-direction: column; align-items: stretch; padding: 8px; gap: 4px; overflow-x: hidden; overflow-y: auto; scrollbar-width: none; position: sticky; top: 0; height: 100%; z-index: 41; }
.sidebar::-webkit-scrollbar { display: none; }
.sidebar .side-brand { display: none; }
.main { grid-area: main; overflow: auto; min-width: 0; position: relative; }
.page { padding: 16px; max-width: 1600px; margin: 0 auto; }
.page.full { max-width: none; height: 100%; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* the program's name keeps its width in a crowded top bar (zone chip): the quick search gives way instead */
.topbar .brand { flex: none; }
.brand-logo { width: 36px; height: 36px; flex: none; border-radius: 9px; object-fit: contain; }
.brand-name { font-weight: 700; font-size: 16px; line-height: 1.15; white-space: nowrap; }
.brand-name small { display: block; font-weight: 500; font-size: 11.5px; color: #9CCBF0; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.tb-sep { width: 1px; align-self: stretch; margin: 12px 0; background: rgba(255, 255, 255, .14); }
.tb-item { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; color: #DCEBFA; padding: 6px 10px; border-radius: 8px; border: 0; background: transparent; cursor: default; position: relative; }
button.tb-item, a.tb-item { cursor: pointer; } button.tb-item:hover, a.tb-item:hover { background: rgba(255, 255, 255, .1); color: #fff; }
button.tb-exit { color: #FECACA; font-weight: 600; border: 1px solid rgba(254, 202, 202, .35); }
button.tb-exit:hover { background: rgba(185, 28, 28, .3); color: #fff; }
.tb-menu-btn { display: none !important; }
.tb-item .dot { width: 9px; height: 9px; border-radius: 50%; background: #4ADE80; box-shadow: 0 0 0 3px rgba(74, 222, 128, .25); flex: none; }
.tb-item .dot.off { background: #F87171; box-shadow: 0 0 0 3px rgba(248, 113, 113, .25); }
.tb-item .dot.warn { background: #FBBF24; box-shadow: 0 0 0 3px rgba(251, 191, 36, .25); }
.tb-user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--sky-2); display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; border: 2px solid rgba(255, 255, 255, .25); }
.tb-user .n { font-weight: 600; font-size: 13.5px; line-height: 1.15; } .tb-user .r { font-size: 11.5px; color: #9CCBF0; }
.tb-clock { text-align: left; line-height: 1.15; white-space: nowrap; flex: none; } .tb-clock .d { font-size: 11.5px; color: #9CCBF0; } .tb-clock .t { font-size: 17px; font-weight: 700; }
.tb-menu { position: absolute; top: 48px; left: 0; min-width: 230px; z-index: 45; padding: 6px; color: var(--text); }
/* outside the shop (SPEC §7.4): the zone is always visible in the top bar */
.zone-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.zone-chip svg { width: 15px; height: 15px; }
.zone-chip.tailnet { background: rgba(56, 189, 248, .18); color: #BAE6FD; border: 1px solid rgba(56, 189, 248, .45); }
.zone-chip.public { background: rgba(251, 191, 36, .18); color: #FDE68A; border: 1px solid rgba(251, 191, 36, .5); }

/* the alerts bell (SPEC §6.12) */
.bell { position: relative; }
.bell .cnt { position: absolute; top: 0; inset-inline-start: 18px; min-width: 18px; height: 18px; border-radius: 9px; background: #EF4444; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; direction: ltr; border: 2px solid var(--navy); line-height: 1; }
.bell.ring > svg { animation: ring 1s ease-in-out 2; transform-origin: 50% 0; }
@keyframes ring { 0%, 100% { transform: rotate(0) } 20% { transform: rotate(16deg) } 40% { transform: rotate(-14deg) } 60% { transform: rotate(9deg) } 80% { transform: rotate(-5deg) } }
.bell-menu { position: absolute; top: 48px; left: -60px; width: min(380px, calc(100vw - 24px)); z-index: 45; color: var(--text); padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: min(520px, calc(100vh - 80px)); }
.bell-menu .bm-h { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border-2); font-weight: 700; }
.bell-menu .bm-list { overflow: auto; flex: 1; }
.bell-menu .bm-f { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--border-2); background: var(--card-2); }
.alert-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--border-2); cursor: pointer; position: relative; }
.alert-row:last-child { border-bottom: 0; }
.alert-row:hover { background: var(--row); }
.alert-row .sev { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--sky-soft); color: var(--sky-2); }
.alert-row .sev svg { width: 17px; height: 17px; }
.alert-row.warn .sev { background: var(--amber-soft); color: var(--amber); }
.alert-row.danger .sev { background: var(--red-soft); color: var(--red); }
.alert-row .t { font-weight: 700; line-height: 1.35; }
.alert-row .m { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.alert-row .w { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.alert-row.unread::before { content: ""; position: absolute; inset-inline-start: 4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--sky); }
.alert-row.unread .t { color: var(--navy); }
.alert-row .rd { margin-inline-start: auto; flex: none; }

/* global quick search in the top bar */
.tb-search { position: relative; width: min(360px, 32vw); min-width: 140px; }
.tb-search input { width: 100%; height: 36px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1); color: #fff; padding: 0 14px; padding-inline-start: 36px; outline: none; }
.tb-search input::placeholder { color: #9CCBF0; }
.tb-search input:focus { background: #fff; color: var(--text); border-color: #fff; box-shadow: 0 0 0 3px var(--focus); }
.tb-search input:focus::placeholder { color: var(--faint); }
.tb-search > svg { position: absolute; inset-inline-start: 12px; top: 9px; width: 18px; height: 18px; color: #9CCBF0; pointer-events: none; }
.tb-search input:focus + svg, .tb-search:focus-within > svg { color: var(--muted); }
/* .kbd is direction: ltr, so a logical inset would resolve against ITS direction and sit on the icon: the far (left) end, physically */
.tb-search .kbd { position: absolute; left: 10px; top: 8px; background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #DCEBFA; }
.tb-search:focus-within .kbd { display: none; }
.suggest { position: absolute; top: calc(100% + 6px); inset-inline: 0; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 46; max-height: 420px; overflow: auto; padding: 4px; color: var(--text); min-width: 300px; }
.suggest .it { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.suggest .it.on, .suggest .it:hover { background: var(--sky-soft); }
.suggest .it .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--sky-soft); color: var(--sky-2); flex: none; }
.suggest .it.on .ic { background: #fff; }
.suggest .it .ic svg { width: 17px; height: 17px; }
.suggest .it .nm { font-weight: 700; }
.suggest .foot { font-size: 12px; color: var(--muted); padding: 6px 10px; border-top: 1px solid var(--border-2); margin-top: 4px; }

.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 8px 4px 7px; border-radius: 10px; color: #C9D8EE; font-size: 12.5px; font-weight: 600; text-align: center; cursor: pointer; user-select: none; border: 0; background: transparent; width: 100%; position: relative; line-height: 1.25; flex: none; }
.nav-item svg { width: 22px; height: 22px; }
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active { background: var(--sky); color: #fff; font-weight: 700; box-shadow: 0 4px 14px rgba(14, 165, 233, .35); }
.nav-item .cnt { position: absolute; top: 4px; inset-inline-end: 6px; min-width: 18px; height: 18px; border-radius: 9px; background: #EF4444; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; direction: ltr; }
.nav-item.active .cnt { background: #fff; color: var(--red); }
.sidebar .spacer { flex: 1; min-height: 6px; }
.sidebar .ver { font-size: 10.5px; color: #8FB2D9; text-align: center; padding: 6px 0; line-height: 1.35; flex: none; }
.nav-backdrop { display: none; }

@media (max-height: 760px) {
  :root { --topbar: 52px; }
  .nav-item { padding: 6px 4px 5px; font-size: 11.5px; gap: 1px; } .nav-item svg { width: 20px; height: 20px; }
  .sidebar { gap: 2px; padding: 6px; }
  .page { padding: 12px; }
}
@media (max-width: 1100px) { .tb-hide-md { display: none !important; } }
@media (max-width: 900px) { .tb-hide-sm { display: none !important; } :root { --sidebar: 80px; } .nav-item { font-size: 11.5px; } .page { padding: 12px; } }
/* phones: the sidebar becomes a drawer opened from the menu button of the top bar */
@media (max-width: 760px) {
  .app, .app.has-banner { grid-template-columns: 1fr; }
  .app { grid-template-rows: var(--topbar) 1fr; grid-template-areas: "top" "main"; }
  .app.has-banner { grid-template-rows: auto var(--topbar) 1fr; grid-template-areas: "banner" "top" "main"; }
  .tb-menu-btn { display: flex !important; padding: 6px; }
  .tb-menu-btn svg { width: 22px; height: 22px; }
  .topbar { gap: 6px; padding: 0 8px; }
  .topbar .brand-name { display: none; }
  .topbar .brand-logo { width: 32px; height: 32px; }
  .tb-search { width: auto; flex: 1 1 auto; min-width: 0; }
  .tb-search .kbd { display: none; }
  .tb-item { padding: 6px; }
  .sidebar { position: fixed; top: 0; bottom: 0; right: 0; width: min(280px, 82vw); height: 100%; transform: translateX(105%); transition: transform .2s ease-out; padding: 12px 10px; gap: 2px; box-shadow: var(--shadow-lg); }
  .app.nav-open .sidebar { transform: translateX(0); }
  .app.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; background: rgba(11, 37, 69, .45); z-index: 40; }
  .sidebar .side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; margin-bottom: 6px; border-bottom: 1px solid rgba(255, 255, 255, .12); color: #fff; }
  .sidebar .side-brand img { width: 40px; height: 40px; border-radius: 10px; }
  .sidebar .side-brand b { font-size: 16px; } .sidebar .side-brand small { display: block; color: #9CCBF0; font-size: 12px; }
  .nav-item { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 12px; font-size: 15px; text-align: right; }
  .nav-item .cnt { position: static; margin-inline-start: auto; }
  .page { padding: 10px; }
  .bell-menu { position: fixed; top: calc(var(--topbar) + 4px); left: 12px; right: 12px; width: auto; }
  .tb-menu { position: fixed; top: calc(var(--topbar) + 4px); left: 12px; }
}

/* ───────────── Page header ───────────── */
.ph { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ph-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); display: grid; place-items: center; color: var(--sky-2); flex: none; }
.ph-icon svg { width: 22px; height: 22px; }
.ph h1 { font-size: 19px; margin: 0; line-height: 1.2; color: var(--ink); } .ph .sub { font-size: 12.5px; color: var(--muted); }
.ph > div:nth-child(2) { flex: 1 1 220px; min-width: 0; }
.ph .actions { margin-inline-start: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.ph .actions:empty { display: none; }

/* ───────────── Cards ───────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.card-pad { padding: 16px; }
.card-h { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); }
.card-h h3 { margin: 0; font-size: 15px; color: var(--ink); } .card-h .sub { font-size: 12px; color: var(--muted); }
.card-h .ico { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--sky-soft); color: var(--sky-2); flex: none; }
.card-h .ico svg { width: 19px; height: 19px; }
.card-h .end { margin-inline-start: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.card-b { padding: 14px 16px; }
.grid { display: grid; gap: 12px; }
.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)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1200px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) { .g3, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g2 { grid-template-columns: 1fr; } }

/* KPI tiles */
.kpi { position: relative; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--card); display: flex; gap: 12px; align-items: flex-start; min-width: 0; color: var(--text); }
a.kpi:hover { border-color: var(--sky-light); box-shadow: var(--shadow-md); color: var(--text); }
.kpi .k-ico { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.kpi .k-ico svg { width: 24px; height: 24px; }
.kpi .k-t { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.25; }
.kpi .k-s { font-size: 11.5px; color: var(--muted); }
.kpi .k-v { font-size: 24px; font-weight: 700; margin-top: 6px; line-height: 1.1; white-space: nowrap; color: var(--ink); }
.kpi .k-v small { font-size: 13px; font-weight: 600; color: var(--muted); }
.kpi .k-c { font-size: 11.5px; margin-top: 4px; display: flex; gap: 4px 8px; align-items: center; color: var(--muted); flex-wrap: wrap; line-height: 1.35; }
.kpi.sky { background: #F4FAFF; border-color: #CFE8FA; } .kpi.sky .k-ico { background: var(--sky-soft); color: var(--sky-2); }
.kpi.navy { background: #F5F8FC; border-color: #D3DEEE; } .kpi.navy .k-ico { background: #DCE6F4; color: var(--navy-3); }
.kpi.green { background: #F6FCF8; border-color: #CDEFD9; } .kpi.green .k-ico { background: var(--green-soft); color: var(--green); }
.kpi.orange, .kpi.amber { background: #FFFBF3; border-color: #F6E0B5; } .kpi.orange .k-ico, .kpi.amber .k-ico { background: var(--amber-soft); color: var(--amber); }
.kpi.red { background: #FFF8F8; border-color: #F9D3D3; } .kpi.red .k-ico { background: var(--red-soft); color: var(--red); }
.kpi.violet { background: #FAF8FF; border-color: #E2DAFB; } .kpi.violet .k-ico { background: var(--violet-soft); color: var(--violet); }
.kpi.teal { background: #F5FCFB; border-color: #C6EDE7; } .kpi.teal .k-ico { background: var(--teal-soft); color: var(--teal); }
.kpi.slate .k-ico { background: var(--slate-soft); color: var(--slate); }
.kpi.pending .k-v { color: var(--faint); }
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1200px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .kpi-row { gap: 8px; }
  .kpi { padding: 10px 12px; gap: 8px; } .kpi .k-ico { display: none; } .kpi .k-v { font-size: 20px; } .kpi .k-t { font-size: 12.5px; }
}

/* ───────────── Buttons (primary navy, accent sky) ───────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, box-shadow .12s; user-select: none; text-decoration: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:hover { background: var(--hover); color: var(--text); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.btn:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn.primary { background: var(--navy); color: #fff; border-color: var(--navy); } .btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.btn.accent { background: var(--sky); color: #fff; border-color: var(--sky); } .btn.accent:hover { background: var(--sky-2); border-color: var(--sky-2); color: #fff; }
.btn.dark { background: var(--navy-2); color: #fff; border-color: var(--navy-2); } .btn.dark:hover { background: var(--navy); color: #fff; }
.btn.success { background: var(--green); color: #fff; border-color: var(--green); } .btn.success:hover { background: #166534; color: #fff; }
.btn.danger { background: var(--red); color: #fff; border-color: var(--red); } .btn.danger:hover { background: #991B1B; color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; } .btn.ghost:hover { background: var(--hover); }
.btn.soft { background: var(--sky-soft); border-color: #BAE6FD; color: var(--navy-3); } .btn.soft:hover { background: #CDEBFB; }
.btn.soft-red { color: var(--red); border-color: #F5C2C2; background: #FFF; } .btn.soft-red:hover { background: var(--red-soft); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; border-radius: 8px; } .btn.sm svg { width: 16px; height: 16px; }
.btn.lg { height: 50px; font-size: 16px; padding: 0 20px; }
.btn.xl { height: 56px; font-size: 18px; }
.btn.icon { width: 40px; padding: 0; } .btn.sm.icon { width: 32px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--sky-2); cursor: pointer; padding: 0; font-weight: 600; }
.link-btn:hover { color: var(--navy-3); text-decoration: underline; }
.link-btn:disabled { color: var(--faint); cursor: default; text-decoration: none; }

/* ───────────── Forms ───────────── */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: #334155; }
.field > label .req { color: var(--red); margin-inline-start: 2px; }
.field .hint { font-size: 11.5px; color: var(--muted); }
.field .err-t { font-size: 11.5px; color: var(--red); font-weight: 600; }
.input, .select, textarea.input { height: 40px; width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; padding: 0 12px; outline: none; transition: border-color .12s, box-shadow .12s; min-width: 0; }
textarea.input { height: auto; min-height: 70px; padding: 8px 12px; resize: vertical; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(14, 165, 233, .22); }
.input:disabled, .select:disabled { background: var(--row); color: var(--muted); }
.input.lg { height: 48px; font-size: 17px; }
.input.num, .input.ltr { text-align: left; direction: ltr; }
.input.num:placeholder-shown, .input.ltr:placeholder-shown { direction: rtl; text-align: right; }
input[type=date].input { direction: ltr; text-align: right; }
.date-in { position: relative; display: flex; align-items: center; min-width: 0; }
.date-in .input { padding-right: 40px; }
.date-in .date-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.date-in .date-btn:hover { background: var(--sky-soft); color: var(--sky-2); }
.date-in .date-btn svg { width: 18px; height: 18px; }
.date-in .date-native { position: absolute; right: 4px; bottom: 0; width: 32px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }
.input[readonly] { background: var(--row); }
.input.err, .select.err { border-color: var(--red); box-shadow: 0 0 0 3px rgba(185, 28, 28, .12); }
.input.changed, .date-in.changed .input, .input-wrap.changed .input { background: #FFFBEB; border-color: #FCD34D; }
.select { appearance: none; padding-inline-end: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 10px center; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; inset-inline-start: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.input-wrap > .input { padding-inline-start: 38px; }
.input-wrap .suffix { position: absolute; inset-inline-end: 12px; color: var(--muted); font-size: 12.5px; pointer-events: none; }
.input-wrap .clear { position: absolute; inset-inline-end: 6px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--sky-2); margin: 0; flex: none; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .tr { width: 40px; height: 22px; border-radius: 22px; background: #CBD5E1; position: relative; transition: background .15s; flex: none; }
.switch .tr::after { content: ""; position: absolute; top: 3px; right: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: right .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .tr { background: var(--sky); }
.switch input:checked + .tr::after { right: 21px; }
.switch input:focus-visible + .tr { outline: 3px solid var(--focus); }
.switch input:disabled + .tr { opacity: .5; }
.seg { display: inline-flex; background: #EDEAE3; border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 34px; padding: 0 14px; border-radius: 8px; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button svg { width: 16px; height: 16px; }
.seg button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.seg.wrap { flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .form-grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .form-grid, .form-grid.g3 { grid-template-columns: 1fr; } }
.section-t { font-size: 13px; font-weight: 700; color: var(--navy-3); margin: 6px 0 2px; display: flex; align-items: center; gap: 8px; }
.section-t::after { content: ""; flex: 1; height: 1px; background: var(--border-2); }
/* password strength (SPEC §7.3: strong = 10+ characters with letters and digits) */
.pw-meter { display: flex; gap: 4px; margin-top: 2px; }
.pw-meter i { flex: 1; height: 5px; border-radius: 5px; background: #E7E3DA; }
.pw-meter.weak i:nth-child(1) { background: var(--red); }
.pw-meter.fair i:nth-child(-n+2) { background: var(--amber); }
.pw-meter.strong i { background: var(--green); }
.pw-label { font-size: 11.5px; font-weight: 700; } .pw-label.weak { color: var(--red); } .pw-label.fair { color: var(--amber); } .pw-label.strong { color: var(--green); }

/* ───────────── Tables ───────────── */
.table-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--head); color: #475569; font-size: 12.5px; font-weight: 600; text-align: right; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border-2); vertical-align: middle; }
.tbl tbody tr:hover td { background: var(--row); }
.tbl tr.sel td { background: var(--sky-soft) !important; }
.tbl tr.clickable { cursor: pointer; }
.tbl td.num, .tbl th.num { text-align: left; direction: ltr; white-space: nowrap; }
.tbl td.act { white-space: nowrap; text-align: left; width: 1%; }
.tbl td.chk, .tbl th.chk { width: 36px; padding-inline-end: 0; }
.tbl.compact td { padding: 7px 10px; } .tbl.compact th { padding: 8px 10px; }
.tbl tfoot td { background: var(--head); font-weight: 700; border-top: 1px solid var(--border); }
.tbl tr.dim td { opacity: .55; }
.list-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border-2); }
.list-tools .search { flex: 1 1 280px; min-width: 200px; }

/* ───────────── Badges / chips ───────────── */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: #EEEBE4; color: #475569; white-space: nowrap; vertical-align: middle; }
.badge svg { width: 13px; height: 13px; }
.badge.green { background: var(--green-soft); color: var(--green); } .badge.red { background: var(--red-soft); color: var(--red); }
.badge.orange, .badge.amber { background: var(--amber-soft); color: var(--amber); } .badge.sky { background: var(--sky-soft); color: var(--sky-2); }
.badge.navy { background: #DCE6F4; color: var(--navy-3); }
.badge.violet { background: var(--violet-soft); color: var(--violet); } .badge.teal { background: var(--teal-soft); color: var(--teal); }
.badge.dark { background: var(--navy); color: #fff; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--card-2); font-size: 13px; }
.chip button { border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; padding: 2px; border-radius: 5px; }
.chip button:hover { background: var(--hover); color: var(--red); }
.chip svg { width: 14px; height: 14px; }
/* the access zone of a sign-in (سجل الدخول) */
.zone { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 20px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.zone svg { width: 13px; height: 13px; }
.zone.local { background: #DCE6F4; color: var(--navy-3); }
.zone.lan { background: var(--green-soft); color: var(--green); }
.zone.tailnet { background: var(--sky-soft); color: var(--sky-2); }
.zone.public { background: var(--amber-soft); color: var(--amber); }

/* ───────────── Modal ───────────── */
.overlay { position: fixed; inset: 0; background: rgba(11, 37, 69, .42); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px; animation: fade .12s ease-out; }
.modal { background: #fff; border-radius: 14px; box-shadow: var(--shadow-lg); width: 100%; max-width: 560px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
.modal.sm { max-width: 420px; } .modal.md { max-width: 680px; } .modal.lg { max-width: 920px; } .modal.xl { max-width: 1180px; }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border-2); }
.modal-h h3 { margin: 0; font-size: 16.5px; color: var(--ink); } .modal-h .x { margin-inline-start: auto; }
.modal-b { padding: 16px 18px; overflow: auto; }
.modal-f { display: flex; gap: 8px; align-items: center; padding: 12px 18px; border-top: 1px solid var(--border-2); background: var(--card-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.modal-f .sp { flex: 1; }
@media (max-width: 560px) { .overlay { padding: 8px; } .modal-b { padding: 14px; } .modal-h, .modal-f { padding: 12px 14px; } }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985) } }

/* ───────────── Toasts ───────────── */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: #fff; box-shadow: var(--shadow-lg); border: 1px solid var(--border); border-inline-start: 5px solid var(--sky); font-weight: 500; animation: pop .15s ease-out; }
.toast svg { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--sky); }
.toast.success { border-inline-start-color: var(--green); } .toast.success svg { color: var(--green); }
.toast.error { border-inline-start-color: var(--red); } .toast.error svg { color: var(--red); }
.toast.warn { border-inline-start-color: var(--amber); } .toast.warn svg { color: var(--amber); }
.toast.alert { border-inline-start-color: var(--navy-3); } .toast.alert svg { color: var(--navy-3); }
.toast .close { margin-inline-start: auto; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; }
.toast.clickable { cursor: pointer; }

/* ───────────── Misc ───────────── */
.empty { padding: 32px 16px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.empty svg { width: 40px; height: 40px; color: #C4BEB1; }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(14, 165, 233, .2); border-top-color: var(--sky); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
.spinner.light { border-color: rgba(255, 255, 255, .3); border-top-color: #fff; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-block { display: grid; place-items: center; padding: 40px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--sky-soft); color: #0C4A6E; font-weight: 500; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert.warn { background: var(--amber-soft); color: #92400E; } .alert.error { background: var(--red-soft); color: var(--red); } .alert.success { background: var(--green-soft); color: #166534; }
.kbd { display: inline-block; font-family: var(--font); font-size: 11px; font-weight: 700; padding: 0 5px; border-radius: 5px; border: 1px solid #D3CEC3; background: var(--card-2); color: #475569; line-height: 18px; direction: ltr; }
.divider { height: 1px; background: var(--border-2); margin: 12px 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; scrollbar-width: thin; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tabs button svg { width: 17px; height: 17px; }
.tabs button:hover { color: var(--navy-3); }
.tabs button.on { color: var(--navy); border-bottom-color: var(--sky); }
.tabs.wrap { flex-wrap: wrap; overflow: visible; }
.tabs button .n { font-size: 11px; background: var(--hover); color: var(--muted); border-radius: 9px; padding: 0 6px; direction: ltr; }
.tabs button.on .n { background: var(--sky-soft); color: var(--sky-2); }
.side-tabs { display: flex; flex-direction: column; gap: 2px; }
.side-tabs button { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 10px 12px; border-radius: 9px; font-weight: 600; color: #475569; cursor: pointer; text-align: right; }
.side-tabs button svg { width: 18px; height: 18px; flex: none; }
.side-tabs button:hover { background: var(--hover); }
.side-tabs button.on { background: var(--navy); color: #fff; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-2); }
.list-item:last-child { border-bottom: 0; }
.stat-line { display: flex; justify-content: space-between; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--border-2); gap: 8px; }
.stat-line:last-child { border-bottom: 0; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.progress { height: 6px; border-radius: 6px; background: #EDEAE3; overflow: hidden; } .progress > i { display: block; height: 100%; background: var(--sky); border-radius: 6px; }
.filterbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; padding: 12px 14px; }
.filterbar .field { min-width: 150px; flex: 1 1 150px; }

/* ═══════════════ Login / setup ═══════════════ */
.auth { height: 100vh; height: 100dvh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--bg); }
.auth.with-banner { padding-top: 42px; }
.auth-brand { background: radial-gradient(900px 520px at 110% -10%, rgba(14, 165, 233, .55) 0%, transparent 60%), radial-gradient(700px 420px at -20% 120%, rgba(56, 189, 248, .22) 0%, transparent 60%), linear-gradient(160deg, #13315C 0%, #0B2545 70%); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px; position: relative; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; left: -120px; bottom: -120px; width: 380px; height: 380px; border: 60px solid rgba(224, 242, 254, .07); border-radius: 50%; }
.auth-brand .brand-logo { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.auth-brand h1 { font-size: 34px; margin: 0 0 8px; line-height: 1.3; }
.auth-brand p { color: #B9D6F2; font-size: 15px; margin: 0; max-width: 470px; }
.auth-brand .brand-name { font-size: 22px; } .auth-brand .brand-name small { color: #9CCBF0; font-size: 12.5px; }
.auth-feats { display: grid; gap: 14px; margin-top: 28px; }
.auth-feats div { display: flex; gap: 12px; align-items: center; color: #E0F2FE; }
.auth-feats svg { width: 22px; height: 22px; color: var(--sky-light); flex: none; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { font-size: 24px; margin: 0 0 4px; color: var(--ink); } .auth-card .sub { color: var(--muted); margin-bottom: 22px; }
.auth-card .shop-head { display: none; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form { align-items: flex-start; padding: 20px 16px; }
  .auth-card .shop-head { display: flex; align-items: center; gap: 12px; margin: 8px 0 18px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 70%, var(--sky-2) 130%); color: #fff; }
  .auth-card .shop-head img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
  .auth-card .shop-head b { font-size: 17px; display: block; line-height: 1.3; } .auth-card .shop-head small { color: #B9D6F2; }
}
.steps { display: flex; gap: 8px; margin-bottom: 18px; }
.steps div { flex: 1; height: 5px; border-radius: 5px; background: #E7E3DA; } .steps div.on { background: var(--sky); }
.step-names { display: flex; gap: 8px; margin: -12px 0 16px; }
.step-names span { flex: 1; font-size: 11.5px; font-weight: 600; color: var(--faint); text-align: center; } .step-names span.on { color: var(--navy-3); }

/* PIN pad (touch first: 64px keys) */
.pin-dots { display: flex; justify-content: center; gap: 12px; height: 20px; align-items: center; margin: 4px 0 2px; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); background: transparent; transition: background .1s, border-color .1s; }
.pin-dots span.on { background: var(--navy); border-color: var(--navy); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; direction: ltr; }
.keypad button { height: 64px; border-radius: var(--radius); border: 1px solid var(--border); background: #fff; font-size: 24px; font-weight: 600; color: var(--text); cursor: pointer; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; display: grid; place-items: center; }
.keypad button:hover { background: var(--sky-soft); }
.keypad button:active { transform: translateY(1px); background: var(--sky-soft); }
.keypad button.alt { color: var(--muted); }
.keypad button.go { background: var(--navy); border-color: var(--navy); color: #fff; }
.keypad button.go:hover { background: var(--navy-2); }
.keypad button.go:disabled { opacity: .6; cursor: default; }
.keypad button svg { width: 26px; height: 26px; }
@media (max-height: 700px) { .keypad button { height: 54px; } }

/* the main PC does not answer (before the sign-in) */
.offline-page { height: 100vh; height: 100dvh; display: grid; place-items: center; padding: 16px; background: radial-gradient(800px 400px at 50% -10%, rgba(14, 165, 233, .12), transparent 70%), var(--bg); }
.offline-page .card { max-width: 520px; text-align: center; padding: 28px 24px; }
.offline-page .ic { width: 72px; height: 72px; border-radius: 18px; background: var(--red-soft); color: var(--red); display: grid; place-items: center; margin: 0 auto 14px; }
.offline-page .ic svg { width: 38px; height: 38px; }
.offline-page h2 { margin: 0 0 6px; color: var(--ink); }

/* printing helpers */
.print-frame { position: fixed; width: 0; height: 0; border: 0; left: -9999px; top: -9999px; }

/* ───────────── the tabs of a sidebar group (fixed on top of the page) ───────────── */
.group-tabs { position: sticky; top: 0; z-index: 20; display: flex; gap: 4px; padding: 8px 16px 0; background: var(--bg); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.group-tabs::-webkit-scrollbar { display: none; }
.group-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px 10px; border-radius: 10px 10px 0 0; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; border: 1px solid transparent; border-bottom: 0; margin-bottom: -1px; }
.group-tabs a svg { width: 17px; height: 17px; }
.group-tabs a:hover { color: var(--navy-3); background: rgba(14, 165, 233, .06); }
.group-tabs a.on { color: var(--navy); background: var(--card); border-color: var(--border); box-shadow: inset 0 3px 0 var(--sky); }
@media (max-width: 760px) { .group-tabs { padding: 6px 8px 0; } .group-tabs a { padding: 8px 12px 9px; font-size: 13px; } }
.set-sec-h { font-size: 16px; font-weight: 800; color: var(--ink); padding-bottom: 8px; margin-bottom: 4px; border-bottom: 2px solid var(--border-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.set-sec-h svg { color: var(--sky-2); }

/* the screen that is not built yet */
.soon { max-width: 640px; margin: 48px auto; text-align: center; padding: 36px 24px; }
.soon .ic { width: 84px; height: 84px; border-radius: 22px; margin: 0 auto 16px; display: grid; place-items: center; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-3) 60%, var(--sky) 130%); color: #fff; box-shadow: 0 10px 30px rgba(11, 37, 69, .25); }
.soon .ic svg { width: 42px; height: 42px; }
.soon h2 { margin: 0 0 6px; color: var(--ink); font-size: 22px; }

/* ───────────── settings ───────────── */
.upload-box { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: var(--radius); background: var(--card-2); flex-wrap: wrap; }
.upload-box .preview { width: 96px; height: 96px; border-radius: 10px; background: var(--sky-soft); overflow: hidden; display: grid; place-items: center; color: var(--muted); flex: none; border: 1px solid var(--border-2); }
.upload-box .preview img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.perm-matrix th.role { min-width: 110px; text-align: center; white-space: normal; line-height: 1.25; vertical-align: bottom; }
.perm-matrix td.c { text-align: center; }
.perm-matrix tr.grp td { background: var(--card-2); font-weight: 800; color: var(--navy-3); font-size: 12.5px; }
.perm-matrix td.pn { min-width: 240px; }
.perm-matrix .cell, .perm-legend .cell { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--border); background: #fff; display: inline-grid; place-items: center; cursor: pointer; padding: 0; color: #CBD5E1; }
.perm-matrix .cell svg, .perm-legend .cell svg { width: 16px; height: 16px; }
.perm-matrix .cell.role, .perm-legend .cell.role { color: var(--navy-3); background: #F1F5FB; }
.perm-matrix .cell.grant, .perm-legend .cell.grant { background: var(--green); border-color: var(--green); color: #fff; }
.perm-matrix .cell.deny, .perm-legend .cell.deny { background: var(--red); border-color: var(--red); color: #fff; }
.perm-matrix .cell.dirty { box-shadow: 0 0 0 2px var(--amber); }
.perm-matrix .cell:disabled { cursor: default; opacity: .7; }
.perm-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.perm-legend .cell { width: 22px; height: 22px; cursor: default; }
.perm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border-2); }
.perm-row:last-child { border-bottom: 0; }
.perm-row .eff { width: 22px; text-align: center; }
@media (max-width: 560px) { .perm-row { grid-template-columns: minmax(0, 1fr) auto; } .perm-row .tri { grid-column: 1 / -1; } }
.tri { display: inline-flex; background: #EDEAE3; border-radius: 8px; padding: 2px; gap: 2px; }
.tri button { border: 0; background: transparent; height: 26px; padding: 0 9px; border-radius: 6px; font-weight: 600; font-size: 12px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tri button.on { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.tri button.on.grant { background: var(--green); color: #fff; } .tri button.on.deny { background: var(--red); color: #fff; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 14px; }
.check-grid label { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--border-2); background: #fff; cursor: pointer; font-weight: 600; font-size: 13px; }
.check-grid label.on { border-color: #F6C5C5; background: #FFF7F7; color: var(--red); }
.check-grid input { width: 17px; height: 17px; accent-color: var(--red); margin: 0; flex: none; }
.qr-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-card .qr { width: 200px; height: 200px; border-radius: 12px; border: 1px solid var(--border); padding: 8px; background: #fff; flex: none; }
.qr-card .qr img { width: 100%; height: 100%; }
.dev-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-2); flex-wrap: wrap; }
.dev-row:last-child { border-bottom: 0; }
.dev-ico { width: 40px; height: 40px; border-radius: var(--radius-sm); background: var(--sky-soft); color: var(--sky-2); display: grid; place-items: center; flex: none; }
.dev-ico svg { width: 20px; height: 20px; }
.coming { display: flex; align-items: center; gap: 14px; padding: 18px; border: 2px dashed #BFD7EE; border-radius: var(--radius-lg); background: repeating-linear-gradient(135deg, #F7FBFF 0 12px, #F1F7FD 12px 24px); color: var(--navy-3); }
.coming svg { width: 30px; height: 30px; flex: none; color: var(--sky-2); }
.coming b { font-size: 15px; }
.risk-list { margin: 8px 0 0; padding-inline-start: 20px; display: grid; gap: 4px; }

/* phones: the components (after their base rules, so these win) */
@media (max-width: 760px) {
  .ph { gap: 10px; margin-bottom: 10px; }
  .ph-icon { width: 38px; height: 38px; }
  .ph h1 { font-size: 17px; } .ph .sub { display: none; }
  .seg.wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
  .seg.wrap::-webkit-scrollbar { display: none; }
  .card-pad { padding: 12px; }
  .set-sec-h { font-size: 15px; }
}
