/* Fire-service dashboard theme — RTL Arabic, mobile-first, built for gloved hands.
   Deep navy chrome, crimson primary actions, white elevated cards, unmistakable status colours.
   Visual layer only: every class name below is the one the views already use. */

:root {
  color-scheme: light dark;

  /* chrome */
  --nav: #0b1730;
  --nav-2: #17294f;
  --nav-ink: #ffffff;

  /* surfaces */
  --bg: #f1f4f9;
  --surface: #ffffff;
  --card: #ffffff;
  --panel: #f5f7fb;
  --text: #0f172a;
  --muted: #5a6679;
  --line: #e1e7f0;
  --line-strong: #c9d3e3;
  --focus: #2563eb;
  --accent: #1d4ed8;

  /* brand: fire red */
  --brand: #c4122f;
  --brand-2: #e02a45;
  --brand-dark: #9a0d25;
  --brand-text: #c4122f;
  --brand-ink: #ffffff;
  --brand-soft: #fdecef;

  /* semantic status colours (solid fill + tint + readable ink) */
  --ok: #047857;    --ok-line: #10b981;    --ok-bg: #d8f5e8;    --ok-ink: #064e3b;
  --bad: #dc2626;   --bad-line: #f87171;   --bad-bg: #fee2e2;   --bad-ink: #7f1d1d;
  --warn: #c2570c;  --warn-line: #f59e0b;  --warn-bg: #fdefc8;  --warn-ink: #78350f;
  --info: #0e7490;  --info-line: #22b8d6;  --info-bg: #d4f1f8;  --info-ink: #134e5e;
  --na: #475569;    --na-line: #94a3b8;    --na-bg: #e8ecf3;    --na-ink: #1e293b;
  --on-fill: #ffffff;
  --sel: var(--nav);
  --sel-ink: #ffffff;

  --radius: 18px;
  --radius-sm: 13px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 10px 26px -10px rgba(15, 23, 42, .16);
  --shadow-lg: 0 24px 60px -12px rgba(8, 16, 36, .38);
  --appbar-h: 60px;
  --progress-h: 76px;
  --font: "Cairo", system-ui, -apple-system, "Segoe UI", Tahoma, "Noto Sans Arabic", "Geeza Pro", "Droid Arabic Kufi", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --nav: #060d1d;
    --nav-2: #10203f;
    --bg: #080d19;
    --surface: #101929;
    --card: #131d31;
    --panel: #0d1627;
    --text: #e7edf8;
    --muted: #9aa8bf;
    --line: #223049;
    --line-strong: #31436a;
    --focus: #7aa7ff;
    --accent: #7aa7ff;
    --brand: #cf2a43;
    --brand-2: #d9384e;
    --brand-dark: #b01f35;
    --brand-text: #ff7186;
    --sel: #2c4d9c;
    --brand-soft: #3a1119;
    --ok: #34d399;   --ok-line: #34d399;   --ok-bg: #0e2e22;   --ok-ink: #bbf7d0;
    --bad: #f87171;  --bad-line: #f87171;  --bad-bg: #371317;  --bad-ink: #fecaca;
    --warn: #fbbf24; --warn-line: #fbbf24; --warn-bg: #36270a;  --warn-ink: #fde68a;
    --info: #38bdf8; --info-line: #38bdf8; --info-bg: #0c2b3a;  --info-ink: #bae6fd;
    --na: #94a3b8;   --na-line: #94a3b8;   --na-bg: #1f2b40;    --na-ink: #e2e8f0;
    --on-fill: #07111f;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 12px 28px -10px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--appbar-h) + var(--progress-h)); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.35; font-weight: 800; letter-spacing: -.005em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.12rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .6em; }
a { color: var(--accent); }
bdi { unicode-bidi: isolate; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--brand) 25%, transparent); }

