/* Basmat Dawami design system — navy header with S-curve sheet, lavender canvas, coral actions, 3D icon tiles. */
@font-face { font-family: Plex; src: url(fonts/IBMPlexSansArabic_400Regular.ttf) format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: Plex; src: url(fonts/IBMPlexSansArabic_600SemiBold.ttf) format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: Plex; src: url(fonts/IBMPlexSansArabic_700Bold.ttf) format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --navy: #1e2044; --navy-deep: #15162f; --navy-chip: #2c2f5c; --on-navy: #fff; --on-navy-muted: #b4b7d3;
  --bg: #eceef6; --surface: #fff; --surface-2: #f4f5fb; --text: #1b1d3a; --muted: #7a7f9a; --line: #e2e4f0;
  --coral: #f2545b; --coral-deep: #d63a44; --violet: #7b4dff; --blue: #2f6bff; --orange: #ff9a2e; --teal: #12b08a; --pink: #e5489a;
  --in: #16a874; --out: #f0505a; --pending: #e09a12; --warn: #c07800; --ok: #14935f; --err: #d63a44;
  --shadow: 0 14px 34px rgba(30, 32, 68, .12); --shadow-sm: 0 6px 16px rgba(30, 32, 68, .08);
  --r-lg: 26px; --r: 18px; --r-sm: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0c0d1f; --navy-deep: #07081a; --navy-chip: #1e2044; --on-navy-muted: #9ea2c2;
    --bg: #111228; --surface: #1b1d38; --surface-2: #23264a; --text: #e6e7f5; --muted: #9ea2c2; --line: #2d3058;
    --coral: #ff6168; --in: #2cc98e; --out: #ff6870; --shadow: 0 14px 34px rgba(0, 0, 0, .45); --shadow-sm: 0 6px 16px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --navy: #0c0d1f; --navy-deep: #07081a; --navy-chip: #1e2044; --on-navy-muted: #9ea2c2;
  --bg: #111228; --surface: #1b1d38; --surface-2: #23264a; --text: #e6e7f5; --muted: #9ea2c2; --line: #2d3058;
  --coral: #ff6168; --in: #2cc98e; --out: #ff6870; --shadow: 0 14px 34px rgba(0, 0, 0, .45); --shadow-sm: 0 6px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Plex, "Segoe UI", Tahoma, sans-serif; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--coral); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.3; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--coral) 55%, transparent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.right { margin-inline-start: auto; }
.hide { display: none !important; }

/* Navy header + S-curve sheet */
.hero { background: linear-gradient(180deg, var(--navy), var(--navy-deep)); color: var(--on-navy); padding: 20px 28px 64px; position: relative; }
.sheet { background: var(--bg); position: relative; margin-top: -44px; border-start-end-radius: 0; border-start-start-radius: 44px; padding: 28px; min-height: 60vh; }
.sheet::before { content: ""; position: absolute; inset-inline-end: 0; top: -44px; width: 44px; height: 44px; background: radial-gradient(circle at 0 0, transparent 43px, var(--bg) 44px); }
[dir="rtl"] .sheet::before { background: radial-gradient(circle at 100% 0, transparent 43px, var(--bg) 44px); }

/* Segmented tabs (like "Chats / Status / Calls") */
.seg { display: inline-flex; background: var(--navy-chip); border-radius: 18px; padding: 5px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--on-navy-muted); padding: 9px 18px; border-radius: 14px; cursor: pointer; font-weight: 600; min-height: 40px; }
.seg button[aria-selected="true"] { background: var(--navy-deep); color: #fff; box-shadow: 0 6px 14px rgba(0,0,0,.25); }
.seg.light { background: var(--surface-2); }
.seg.light button { color: var(--muted); }
.seg.light button[aria-selected="true"] { background: var(--navy); color: #fff; }

/* Cards */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 20px; }
.card.flat { box-shadow: var(--shadow-sm); }
.card h3 { font-size: 17px; }
.stat { display: flex; align-items: center; gap: 14px; }
.stat .num { font-size: 30px; font-weight: 700; line-height: 1; }
.stat .lbl { color: var(--muted); font-size: 13px; }

/* 3D icon tile (pure CSS + inline SVG glyph) */
.tile { --c: var(--violet); width: 44px; height: 44px; flex: 0 0 auto; border-radius: 30%; position: relative; display: inline-grid; place-items: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 72%, #000));
  box-shadow: 0 6px 0 -1px color-mix(in srgb, var(--c) 45%, #000), 0 12px 18px -6px color-mix(in srgb, var(--c) 60%, transparent), inset 0 1px 0 rgba(255,255,255,.45);
  animation: pop .5s cubic-bezier(.34,1.56,.64,1) both; }
.tile::after { content: ""; position: absolute; inset: 4px 6px 52% 6px; border-radius: 40% 40% 50% 50%; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); }
.tile svg { width: 56%; height: 56%; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 1.5px 0 rgba(0,0,0,.25)); position: relative; z-index: 1; }
.tile.sm { width: 32px; height: 32px; }
.tile.lg { width: 60px; height: 60px; }
.tile.idle-bell svg { animation: ring 1.6s ease-in-out infinite; transform-origin: 50% 10%; }
.tile.idle-scan::before { content: ""; position: absolute; inset-inline: 18%; height: 2px; top: 22%; z-index: 2; background: linear-gradient(90deg, transparent, #fff, transparent); animation: scan 1.8s linear infinite; }
.tile.idle-spin svg { animation: spin 6s linear infinite; }
.tile:hover { transform: translateY(-1px); }
@keyframes pop { from { transform: scale(.55); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes ring { 0%, 60%, 100% { transform: rotate(0); } 10% { transform: rotate(14deg); } 20% { transform: rotate(-12deg); } 30% { transform: rotate(8deg); } 40% { transform: rotate(-5deg); } }
@keyframes scan { from { top: 22%; } to { top: 74%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Buttons */
.btn { --b: var(--coral); border: 0; border-radius: 16px; min-height: 46px; padding: 0 20px; background: linear-gradient(90deg, var(--b), color-mix(in srgb, var(--b) 88%, #000)); color: #fff; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 10px 22px -8px var(--b); transition: transform .15s; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }
.btn.navy { --b: var(--navy); }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.green { --b: var(--in); }
.btn.red { --b: var(--out); }
.btn.violet { --b: var(--violet); }
.btn.sm { min-height: 36px; padding: 0 14px; border-radius: 12px; font-size: 13px; }
.btn .arrow::after { content: "→"; }
[dir="rtl"] .btn .arrow::after { content: "←"; }
.linkbtn { border: 0; background: none; color: var(--coral); cursor: pointer; font-weight: 600; padding: 4px 6px; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.input, select.input, textarea.input { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 11px 14px; min-height: 46px; outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--coral); box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 18%, transparent); }
.field.err .input { border-color: var(--err); }
.field .msg { font-size: 12.5px; color: var(--err); }
.field .hint { font-size: 12.5px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; padding: 6px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--coral); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); border-radius: 12px; padding: 7px 12px; cursor: pointer; background: var(--surface); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Tables */
.table-wrap { overflow-x: auto; border-radius: var(--r); }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; min-width: 640px; }
table.t th { text-align: start; font-size: 12.5px; color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: var(--surface-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: color-mix(in srgb, var(--pc, var(--muted)) 14%, transparent); color: var(--pc, var(--muted)); white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.avatar { width: 40px; height: 40px; border-radius: 32%; background: linear-gradient(135deg, var(--orange), var(--coral)); color: #fff; display: inline-grid; place-items: center; font-weight: 700; overflow: hidden; flex: 0 0 auto; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Banners and toasts */
.banner { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: color-mix(in srgb, var(--bc, var(--blue)) 12%, transparent); margin-bottom: 12px; }
.banner.err { --bc: var(--err); } .banner.ok { --bc: var(--ok); } .banner.warn { --bc: var(--warn); } .banner.pending { --bc: var(--pending); }
#toasts { position: fixed; inset-inline: 0; bottom: 24px; display: grid; justify-items: center; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 14px; box-shadow: var(--shadow); animation: pop .35s both; pointer-events: auto; max-width: min(560px, 92vw); }
.toast.err { background: var(--err); }

/* Drawer / dialog */
.scrim { position: fixed; inset: 0; background: rgba(12, 13, 31, .45); z-index: 900; display: flex; justify-content: flex-end; animation: fade .2s; }
.drawer { width: min(560px, 100vw); height: 100%; background: var(--bg); overflow-y: auto; box-shadow: var(--shadow); animation: slide .3s cubic-bezier(.2,.8,.2,1); }
[dir="rtl"] .scrim { justify-content: flex-start; }
.drawer .hero { padding: 18px 22px 54px; }
.drawer .sheet { padding: 22px; min-height: auto; }
.dialog { margin: auto; background: var(--surface); border-radius: var(--r-lg); padding: 22px; width: min(460px, 92vw); box-shadow: var(--shadow); }
@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
[dir="rtl"] .drawer { animation-name: slide-rtl; }
@keyframes slide-rtl { from { transform: translateX(-40px); opacity: 0; } }

/* App shell (console / owner) */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.side { background: linear-gradient(180deg, var(--navy), var(--navy-deep)); color: var(--on-navy); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; }
.brand b { font-size: 17px; }
.nav a { display: flex; align-items: center; gap: 12px; color: var(--on-navy-muted); padding: 9px 10px; border-radius: 14px; margin-bottom: 4px; text-decoration: none; font-weight: 600; }
.nav a[aria-current="page"] { background: var(--navy-chip); color: #fff; }
.nav a:hover { color: #fff; }
.main { min-width: 0; }
.topbar { background: linear-gradient(180deg, var(--navy), var(--navy-deep)); color: #fff; padding: 22px 28px 66px; }
.topbar h1 { font-size: 24px; }
.content { margin-top: -44px; background: var(--bg); border-start-start-radius: 44px; padding: 28px; position: relative; min-height: calc(100vh - 100px); }
.content::before { content: ""; position: absolute; inset-inline-end: 0; top: -44px; width: 44px; height: 44px; background: radial-gradient(circle at 0 0, transparent 43px, var(--bg) 44px); }
[dir="rtl"] .content::before { background: radial-gradient(circle at 100% 0, transparent 43px, var(--bg) 44px); }
.menu-btn { display: none; }
@media (max-width: 920px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset-block: 0; inset-inline-start: 0; width: 270px; z-index: 950; transform: translateX(-110%); transition: transform .25s; }
  [dir="rtl"] .side { transform: translateX(110%); }
  .side.open { transform: none !important; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 16px 16px 60px; }
  .content { padding: 20px 16px; }
}

/* Public pages */
.site-nav { display: flex; align-items: center; gap: 18px; max-width: 1120px; margin: 0 auto; }
.site-nav a { color: var(--on-navy-muted); font-weight: 600; }
.wrap { max-width: 1120px; margin: 0 auto; }
.lead { font-size: 19px; color: var(--on-navy-muted); max-width: 640px; }
.hero h1 { font-size: clamp(30px, 5vw, 50px); }
.prose { max-width: 820px; }
.prose h2 { margin-top: 1.6em; font-size: 21px; }
.prose li { margin-bottom: 6px; }
.phone { width: 280px; border-radius: 40px; background: var(--navy-deep); padding: 12px; box-shadow: 0 30px 60px rgba(0,0,0,.35); }
.phone-inner { border-radius: 30px; overflow: hidden; background: var(--bg); }
.fp { width: 150px; height: 150px; border-radius: 50%; margin: 18px auto; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #5be2b0, var(--in) 55%, #0b6e4b); box-shadow: 0 0 0 10px color-mix(in srgb, var(--in) 18%, transparent), 0 20px 30px -10px var(--in); animation: pulse 2.4s ease-in-out infinite; }
.fp svg { width: 70px; height: 70px; stroke: #fff; fill: none; stroke-width: 2.2; stroke-linecap: round; }
@keyframes pulse { 50% { box-shadow: 0 0 0 18px color-mix(in srgb, var(--in) 10%, transparent), 0 20px 30px -10px var(--in); } }
footer.site { background: var(--navy-deep); color: var(--on-navy-muted); padding: 28px; }
footer.site a { color: #fff; }
.map { height: 340px; border-radius: var(--r); overflow: hidden; }
.roster td, .roster th { min-width: 96px; font-size: 12.5px; }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); border-radius: 6px; }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chart .col i { width: 100%; max-width: 42px; border-radius: 10px 10px 4px 4px; background: linear-gradient(180deg, var(--violet), color-mix(in srgb, var(--violet) 70%, #000)); }

/* Bilingual static content: elements tagged data-l show only for the current language. */
html[lang="ar"] [data-l="en"], html:not([lang="ar"]) [data-l="ar"] { display: none !important; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature h3 { font-size: 16px; margin: 2px 0 4px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
.steps { counter-reset: s; display: grid; gap: 12px; }
.steps > div { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; }
.steps > div::before { content: counter(s); flex: 0 0 32px; height: 32px; border-radius: 11px; background: var(--navy); color: #fff; display: grid; place-items: center; font-weight: 700; }
.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.empty { text-align: center; padding: 34px 12px; color: var(--muted); }
.empty .tile { margin-bottom: 10px; }
/* Settings sections: two rows of boxes instead of one long scrolling line. */
.tabs-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs-grid button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 8px; min-height: 48px; font: inherit; font-weight: 700; font-size: 13.5px; line-height: 1.35; color: var(--muted); cursor: pointer; text-align: center; transition: background .15s, color .15s, border-color .15s; }
.tabs-grid button:hover { border-color: var(--navy); color: var(--text); }
.tabs-grid button[aria-selected="true"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 6px 16px rgba(20, 30, 70, .18); }
@media (max-width: 1100px) { .tabs-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .tabs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tabs-line { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs-line button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs-line button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--coral); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.toolbar .field { margin: 0; min-width: 150px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; font-size: 16px; }
.kiosk { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.kiosk .clock { font-size: clamp(56px, 12vw, 132px); font-weight: 700; letter-spacing: 2px; line-height: 1; font-variant-numeric: tabular-nums; }
.code { font-family: ui-monospace, Consolas, monospace; direction: ltr; unicode-bidi: embed; }
.secret-box { font-family: ui-monospace, Consolas, monospace; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; overflow-wrap: anywhere; direction: ltr; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.mini-list li:last-child { border-bottom: 0; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
@media print { .side, .topbar, .toolbar, .btn { display: none !important; } .content { margin: 0; padding: 0; } }
#view:focus, #view:focus-visible { outline: none; }
/* Page transitions in the console: the old page dims while the next loads, the new one rises in. */
#view { transition: opacity .18s ease; }
#view.view-leave { opacity: .45; pointer-events: none; }
#view.view-enter { animation: view-in .26s cubic-bezier(.2, .7, .2, 1); }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.nav a { transition: background-color .15s ease, color .15s ease; }
@media (prefers-reduced-motion: reduce) { #view, #view.view-enter { transition: none; animation: none; } }

/* Site pins on the console map (colour = site type). */
.site-pin span { display: block; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--pc); border: 3px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); }
.avatar-lg .avatar { width: 64px; height: 64px; font-size: 22px; }
.time-range { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Dashboard: chart colours (status order present · late · leave · absent, checked for colour-blind separation) */
:root { --c-present: #16a874; --c-late: #e09a12; --c-leave: #2f6bff; --c-absent: #f0505a; --c-none: var(--line); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --c-present: #1fae7a; --c-late: #c4850f; --c-leave: #5b8cff; --c-absent: #f0505a; } }
:root[data-theme="dark"] { --c-present: #1fae7a; --c-late: #c4850f; --c-leave: #5b8cff; --c-absent: #f0505a; }
.welcome { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 22px 26px; border-radius: var(--r-lg); color: #fff; box-shadow: var(--shadow);
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--violet) 55%, transparent), transparent 60%), linear-gradient(135deg, var(--navy), var(--navy-deep)); }
.welcome h2 { margin: 0 0 4px; font-size: 24px; }
.welcome p { margin: 0; color: var(--on-navy-muted); }
.btn.ghost.light { background: rgba(255, 255, 255, .12); color: #fff; }
.ring { --p: 0; width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; text-align: center; flex: none;
  background: radial-gradient(closest-side, var(--navy-deep) 79%, transparent 80% 100%), conic-gradient(var(--c-present) calc(var(--p) * 1%), rgba(255, 255, 255, .14) 0); }
.ring b { font-size: 24px; line-height: 1; }
.ring span { font-size: 11px; color: var(--on-navy-muted); }
.setup-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.setup-step { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--text); text-decoration: none !important; border: 1.5px solid transparent; }
.setup-step:hover { border-color: var(--line); }
.setup-step .grow { display: flex; flex-direction: column; }
.setup-step.done b { text-decoration: line-through; color: var(--muted); }
.dash-2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.dash-2.wide { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .dash-2, .dash-2.wide { grid-template-columns: minmax(0, 1fr); } }
.dash-map { height: 360px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { color: var(--text); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.wk-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 6px; border-bottom: 1px solid var(--line); }
.wk-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; cursor: default; border-radius: 10px; outline-offset: 2px; }
.wk-col:hover, .wk-col:focus-visible { background: var(--surface-2); }
.wk-bar { width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; gap: 2px; }
.wk-bar i { display: block; min-height: 2px; }
.wk-bar i:last-child { border-radius: 4px 4px 0 0; }
.wk-total { font-size: 12px; font-weight: 600; color: var(--muted); }
.wk-day { font-size: 12px; color: var(--muted); padding-bottom: 6px; }
.wk-day.today { color: var(--text); font-weight: 700; }
.hero-num { display: flex; flex-direction: column; margin-bottom: 12px; }
.hero-num b { font-size: 40px; line-height: 1.1; }
.split-bar { display: flex; gap: 2px; height: 16px; margin-bottom: 4px; }
.split-bar i { display: block; height: 100%; }
.split-bar i:first-child { border-start-start-radius: 6px; border-end-start-radius: 6px; }
.split-bar i:last-child { border-start-end-radius: 6px; border-end-end-radius: 6px; }
.chart-tip { position: absolute; z-index: 3000; display: none; min-width: 150px; padding: 8px 10px; border-radius: 10px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); border: 1px solid var(--line); font-size: 13px; pointer-events: none; }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mini-stats > * { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; display: flex; flex-direction: column; text-decoration: none !important; }
.mini-stats b { font-size: 24px; line-height: 1.1; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.emp-pin span { display: grid; place-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--pc); color: #fff; font-weight: 700; font-size: 13px; border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .35); }

/* Sidebar: page search and collapsible groups */
.nav-search { position: relative; margin: 0 4px 6px; }
.nav-search svg { position: absolute; inset-inline-start: 11px; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--on-navy-muted); stroke-width: 2; stroke-linecap: round; }
.nav-search input { width: 100%; border: 1px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .07); color: #fff; border-radius: 12px; padding: 8px 36px; min-height: 40px; }
.nav-search input::placeholder { color: var(--on-navy-muted); }
.nav-search input:focus { outline: 2px solid color-mix(in srgb, var(--coral) 60%, transparent); background: rgba(255, 255, 255, .1); }
.nav-search input::-webkit-search-cancel-button { filter: invert(1); }
.nav-search kbd { position: absolute; inset-inline-end: 10px; top: 50%; transform: translateY(-50%); font: 600 11px/1 Plex, sans-serif; color: var(--on-navy-muted); border: 1px solid rgba(255, 255, 255, .18); border-radius: 6px; padding: 3px 6px; }
.nav-search input:focus ~ kbd, .nav-search input:not(:placeholder-shown) ~ kbd { display: none; }
.nav-head { display: flex; align-items: center; width: 100%; border: 0; background: none; color: var(--on-navy-muted); font-size: 13px; margin: 12px 0 4px; padding: 4px 10px; border-radius: 10px; cursor: pointer; }
.nav-head:hover { color: #fff; }
.nav-head span { flex: 1; text-align: start; }
.nav-head svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.nav-group.closed .nav-head svg { transform: rotate(-90deg); }
[dir="rtl"] .nav-group.closed .nav-head svg { transform: rotate(90deg); }
.nav-items { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .22s ease; }
.nav-items > div { min-height: 0; overflow: hidden; }
.nav-group.closed:not(.searching) .nav-items { grid-template-rows: 0fr; }
.nav-group.closed:not(.searching) .nav-items a { visibility: hidden; transition: visibility 0s .22s; }
.nav-none { color: var(--on-navy-muted); padding: 6px 10px; }
.pick-list { max-height: 240px; overflow-y: auto; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 4px 12px; background: var(--surface); }
.chip[disabled] { opacity: .45; cursor: not-allowed; }
/* WhatsApp linking */
.wl-pair { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.wl-qr { width: 280px; min-height: 120px; display: grid; place-items: center; text-align: center; gap: 6px; }
.wl-qr img { background: #fff; padding: 10px; border-radius: 16px; box-shadow: var(--shadow-sm); }
.wl-steps { margin: 0; padding-inline-start: 20px; line-height: 2; }
.wl-code { font: 700 34px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: 4px; background: var(--surface-2); padding: 14px 18px; border-radius: 14px; }
@media (max-width: 600px) { .g3 { grid-template-columns: minmax(0, 1fr); } }

/* Settings: sections in use */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.check.mod { align-items: flex-start; padding: 10px 12px; border-radius: 14px; background: var(--chip, rgba(0, 0, 0, .03)); }
.check.mod input { margin-top: 4px; flex: none; }
.check.mod.disabled { opacity: .55; cursor: not-allowed; }

/* ---------------- The assistant («؟»): floating button, panel, «what is this?» and page tour ---------------- */
.as-fab { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 60; width: 54px; height: 54px; touch-action: none; }
.as-fab-b { width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--surface); background: linear-gradient(135deg, var(--violet), var(--blue)); color: #fff; font-size: 26px; font-weight: 700; cursor: grab; box-shadow: 0 10px 24px color-mix(in srgb, var(--blue) 40%, transparent); line-height: 1; }
.as-fab-b:active { cursor: grabbing; transform: scale(.94); }
.as-fab-x { position: absolute; top: -6px; inset-inline-start: -6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 11px; cursor: pointer; padding: 0; opacity: 0; transition: opacity .15s; }
.as-fab:hover .as-fab-x, .as-fab-x:focus-visible { opacity: 1; }
@media (hover: none) { .as-fab-x { opacity: 1; } }
.as-ov { position: fixed; inset: 0; z-index: 70; background: rgba(10, 12, 30, .35); display: flex; align-items: flex-end; justify-content: flex-end; padding: 16px; }
.as-pan { width: min(430px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; background: var(--bg); border-radius: var(--r-lg); box-shadow: var(--shadow); overflow: hidden; animation: as-up .22s cubic-bezier(.2,.8,.2,1); }
@keyframes as-up { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.as-hd { display: flex; align-items: center; gap: 10px; padding: 14px 14px 6px 16px; }
.as-mark { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 20px; background: linear-gradient(135deg, var(--violet), var(--blue)); flex: none; }
.as-x { border: 0; background: transparent; color: var(--muted); font-size: 18px; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; }
.as-x:hover { background: var(--surface-2); }
.as-ask { display: flex; gap: 8px; padding: 6px 14px; }
.as-ask .input { flex: 1; min-width: 0; }
.as-tools { display: flex; gap: 6px; padding: 4px 14px 8px; overflow-x: auto; scrollbar-width: none; }
.as-tools button, .as-q { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; white-space: nowrap; cursor: pointer; font-size: 13px; }
.as-tools button:hover, .as-q:hover { border-color: var(--blue); color: var(--blue); }
.as-out { flex: 1; overflow-y: auto; padding: 4px 14px 10px; }
.as-foot { text-align: center; margin: 0; padding: 6px 14px 12px; }
.as-card { background: var(--surface); border-radius: var(--r); padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); }
.as-card p { margin: 8px 0 0; }
.as-ct { font-weight: 700; font-size: 15.5px; }
.as-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.as-chip { font-size: 12px; color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); border-radius: 999px; padding: 2px 10px; }
.as-path { margin-top: 10px; font-size: 13px; color: var(--blue); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.as-path b { color: var(--muted); font-weight: 600; }
.as-path i { font-style: normal; color: var(--muted); }
.as-steps { margin: 10px 0 0; padding-inline-start: 22px; }
.as-steps li { margin: 4px 0; }
.as-tip { margin-top: 10px; background: color-mix(in srgb, var(--orange) 12%, transparent); border-radius: var(--r-sm); padding: 8px 10px; font-size: 13.5px; }
.as-go { margin-top: 12px; width: 100%; }
.as-sub { font-size: 13px; color: var(--muted); font-weight: 600; margin: 10px 4px 6px; }
.as-list { display: flex; flex-direction: column; }
.as-card.as-list { padding: 6px; }
.as-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; text-align: start; padding: 8px; border-radius: var(--r-sm); cursor: pointer; }
.as-row:hover { background: var(--surface-2); }
.as-row .as-rt { flex: 1; }
.as-row .tile { flex: none; }
.as-row i, .as-row small { font-style: normal; color: var(--muted); }
.as-kv { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.as-kv:last-of-type { border-bottom: 0; }
.as-kv span { color: var(--muted); }
.as-kv b { text-align: end; }
.as-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.as-hl { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.as-hl:last-child { border-bottom: 0; }
.as-hl.bad span { color: var(--warn); font-weight: 600; }
body.as-wi, body.as-wi * { cursor: help !important; }
.as-wibar { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 999px; box-shadow: var(--shadow); padding: 6px 8px 6px 16px; max-width: calc(100vw - 24px); }
[dir="rtl"] .as-wibar { padding: 6px 16px 6px 8px; }
.as-wibar, .as-wibar * , .as-bub, .as-bub * { cursor: auto !important; }
.as-bub { position: fixed; z-index: 82; display: none; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; }
.as-bub p { margin: 0 0 8px; }
.as-hlbox { position: fixed; z-index: 79; display: none; border: 3px solid var(--blue); border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 20%, transparent); transition: all .18s ease; }
.as-hlbox.as-spot { box-shadow: 0 0 0 9999px rgba(10, 12, 30, .55); }
.as-veil { position: fixed; inset: 0; z-index: 78; }
@media (max-width: 640px) { .as-ov { padding: 0; } .as-pan { width: 100%; border-radius: var(--r-lg) var(--r-lg) 0 0; max-height: 90vh; } .as-fab { bottom: 16px; inset-inline-end: 16px; } }
@media (prefers-reduced-motion: reduce) { .as-pan { animation: none; } .as-hlbox { transition: none; } }

/* Live inspection: photo thumbnails and where each photo was taken */
.ins-thumb{display:block;width:56px;height:56px;padding:0;border:1px solid var(--line,#e4e7ec);border-radius:12px;overflow:hidden;background:var(--soft,#f2f4f7);cursor:zoom-in}
.ins-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.ins-thumb img:not([src]){visibility:hidden}
.ins-thumb.broken{cursor:default;opacity:.5}
.ins-zone{font-weight:700;line-height:1.6}
.ins-zone.ok{color:var(--ok,#0e8a52)}
.ins-zone.bad{color:var(--err,#d63a44)}
.ins-zone.unk{color:var(--muted,#667085);font-weight:600}
.ins-zone .small{font-weight:600}
/* Action log (leaves and requests) */
.tl{list-style:none;margin:0;padding:0;position:relative}
.tl li{position:relative;padding-inline-start:30px;padding-bottom:18px}
.tl li::before{content:"";position:absolute;inset-inline-start:7px;top:6px;bottom:-6px;width:2px;background:var(--line)}
.tl li:last-child::before{display:none}
.tl li .dot{position:absolute;inset-inline-start:0;top:2px;width:16px;height:16px;border-radius:50%;background:var(--tc,var(--muted));box-shadow:0 0 0 4px var(--surface)}
.tl .tl-h{font-weight:700}
.tl .tl-m{color:var(--muted);font-size:.85em;margin-top:2px}
.tl .tl-n{margin-top:6px;background:var(--surface-2);border-radius:var(--r-sm);padding:8px 12px;font-size:.92em}
.tl .tl-d{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.tl .tl-d span{background:var(--surface-2);border-radius:999px;padding:2px 10px;font-size:.82em}
.lv-sum{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:10px;margin-bottom:14px}
.lv-sum div{background:var(--surface-2);border-radius:var(--r-sm);padding:10px 12px}
.lv-sum b{display:block;font-size:1.15em}
.lv-sum span{color:var(--muted);font-size:.82em}
.lv-old{text-decoration:line-through;color:var(--muted)}
.nowrap{white-space:nowrap}
.ins-thumb.broken img{visibility:hidden}
.ins-thumb.broken{position:relative}
.ins-thumb.broken::after{content:"📷";position:absolute;inset:0;display:grid;place-items:center;font-size:20px}
/* Site navigation on phones: wraps instead of overflowing; in-page links are reachable by scrolling. */
@media (max-width: 640px) {
  .site-nav { flex-wrap: wrap; gap: 10px 14px; }
  .site-nav a[href^="#"] { display: none; }
}