.muted { color: var(--muted); }
.small { font-size: .86rem; }
.err-text, .bad-text { color: var(--bad); }
.danger-text { color: var(--bad); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.stack-sm { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }

/* ---------------------------------------------------------------- layout */
.view { max-width: 760px; margin: 0 auto; padding: 0 14px calc(112px + env(safe-area-inset-bottom)); }
.view.narrow { padding-top: 10vh; }
.content { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-top: 14px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}
.section-title {
  margin: 22px 2px 10px; padding-inline-start: 10px;
  border-inline-start: 4px solid var(--brand); border-radius: 2px;
  color: var(--text); font-size: 1rem; font-weight: 800; line-height: 1.2;
}

/* app bar: deep navy with a fire-red edge */
.appbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--appbar-h);
  margin: 0 -14px;
  padding: 0 10px;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--nav), var(--nav-2));
  color: var(--nav-ink);
  border-bottom: 3px solid var(--brand);
  box-shadow: 0 8px 22px -6px rgba(8, 16, 36, .45);
}
.appbar-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.appbar-title strong { font-size: 1.08rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-title small { opacity: .72; font-size: .76rem; font-weight: 600; }
.appbar-actions { display: flex; gap: 4px; }
.appbar .logo {
  width: 40px; height: 40px; display: grid; place-items: center; margin-inline: 2px;
  border-radius: 13px; background: rgba(255, 255, 255, .1); font-size: 1.4rem;
}
.icon-btn {
  width: 46px; height: 46px; display: inline-grid; place-items: center;
  border: 0; border-radius: 14px; background: transparent; color: inherit;
  font-size: 1.4rem; cursor: pointer; transition: background-color .15s, transform .12s;
}
.icon-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.icon-btn:active { background: color-mix(in srgb, currentColor 20%, transparent); transform: scale(.94); }
.icon-btn.on-dark { color: #fff; }
.icon-btn.active { background: rgba(255, 255, 255, .28); }
.view > :not(.appbar):not(.content):not(.hero) { margin-top: 14px; }

/* ---------------------------------------------------------------- buttons / inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 10px 20px;
  border: 2px solid transparent; border-radius: 15px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--surface); color: var(--text);
  transition: transform .12s ease, box-shadow .2s ease, filter .2s ease, background-color .2s ease, border-color .2s ease;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--brand-2), var(--brand));
  color: var(--brand-ink);
  box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--brand) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
@media (hover: hover) { .btn-ghost:hover:not(:disabled) { background: var(--panel); border-color: color-mix(in srgb, var(--brand) 40%, var(--line-strong)); } }
.btn-danger { background: var(--bad); color: var(--on-fill); box-shadow: 0 10px 20px -12px var(--bad); }
.btn-danger:hover:not(:disabled) { filter: brightness(1.07); }
.btn-small { min-height: 42px; padding: 6px 14px; font-size: .92rem; border-radius: 12px; }
.btn-lg { min-height: 58px; font-size: 1.05rem; }
.btn-xl { min-height: 76px; font-size: 1.2rem; border-radius: 18px; }
.btn-block { width: 100%; }
.grow { flex: 1; }
.on-dark.btn-ghost { background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .3); }
@media (hover: hover) { .on-dark.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .14); } }

.input {
  width: 100%; min-height: 50px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 22%, transparent); }
textarea.input { min-height: 78px; resize: vertical; line-height: 1.5; }
select.input { appearance: auto; }
.input.invalid { border-color: var(--bad); background: var(--bad-bg); }
.field-label { display: block; margin: 6px 0 4px; font-weight: 800; font-size: .92rem; }
.row-form { display: flex; gap: 8px; align-items: center; }
.row-form .input { flex: 1; }
.card > .btn-block + .row-form { margin-top: 12px; }
.card > .row-form + p { margin: 10px 2px 0; }
.check { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); font-weight: 700; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }
.check.disabled { opacity: .55; }

/* chips + counters */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px; border-radius: 999px; font-size: .8rem; font-weight: 800; white-space: nowrap; line-height: 1.5;
  background: var(--na-bg); color: var(--na-ink);
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}
.chip-ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip-bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip-warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip-info { background: var(--info-bg); color: var(--info-ink); }
.chip-muted { background: var(--na-bg); color: var(--na-ink); }
.chip.as-btn { cursor: pointer; min-height: 34px; font: inherit; font-weight: 800; font-size: .85rem; }
.chip.as-btn:active { transform: scale(.95); }

.notice {
  --c: var(--na-line);
  padding: 13px 16px; border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  border-inline-start: 5px solid var(--c);
  background: var(--panel);
}
.notice ul { margin: 6px 0 0; padding-inline-start: 20px; }
.notice-ok { --c: var(--ok-line); background: var(--ok-bg); color: var(--ok-ink); }
.notice-bad { --c: var(--bad); background: var(--bad-bg); color: var(--bad-ink); }
.notice-warn { --c: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.notice-info { --c: var(--info-line); background: var(--info-bg); color: var(--info-ink); }
.prev-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; align-items: center; }

.counts { display: flex; flex-wrap: wrap; gap: 6px; }
.count {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px;
  background: var(--na-bg); color: var(--na-ink); font-size: .85rem; font-weight: 600;
}
.count b { font-weight: 800; }
.count-ok { background: var(--ok-bg); color: var(--ok-ink); }
.count-bad { background: var(--bad-bg); color: var(--bad-ink); }
.count-warn { background: var(--warn-bg); color: var(--warn-ink); }
.count-info { background: var(--info-bg); color: var(--info-ink); }
/* report KPI tiles */
.counts.big { display: grid; grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)); gap: 8px; }
.counts.big .count {
  flex-direction: column; justify-content: center; gap: 0; padding: 12px 6px 10px; border-radius: 16px;
  font-size: 1.3rem; text-align: center; line-height: 1.25;
  border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}
.counts.big .count b { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.count.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--bad) 55%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }

/* ---------------------------------------------------------------- home */
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  margin: 0 -14px; padding: calc(24px + env(safe-area-inset-top)) 20px 30px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(196, 18, 47, .38), transparent 55%),
    linear-gradient(135deg, var(--nav), var(--nav-2));
  color: #fff;
  border-bottom: 3px solid var(--brand);
  border-radius: 0 0 28px 28px;
  box-shadow: 0 16px 34px -14px rgba(8, 16, 36, .55);
}
.hero h1 { margin: 0 0 2px; color: #fff; font-size: 1.55rem; }
.hero p { margin: 0 0 6px; font-size: .78rem; direction: ltr; text-align: right; color: rgba(255, 255, 255, .72); }
.hero .chip { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .22); }
.hero-logo {
  flex: none; width: 60px; height: 60px; display: grid; place-items: center;
  border-radius: 19px; font-size: 1.9rem;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-dark));
  box-shadow: 0 10px 22px -8px rgba(196, 18, 47, .8), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* apparatus cards on the home screen */
.apparatus-card { --c: var(--line-strong); display: grid; gap: 12px; padding: 14px; border-inline-start: 6px solid var(--c); transition: transform .12s, box-shadow .2s; }
.apparatus-card:active { transform: scale(.994); }
.apparatus-card:has(.apbadge-in_service) { --c: var(--ok-line); }
.apparatus-card:has(.apbadge-out_of_service) { --c: var(--bad); }
.apparatus-card:has(.apbadge-maintenance) { --c: var(--warn-line); }
.apparatus-card a.apparatus { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; min-height: 72px; }
.apparatus-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.apparatus-badges:empty { display: none; }
.apparatus-badges .chip { text-decoration: none; min-height: 34px; }

a.apparatus { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; min-height: 76px; }
.apparatus-ico {
  flex: none; width: 58px; height: 58px; display: grid; place-items: center;
  border-radius: 18px; font-size: 1.8rem;
  background: linear-gradient(135deg, var(--nav), var(--nav-2));
  box-shadow: 0 8px 18px -8px rgba(8, 16, 36, .55), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.apparatus-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.apparatus-main strong { font-size: 1.22rem; font-weight: 800; line-height: 1.3; }
.apparatus-main small { line-height: 1.5; }
.apparatus-main small bdi { font-family: var(--mono); font-size: .76rem; font-weight: 700; padding: 1px 8px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); color: var(--text); }
.draft-line { color: var(--warn); font-weight: 800; }
.go {
  flex: none; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 1.5rem; line-height: 1;
  transition: background-color .15s, color .15s, transform .15s;
}
a.apparatus:active .go { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateX(-3px); }
@media (hover: hover) { a.apparatus:hover .go { background: var(--brand); border-color: var(--brand); color: #fff; transform: translateX(-3px); } }
.links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.outbox h2 { margin-bottom: 8px; }
.outbox-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.outbox-row small { grid-column: 1; }
.outbox-row button { grid-row: 1 / span 2; grid-column: 2; }
.login-card { display: grid; gap: 14px; text-align: center; padding: 28px 20px; box-shadow: var(--shadow-lg); }
.login-logo {
  justify-self: center; width: 76px; height: 76px; display: grid; place-items: center;
  border-radius: 24px; font-size: 2.4rem; color: #fff;
  background: linear-gradient(135deg, var(--brand-2), var(--brand-dark));
  box-shadow: 0 14px 28px -10px rgba(196, 18, 47, .8), inset 0 1px 0 rgba(255, 255, 255, .3);
}

/* ---------------------------------------------------------------- shift banner (active shift + day) */
.shift-banner {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px; padding: 18px;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.shift-banner::after {
  content: ''; position: absolute; inset-inline-end: -40px; top: -50px; width: 170px; height: 170px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .32), transparent 70%); pointer-events: none;
}
.shift-morning { background: linear-gradient(135deg, #ffe08a, #ff9a1f); color: #3b1d03; }
.shift-night { background: linear-gradient(135deg, #0f1a47, #3d44a6); color: #fff; }
.shift-icon { font-size: 2.8rem; line-height: 1; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .22)); }
.shift-main { flex: 1; min-width: 0; position: relative; z-index: 1; }
.shift-name { font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.shift-en { font-size: .82rem; opacity: .85; font-weight: 600; }
.shift-day {
  display: inline-flex; align-items: center; gap: 2px; margin-top: 8px; padding: 3px 14px; border-radius: 999px;
  font-size: 1.02rem; font-weight: 800;
  background: rgba(255, 255, 255, .5); border: 1px solid rgba(255, 255, 255, .6);
}
.shift-night .shift-day { background: rgba(255, 255, 255, .15); border-color: rgba(255, 255, 255, .24); }
.shift-week { margin-top: 4px; font-size: .84rem; opacity: .88; font-weight: 600; }
.shift-side { position: relative; z-index: 1; display: grid; gap: 8px; justify-items: end; }
.shift-banner { min-width: 0; }
.shift-day { max-width: 100%; flex-wrap: wrap; }
@media (max-width: 440px) {
  .shift-banner { flex-wrap: wrap; row-gap: 12px; }
  .shift-side { flex: 1 1 100%; display: flex; flex-direction: row; justify-content: space-between; align-items: center; }
  .shift-icon { font-size: 2.4rem; }
}
.shift-banner .chip { background: rgba(255, 255, 255, .55); color: inherit; border-color: rgba(255, 255, 255, .6); }
.shift-night .chip { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .26); }
.shift-banner .btn-small { background: rgba(255, 255, 255, .95); color: #111827; box-shadow: var(--shadow-sm); }
.shift-edit { display: grid; gap: 8px; }
.shift-day bdi, .shift-week bdi { white-space: nowrap; }
.seg { display: flex; gap: 6px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.seg-btn, .day {
  flex: 1; min-height: 46px; padding: 6px 8px; border: 0; border-radius: 12px;
  background: transparent; color: var(--text); font: inherit; font-weight: 800; cursor: pointer;
  transition: background-color .15s, color .15s, box-shadow .15s, transform .1s;
}
.seg-btn:active, .day:active { transform: scale(.96); }
.seg-btn.on, .day.on { background: var(--sel); color: var(--sel-ink); box-shadow: 0 6px 14px -6px rgba(8, 16, 36, .6); }
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.days .day { font-size: .92rem; padding-inline: 2px; background: var(--panel); border: 1px solid var(--line); }
.days .day.on { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }

/* ---------------------------------------------------------------- inspection page */
.setup > summary, .comp > summary {
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px; cursor: pointer;
}
.setup > summary { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; row-gap: 0; }
.setup > summary::after { grid-row: 1 / span 2; grid-column: 2; }
.setup > summary::after, .comp > summary::after {
  content: ''; flex: none; width: 9px; height: 9px; margin-inline-start: 4px;
  border-right: 2.5px solid currentColor; border-bottom: 2.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px); opacity: .55; transition: transform .2s ease;
}
.setup[open] > summary::after, .comp[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
summary::-webkit-details-marker { display: none; }
.setup > summary > strong { font-size: 1.05rem; }
.setup > .stack { gap: 6px; }
.setup > .stack > .field-label { margin-top: 10px; }
.setup > .stack > .field-label:first-child { margin-top: 0; }
.setup[open] > summary { margin-bottom: 12px; }

/* status of the apparatus (في الخدمة / خارج الخدمة / صيانة) */
.status-card { padding: 14px; }
.status-card > .field-label { margin-top: 0; }
.apbadge {
  --c: var(--ok);
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 14px; border: 0; border-radius: 999px;
  font: inherit; font-size: .85rem; font-weight: 800; white-space: nowrap; line-height: 1.5;
  background: var(--c); color: var(--on-fill); cursor: default;
  box-shadow: 0 6px 14px -8px var(--c), inset 0 -2px 0 rgba(0, 0, 0, .12);
}
button.apbadge { cursor: pointer; min-height: 38px; }
button.apbadge:active { transform: scale(.96); }
.apbadge-in_service { --c: var(--ok); }
.apbadge-out_of_service { --c: var(--bad); }
.apbadge-maintenance { --c: var(--warn); }
.status-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
.apst {
  --c: var(--ok);
  min-height: 58px; padding: 6px 4px; border: 2px solid var(--line-strong); border: 2px solid color-mix(in srgb, var(--c) 38%, var(--line)); border-radius: 15px;
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 800; font-size: .9rem; cursor: pointer; line-height: 1.3;
  transition: transform .12s, box-shadow .2s, background-color .2s, color .2s, border-color .2s;
}
.apst:active { transform: scale(.97); }
.apst-in_service { --c: var(--ok); }
.apst-out_of_service { --c: var(--bad); }
.apst-maintenance { --c: var(--warn); }
.apst.on {
  background: var(--c); border-color: var(--c); color: var(--on-fill);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 26%, transparent), 0 10px 20px -10px var(--c);
}
.apst-lg { width: 100%; min-height: 62px; font-size: 1.08rem; }

/* sticky progress */
.progress {
  position: sticky; top: calc(var(--appbar-h) - 1px); z-index: 20;
  margin: 0 -14px; padding: 10px 14px 10px;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.meter { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; box-shadow: inset 0 1px 2px rgba(15, 23, 42, .12); }
.meter-fill { height: 100%; width: 0; border-radius: 99px; background: linear-gradient(90deg, var(--ok-line), var(--ok)); transition: width .3s ease; }
.progress.has-missing .meter-fill { background: linear-gradient(90deg, var(--ok), var(--bad)); }
.prog-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.prog-text { font-weight: 800; font-size: .98rem; }

/* compartments: collapsible cards with a sticky header and their own progress */
.comp {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; overflow: clip; /* clip keeps the header sticky while still rounding the corners */
}
.comp > summary {
  position: sticky; top: calc(var(--appbar-h) + var(--progress-h)); z-index: 10;
  padding: 8px 16px; min-height: 62px;
  background: var(--panel);
  background: color-mix(in srgb, var(--nav) 6%, var(--card));
  border-bottom: 1px solid var(--line);
}
.comp:not([open]) > summary { border-bottom-color: transparent; }
.comp-names { display: grid; gap: 0; min-width: 0; }
.comp-names strong { font-size: 1.04rem; font-weight: 800; line-height: 1.35; }
.comp-names small { direction: ltr; text-align: right; font-weight: 600; }
.comp-badge {
  direction: ltr; unicode-bidi: isolate; margin-inline-start: auto; padding: 3px 12px; border-radius: 99px; background: var(--na-bg); color: var(--na-ink);
  font-weight: 800; font-size: .86rem; white-space: nowrap; border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}
.comp-badge.done { background: var(--ok-bg); color: var(--ok-ink); }
.comp-badge.done::before { content: '✓ '; }
.issue-dot { color: var(--bad); }
.comp-meter { position: absolute; inset-inline: 0; bottom: 0; height: 4px; background: var(--line); }
.comp-meter-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--ok-line), var(--ok)); transition: width .3s ease; }
.comp-body { display: grid; gap: 12px; padding: 12px; background: var(--panel); }

/* equipment item */
.item {
  --c: var(--line-strong);
  display: grid; gap: 10px; padding: 12px;
  border: 1px solid var(--line); border-inline-start: 6px solid var(--c);
  border-radius: 16px; background: var(--card); box-shadow: var(--shadow-sm);
  transition: background-color .2s, border-color .2s, box-shadow .2s;
}
.item.s-present { --c: var(--ok-line); }
.item.s-corrected { --c: var(--info-line); }
.item.s-missing { --c: var(--bad); background: var(--bad-bg); background: color-mix(in srgb, var(--bad-bg) 62%, var(--card)); }
.item.s-repair { --c: var(--warn-line); background: var(--warn-bg); background: color-mix(in srgb, var(--warn-bg) 62%, var(--card)); }
.item.s-na { --c: var(--na-line); opacity: .92; }
.item.in-sheet { box-shadow: none; }
.item.flash { animation: flash 1.2s ease 1; }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 transparent; } 30% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--focus) 55%, transparent); } }
.item-head { display: flex; align-items: flex-start; gap: 10px; }
.item-no {
  flex: none; min-width: 38px; height: 38px; padding: 0 8px; display: inline-grid; place-items: center;
  border-radius: 12px; background: var(--sel); color: var(--sel-ink); font-weight: 800; font-size: .92rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14);
}
.item-names { flex: 1; min-width: 0; }
.item-en { direction: ltr; text-align: right; unicode-bidi: isolate; font-weight: 800; line-height: 1.4; word-break: break-word; }
.item-ar { color: var(--muted); font-size: .9rem; font-weight: 600; line-height: 1.45; }
.qty-tag { flex: none; padding: 2px 11px; border-radius: 99px; background: var(--info-bg); color: var(--info-ink); font-weight: 800; white-space: nowrap; direction: ltr; border: 1px solid color-mix(in srgb, currentColor 14%, transparent); }
.prev-issue { padding: 7px 12px; border-radius: 11px; background: var(--warn-bg); color: var(--warn-ink); font-size: .88rem; font-weight: 800; border: 1px solid color-mix(in srgb, var(--warn-line) 40%, transparent); }

/* status buttons: big touch tiles, the chosen one glows in its own colour */
.statuses { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.statuses.one { grid-template-columns: 1fr; }
.st {
  --c: var(--na);
  position: relative; min-height: 66px; padding: 8px 2px 6px; display: grid; place-items: center; align-content: center; gap: 2px;
  border: 2px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--text);
  font: inherit; cursor: pointer; line-height: 1.2;
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--c) 45%, transparent);
  transition: transform .14s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}
.st-present { --c: var(--ok); }
.st-missing { --c: var(--bad); }
.st-repair { --c: var(--warn); }
.st-na { --c: var(--na); }
.st-corrected { --c: var(--info); }
.statuses.one .st { grid-auto-flow: column; min-height: 52px; gap: 8px; }
.st-ico { font-size: 1.45rem; line-height: 1.1; }
.st-txt { font-size: .8rem; font-weight: 800; text-align: center; }
.st:active { transform: scale(.96); }
.st.on {
  background: var(--c); border-color: var(--c); color: var(--on-fill); transform: translateY(-1px);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 28%, transparent), 0 12px 22px -10px var(--c);
}

/* quantity stepper */
.qty-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 800; padding: 8px 10px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.step {
  width: 50px; height: 50px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--brand-text);
  font-size: 1.6rem; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .1s, background-color .15s, color .15s, border-color .15s;
}
@media (hover: hover) { .step:hover:not(:disabled) { background: var(--brand); border-color: var(--brand); color: #fff; } }
.step:active:not(:disabled) { transform: scale(.9); }
.step:disabled { opacity: .35; cursor: not-allowed; }
.qty-val { min-width: 84px; padding: 6px 12px; text-align: center; font-size: 1.2rem; font-weight: 800; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.alert-banner {
  padding: 9px 14px; border-radius: 12px; background: var(--bad); color: var(--on-fill); font-weight: 800;
  animation: pulse 1.8s ease-in-out infinite;
}

/* note + photo drawer */
.note, .photos { display: grid; gap: 6px; padding: 10px 12px 12px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.note label, .photos > label { display: block; margin: 0; font-size: .86rem; font-weight: 800; color: var(--muted); }
.note textarea { background: var(--surface); }
.flag-banner { padding: 7px 12px; border-radius: 11px; background: var(--bad-bg); color: var(--bad-ink); font-weight: 800; font-size: .88rem; border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.item.flagged { outline: 3px solid var(--bad); outline-offset: 1px; }

.actionbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 40;
  display: flex; gap: 10px; align-items: stretch;
  max-width: 760px; margin-inline: auto; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line); box-shadow: 0 -14px 34px -14px rgba(8, 16, 36, .28);
  border-radius: 24px 24px 0 0;
}

.actionbar .btn { line-height: 1.3; }
.actionbar .btn-ghost { flex: none; min-width: 92px; padding-inline: 14px; }
.actionbar .btn-primary { padding-inline: 12px; font-size: 1rem; flex-wrap: wrap; align-content: center; column-gap: .4em; row-gap: 0; text-align: center; }
.actionbar .btn-primary > span { white-space: nowrap; }

/* ---------------------------------------------------------------- dialogs / toasts */
dialog.dlg {
  width: calc(100% - 24px); max-width: 540px; max-height: calc(100dvh - 24px);
  padding: 0; border: 1px solid var(--line); border-radius: 24px; background: var(--card); color: var(--text);
  box-shadow: var(--shadow-lg); overflow: auto;
}
dialog.dlg::backdrop { background: rgba(5, 11, 28, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.sheet { width: 100%; max-width: 660px; margin: auto auto 0; border-radius: 28px 28px 0 0; max-height: 92dvh; border-bottom: 0; }
.dlg-body { padding: 20px; display: grid; gap: 14px; }
.dlg-title { margin: 0; font-size: 1.2rem; }
.dlg-text { margin: 0; white-space: pre-line; }
.dlg-actions { display: grid; gap: 8px; }
.sheet-grip { width: 48px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: -8px auto 0; }
.review ul { margin: 4px 0 0; padding-inline-start: 20px; }

#toasts { position: fixed; z-index: 100; inset-inline: 14px; top: calc(var(--appbar-h) + 10px); display: grid; gap: 8px; pointer-events: none; max-width: 540px; margin-inline: auto; }
.toast {
  --c: var(--nav);
  padding: 13px 18px; border-radius: 16px; font-weight: 700; box-shadow: var(--shadow-lg);
  background: var(--c); color: #fff; border-inline-start: 6px solid rgba(255, 255, 255, .45);
  animation: slide-in .22s ease-out;
}
.toast-ok { --c: var(--ok); color: var(--on-fill); }
.toast-err { --c: var(--bad); color: var(--on-fill); }
.toast-warn { --c: var(--warn); color: var(--on-fill); }
.toast.out { opacity: 0; transform: translateY(-8px); transition: .25s; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-12px) scale(.98); } }

.center-msg { display: grid; place-items: center; gap: 12px; padding: 64px 12px; text-align: center; }
.spin { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: spin .85s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- report + history */
.ready-banner {
  padding: 16px; border-radius: var(--radius); font-size: 1.22rem; font-weight: 800; text-align: center; color: var(--on-fill);
  box-shadow: var(--shadow);
}
.ready-banner.ok { background: var(--ok); background: linear-gradient(135deg, var(--ok), color-mix(in srgb, var(--ok) 70%, #10b981)); }
.ready-banner.bad { background: var(--bad); background: linear-gradient(135deg, var(--bad), color-mix(in srgb, var(--bad) 70%, #7f1d1d)); }
.fact { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 6px; border-bottom: 1px solid var(--line); }
.fact:nth-of-type(odd) { background: color-mix(in srgb, var(--panel) 70%, transparent); }
.fact-k { color: var(--muted); font-weight: 600; font-size: .92rem; }
.fact-v { font-weight: 800; text-align: end; }
.card > .counts { margin-top: 12px; }
.alert-row {
  --c: var(--bad); display: grid; gap: 3px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-inline-start: 6px solid var(--c); background: var(--bad-bg); color: var(--bad-ink);
}
.alert-row.alert-repair { --c: var(--warn-line); background: var(--warn-bg); color: var(--warn-ink); }
.alert-row .item-ar { color: inherit; opacity: .85; }
.alert-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.alert-note { margin: 6px 0 0; font-weight: 700; white-space: pre-line; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions .btn { flex: 1; }
.resend { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
a.history-row { display: grid; gap: 6px; color: inherit; text-decoration: none; transition: transform .12s, box-shadow .2s, border-color .2s; }
a.history-row:active { transform: scale(.992); }
@media (hover: hover) { a.history-row:hover { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); } }
a.history-row.has-alert { border-inline-start: 6px solid var(--bad); }
.history-row.is-rejected { border-inline-start: 6px solid var(--bad); background: color-mix(in srgb, var(--bad-bg) 40%, var(--card)); }
.history-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.history-top strong { font-size: 1.1rem; font-weight: 800; }
.history-bottom { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }

/* supervisor review */
.review-card { border-top: 4px solid var(--nav); }
.review-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.review-head strong { font-size: 1.05rem; }
/* approve = green, reject = red (the brand-red primary would read as "danger" next to the reject button) */
.review-card .row-actions .btn-primary {
  background: linear-gradient(180deg, #07805a, #046649);
  box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--ok) 85%, transparent), inset 0 1px 0 rgba(255, 255, 255, .22);
  color: #fff;
}
@media (prefers-color-scheme: dark) { .review-card .row-actions .btn-primary { color: var(--on-fill); background: linear-gradient(180deg, #34d399, #10b981); } }
.review-note { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); border-inline-start: 5px solid var(--nav); font-weight: 700; white-space: pre-line; }
.returned strong { font-size: 1.06rem; }
.returned p { margin: 6px 0; font-weight: 700; white-space: pre-line; }
a.returned-mini { display: grid; gap: 2px; color: inherit; text-decoration: none; }
.flag-pick details { margin: 6px 0; border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; background: var(--panel); }
.flag-pick summary { cursor: pointer; font-weight: 800; min-height: 38px; display: flex; align-items: center; }
.flag-pick .chip.as-btn { min-width: 42px; justify-content: center; }

/* photos of broken / missing equipment */
.photo-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.thumb { position: relative; margin: 0; }
.thumb img, img.thumb-img {
  width: 92px; height: 92px; object-fit: cover; border-radius: 14px; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-sm);
  background: var(--na-bg); display: block; cursor: zoom-in;
}
.thumb-x {
  position: absolute; top: -9px; inset-inline-start: -9px; width: 34px; height: 34px; border: 2px solid var(--surface); border-radius: 50%;
  background: var(--bad); color: #fff; font-size: .9rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow);
}
.photo-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-actions .btn { flex: 1; cursor: pointer; border-style: dashed; border-color: var(--line-strong); background: var(--surface); }
@media (hover: hover) { .photo-actions .btn:hover { border-color: var(--brand); color: var(--brand-text); } }
img.photo-full { width: 100%; max-height: 70dvh; object-fit: contain; border-radius: 14px; background: #000; }

/* tabs: segmented control (history filter, issues log) */
.tabs { display: flex; gap: 4px; overflow-x: auto; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 999px; background: transparent;
  color: var(--text); font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center;
  transition: background-color .15s, color .15s, box-shadow .15s;
}
.tab.on { background: var(--sel); color: var(--sel-ink); box-shadow: 0 6px 14px -6px rgba(8, 16, 36, .6); }

/* issues log: overdue + frequent maintenance */
.issue { --c: var(--line-strong); display: grid; gap: 8px; border-inline-start: 6px solid var(--c); }
.issue-critical { --c: var(--bad); }
.issue-warn { --c: var(--warn-line); }
.issue-new { --c: var(--info-line); }
.issue-top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.delay {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1.05rem;
  padding: 9px 12px; border-radius: 13px; background: var(--panel); border: 1px solid var(--line);
}
.delay strong { font-weight: 800; }
.delay-critical { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.delay-critical strong { color: var(--bad-ink); }
.delay-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn-line) 40%, transparent); }
.delay-warn strong { color: var(--warn-ink); }
.row-actions.small { font-size: .9rem; }
.row-actions.small a { flex: 1; text-align: center; padding: 8px 0; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; font-weight: 800; }

/* ---------------------------------------------------------------- scanner overlay */
.scan-overlay {
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; gap: 12px;
  padding: env(safe-area-inset-top) 14px calc(14px + env(safe-area-inset-bottom));
  background: radial-gradient(120% 80% at 50% 0%, #10224a, #050912 70%); color: #fff;
}
.scan-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; }
.scan-top strong { flex: 1; text-align: center; font-size: 1.1rem; }
.scan-viewport { position: relative; flex: 1; min-height: 220px; border-radius: 24px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px rgba(255, 255, 255, .12), 0 20px 50px -20px rgba(0, 0, 0, .8); }
.scan-viewport::after {
  content: ''; position: absolute; inset: 14%; border-radius: 22px; pointer-events: none;
  border: 3px solid var(--brand-2); border: 3px solid color-mix(in srgb, var(--brand-2) 90%, transparent);
  -webkit-mask: linear-gradient(#000 0 0) top left / 34px 34px no-repeat, linear-gradient(#000 0 0) top right / 34px 34px no-repeat, linear-gradient(#000 0 0) bottom left / 34px 34px no-repeat, linear-gradient(#000 0 0) bottom right / 34px 34px no-repeat;
  mask: linear-gradient(#000 0 0) top left / 34px 34px no-repeat, linear-gradient(#000 0 0) top right / 34px 34px no-repeat, linear-gradient(#000 0 0) bottom left / 34px 34px no-repeat, linear-gradient(#000 0 0) bottom right / 34px 34px no-repeat;
}
.scan-region { position: absolute; inset: 0; }
.scan-region video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-msg { margin: 0; min-height: 3em; text-align: center; color: #cbd5e1; font-weight: 600; }
.scan-msg.scan-err { color: #fca5a5; font-weight: 800; }
.scan-msg.scan-warn { color: #fde68a; }
.scan-manual { display: flex; gap: 8px; }
.scan-manual .input { background: #0d1730; color: #fff; border-color: #2a3a63; }
.scan-manual .input::placeholder { color: #8a9bc4; }
.scan-file { cursor: pointer; }

@media (min-width: 720px) {
  .view { padding-inline: 22px; }
  .appbar { margin-inline: -22px; padding-inline: 22px; border-radius: 0 0 18px 18px; }
  .hero { margin-inline: -22px; padding-inline: 28px; }
  .progress { margin-inline: -22px; padding-inline: 22px; }
  .st { min-height: 70px; }
  .st-txt { font-size: .86rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---- photo buttons: the real <input type=file> sits invisibly over the whole button */
.file-btn { position: relative; overflow: hidden; cursor: pointer; min-height: 56px; text-align: center; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.file-btn input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; padding: 0; border: 0; }
.photo-status { padding: 9px 13px; border-radius: 12px; font-weight: 700; font-size: .9rem; }
.photo-status.busy { background: var(--info-bg); color: var(--info-ink); }
.photo-status.err { background: var(--bad-bg); color: var(--bad-ink); border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); }

/* ---- diagnostics page */
.diag-log { white-space: pre-wrap; word-break: break-word; background: #0b1020; color: #7dff9b; padding: 14px; border-radius: 16px; font-size: 12px; line-height: 1.55; text-align: left; margin: 0; font-family: var(--mono); box-shadow: var(--shadow); }
.diag-row { display: flex; gap: 8px; flex-wrap: wrap; }
.diag-row .btn { flex: 1; }

/* ================================================================ accounts: login, signed-in user, staff screen */
.ltr-input { direction: ltr; text-align: left; }
.ltr-input::placeholder { direction: rtl; text-align: right; }
.mono { font-family: var(--mono); font-size: .86rem; font-weight: 700; }
.pw-row { display: flex; gap: 8px; align-items: center; }
.pw-row .input { flex: 1; min-width: 0; }
.eye-btn { flex: none; border: 2px solid var(--line); background: var(--surface); width: 50px; height: 50px; border-radius: var(--radius-sm); font-size: 1.15rem; }
.login-card .input { text-align: start; }

.hero-user { display: grid; gap: 2px; justify-items: start; }
.hero-user small { color: rgba(255, 255, 255, .78); font-weight: 600; }

.user-avatar {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 15px;
  background: linear-gradient(135deg, var(--nav), var(--nav-2)); color: #fff; font-size: 1.2rem; font-weight: 800;
  box-shadow: 0 8px 16px -8px rgba(8, 16, 36, .6), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.user-avatar.sm { width: 38px; height: 38px; border-radius: 12px; font-size: 1rem; }
.user-card { display: grid; gap: 10px; border-inline-start: 6px solid var(--ok-line); }
.user-card.is-inactive { border-inline-start-color: var(--na-line); opacity: .78; }
.user-top { display: flex; align-items: center; gap: 12px; }
.user-main { flex: 1; min-width: 0; display: grid; gap: 0; }
.user-main strong { font-size: 1.08rem; font-weight: 800; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.user-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.user-email { flex-basis: 100%; overflow-wrap: anywhere; }
.cred-box {
  display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--radius-sm); text-align: left;
  background: var(--panel); border: 1px dashed var(--line-strong); font-family: var(--mono); font-size: 1.05rem;
}
.inspector-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.inspector-who { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.inspector-who strong { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
