/* MSA Portal 2.0: base and shell styles, ported from the approved prototype (src/styles/index.css + the Tailwind
   utilities used by the shell, Overview, hubs, sign-in and src/components/ui). Tokens live in tokens.css.
   Rules: logical properties only (RTL); zebra rows on every table/list; glass only for navigation/controls; respect
   prefers-reduced-motion and prefers-reduced-transparency. Breakpoints: sm 640 · md 768 · lg 1024 · xl 1280 · 2xl 1536. */

/* ───────────────────────── Base ───────────────────────── */
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html, body { min-height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font-latin);
  font-size: 0.9375rem; /* 15px */
  line-height: 1.3333;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}
[dir="rtl"] body { font-family: var(--font-arabic); }
@media (pointer: coarse) { body { font-size: 1.0625rem; line-height: 1.294; } }

*, *::before, *::after { box-sizing: border-box; }
h1, h2, h3, h4, p, ul, ol, dl, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: default; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: inherit; text-decoration: none; }
img, video { display: block; max-width: 100%; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in oklab, var(--accent) 28%, transparent); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ───────────────────────── Typography scale (§5) ───────────────────────── */
.t-large { font-size: 2.125rem; line-height: 2.5625rem; font-weight: 700; letter-spacing: -0.02em; }
.t-title1 { font-size: 1.75rem; line-height: 2.125rem; font-weight: 700; letter-spacing: -0.015em; }
.t-title2 { font-size: 1.375rem; line-height: 1.75rem; font-weight: 600; letter-spacing: -0.01em; }
.t-title3 { font-size: 1.25rem; line-height: 1.5625rem; font-weight: 600; letter-spacing: -0.008em; }
.t-headline { font-size: 1.0625rem; line-height: 1.375rem; font-weight: 600; letter-spacing: -0.004em; }
.t-body { font-size: 0.9375rem; line-height: 1.25rem; }
.t-callout { font-size: 0.875rem; line-height: 1.1875rem; }
.t-sub { font-size: 0.8125rem; line-height: 1.125rem; }
.t-foot { font-size: 0.75rem; line-height: 1rem; }
.t-cap { font-size: 0.6875rem; line-height: 0.8125rem; font-weight: 500; }
[dir="rtl"] .t-large, [dir="rtl"] .t-title1, [dir="rtl"] .t-title2, [dir="rtl"] .t-title3 { letter-spacing: 0; }
[dir="rtl"] .t-large { font-size: calc(2.125rem + var(--ar-bump)); line-height: 1.35; }
[dir="rtl"] .t-title2 { font-size: calc(1.375rem + var(--ar-bump)); line-height: 1.45; }
[dir="rtl"] .t-title3 { font-size: calc(1.25rem + var(--ar-bump)); line-height: 1.45; }
[dir="rtl"] .t-headline { font-size: calc(1.0625rem + 1px); line-height: 1.5; }
[dir="rtl"] .t-body, [dir="rtl"] .t-callout, [dir="rtl"] .t-sub { line-height: 1.55; }
[dir="rtl"] .btn-label { font-size: calc(1em + 1px); }

.tnum { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11", "ss01"; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; unicode-bidi: isolate; direction: ltr; display: inline-block; }
.latin { font-family: var(--font-latin); }
.arabic { font-family: var(--font-arabic); }
.text-2 { color: var(--label-secondary); }
.text-3 { color: var(--label-tertiary); }
.critical-text { color: var(--critical-text); }

/* ───────────────────────── Surfaces ───────────────────────── */
.card {
  background: var(--bg-elevated);
  border-radius: 16px;
  box-shadow: 0 0 0 1px var(--separator), var(--card-shadow);
}
.card-pad { padding: 16px; }
@media (min-width: 640px) { .card-pad { padding: 20px; } }
.grouped { background: var(--bg-grouped); border-radius: 16px; }
.hairline { box-shadow: 0 0 0 1px var(--separator); }
.divide-sep > * + * { border-top: 1px solid var(--separator); }

/* Liquid Glass: navigation & control layer only (§4.5) */
.glass {
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: inset 0 1px 0 0 var(--glass-edge), inset 0 0 0 0.5px var(--separator), var(--glass-shadow);
}
.glass-bar {
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}
.glass-clear {
  background: rgba(255, 255, 255, 0.10);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.16), 0 20px 60px rgba(0, 0, 0, 0.35);
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass-bar { background: var(--bg-elevated); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass-clear { background: rgba(24, 22, 18, 0.92); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .glass, .glass-bar { background: var(--bg-elevated); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: 0 0 0 1px var(--separator-strong); }
}
html[data-transparency="reduce"] .glass, html[data-transparency="reduce"] .glass-bar { background: var(--bg-elevated); backdrop-filter: none; -webkit-backdrop-filter: none; }

/* Skeleton shimmer */
.skeleton { position: relative; overflow: hidden; background: var(--fill); border-radius: 8px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--bg-elevated) 70%, transparent), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.3s infinite;
}
[dir="rtl"] .skeleton::after { animation-direction: reverse; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-page { display: grid; gap: 16px; }
.skeleton-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 1024px) { .skeleton-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.skeleton-list { display: grid; gap: 12px; }
.skeleton-row { display: flex; align-items: center; gap: 12px; }

/* Scrollbars: thin, macOS-like */
.scroll-thin { scrollbar-width: thin; scrollbar-color: var(--fill-strong) transparent; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Mirror directional glyphs in RTL (chevrons, arrows). Never flip logos, photos, the map or digits. */
[dir="rtl"] .flip-rtl { transform: scaleX(-1); }

/* Alternate-row (odd/even) shading for every table view */
.zebra-row { background: color-mix(in oklab, var(--fill) 55%, transparent); }
[data-theme="dark"] .zebra-row { background: rgba(255, 255, 255, 0.035); }
table:not(.no-zebra) > tbody > tr:nth-child(even):not([aria-selected="true"]) { background: color-mix(in oklab, var(--fill) 55%, transparent); }
[data-theme="dark"] table:not(.no-zebra) > tbody > tr:nth-child(even):not([aria-selected="true"]) { background: rgba(255, 255, 255, 0.035); }

.skip-link { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; transition: top .2s; }
.skip-link:focus { top: 12px; }

@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* Slow Ken Burns drift for photo tiles */
@keyframes kenburns { 0% { transform: scale(1.04) translate3d(0,0,0); } 50% { transform: scale(1.14) translate3d(-1.5%, -1%, 0); } 100% { transform: scale(1.04) translate3d(0,0,0); } }
.kenburns { animation: kenburns 28s ease-in-out infinite; will-change: transform; }
@keyframes live-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-dot { animation: live-dot 1.6s ease-in-out infinite; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }

/* ───────────────────────── Boot / shell layout ───────────────────────── */
.boot-splash { position: fixed; inset: 0; background: var(--bg); z-index: 1; }
body:has(.app-root) #boot { display: none; }
.app-root { min-height: 100dvh; }
.app-bg { background: radial-gradient(1200px 600px at 0% 0%, color-mix(in oklab, var(--accent) 7%, transparent), transparent 60%), radial-gradient(900px 500px at 100% 0%, color-mix(in oklab, var(--gold) 6%, transparent), transparent 60%), var(--bg); }
.shell { display: flex; height: 100dvh; overflow: hidden; }
.main-scroll { position: relative; min-width: 0; flex: 1; overflow-x: hidden; overflow-y: auto; outline: none; }
@media (max-width: 767px) { .main-scroll { padding-bottom: 112px; } }

@media print { .tab-bar, .toolbar, .no-print { display: none !important; } .main-scroll { overflow: visible !important; } .shell { height: auto; } }

/* ───────────────────────── Tooltip (IconButton, brand) ───────────────────────── */
@media (hover: hover) {
  [data-tip] { position: relative; }
  [data-tip]::after {
    content: attr(data-tip);
    position: absolute; left: 50%; top: calc(100% + 6px); z-index: 80;
    transform: translateX(-50%) translateY(-2px);
    padding: 4px 8px; border-radius: 8px; white-space: nowrap;
    font-size: 12px; font-weight: 500; line-height: 1.3; color: var(--label);
    background: var(--glass-tint); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    box-shadow: inset 0 0 0 0.5px var(--separator), var(--glass-shadow);
    opacity: 0; pointer-events: none; transition: opacity .12s, transform .12s; transition-delay: 0s;
  }
  [data-tip][data-tip-side="top"]::after { top: auto; bottom: calc(100% + 6px); }
  [data-tip]:hover::after { opacity: 1; transform: translateX(-50%); transition-delay: .5s; }
}

/* ───────────────────────── Buttons ───────────────────────── */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 999px; font-weight: 600; user-select: none; white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s, transform .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-sm { height: 28px; padding-inline: 12px; font-size: 13px; min-width: 28px; }
.btn-md { height: 32px; padding-inline: 14px; font-size: 14px; min-width: 32px; }
.btn-lg { height: 44px; padding-inline: 20px; font-size: 15px; min-width: 44px; }
.btn-full { width: 100%; }
.btn-icon-end { opacity: .7; }
.btn-prominent { background: var(--accent); color: var(--on-accent); box-shadow: inset 0 1px 0 rgba(255,255,255,.18); }
.btn-prominent:hover { background: var(--accent-hover); }
.btn-bordered { background: color-mix(in oklab, var(--accent) 12%, transparent); color: var(--accent); }
.btn-bordered:hover { background: color-mix(in oklab, var(--accent) 18%, transparent); }
.btn-plain { color: var(--accent); padding-inline: 8px; }
.btn-plain:hover { background: var(--fill); }
.btn-destructive { color: var(--critical-text); }
.btn-destructive:hover { background: color-mix(in oklab, var(--critical) 10%, transparent); }
.btn-destructiveFilled { background: var(--critical); color: #fff; }
.btn-destructiveFilled:hover { filter: brightness(.95); }
.btn-gray { background: var(--fill); color: var(--label); }
.btn-gray:hover { background: var(--fill-strong); }
.btn-glass { color: var(--label); background: var(--glass-tint); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: inset 0 1px 0 0 var(--glass-edge), inset 0 0 0 0.5px var(--separator), var(--glass-shadow); }
.btn-gold { background: color-mix(in oklab, var(--gold) 16%, transparent); color: var(--gold-text); }
.btn-gold:hover { background: color-mix(in oklab, var(--gold) 24%, transparent); }

.icon-btn {
  position: relative; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center;
  border-radius: 999px; transition: background .15s, color .15s, transform .15s;
}
.icon-btn::before { content: ""; position: absolute; inset: -6px; }
@media (pointer: coarse) { .icon-btn::before { inset: -8px; } }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .4; }
.icon-btn-sm { width: 28px; height: 28px; }
.icon-btn-md { width: 32px; height: 32px; }
.icon-btn-lg { width: 44px; height: 44px; }
.icon-btn-plain { color: var(--label-secondary); }
.icon-btn-plain:hover { color: var(--label); background: var(--fill); }
.icon-btn-gray { background: var(--fill); color: var(--label); }
.icon-btn-gray:hover { background: var(--fill-strong); }
.icon-btn-glass { color: var(--label); background: var(--glass-tint); -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); box-shadow: inset 0 1px 0 0 var(--glass-edge), inset 0 0 0 0.5px var(--separator), var(--glass-shadow); }
.icon-btn-bordered { background: color-mix(in oklab, var(--accent) 12%, transparent); color: var(--accent); }
.icon-btn-prominent { background: var(--accent); color: var(--on-accent); }
.icon-btn-clear { color: #fff; }
.icon-btn-clear:hover { background: rgba(255,255,255,.15); color: #fff; }
.icon-btn.is-active { background: var(--accent-soft); color: var(--accent); }
.icon-btn-badge {
  position: absolute; top: -2px; inset-inline-end: -2px; display: grid; place-items: center;
  min-width: 16px; height: 16px; padding-inline: 4px; border-radius: 999px;
  background: var(--brand-red); color: #fff; font-size: 10px; font-weight: 600; line-height: 1;
  box-shadow: 0 0 0 2px var(--bg);
}
.icon-btn-dot { min-width: 10px; width: 10px; height: 10px; padding: 0; }

/* ───────────────────────── Segmented control (§7.2) ───────────────────────── */
.segmented { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--fill); }
.segmented.glass { background: var(--glass-tint); }
.seg-full { display: flex; width: 100%; }
.seg-opt {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding-inline: 12px; border-radius: 999px; font-weight: 500; white-space: nowrap; color: var(--label-secondary);
  transition: color .15s, background .2s, box-shadow .2s;
}
.seg-opt:hover { color: var(--label); }
.seg-opt.is-selected { color: var(--label); background: var(--bg-elevated); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 0.5px rgba(0,0,0,.04); }
[data-theme="dark"] .seg-opt.is-selected { background: #3a3f3b; }
.segmented.glass .seg-opt.is-selected { background: var(--bg-elevated); }
.seg-gold .seg-opt.is-selected { color: var(--gold-text); }
.seg-full .seg-opt { flex: 1; }
.seg-sm .seg-opt { height: 28px; font-size: 12.5px; }
.seg-md .seg-opt { height: 32px; font-size: 13px; }
.seg-lg .seg-opt { height: 40px; font-size: 15px; }
.seg-badge { border-radius: 999px; background: var(--fill-strong); padding-inline: 6px; font-size: 11px; line-height: 16px; }

/* ───────────────────────── Status chip (§7.8) ───────────────────────── */
.status-chip {
  display: inline-flex; flex-shrink: 0; align-items: center; gap: 4px; border-radius: 999px; font-weight: 500; white-space: nowrap;
  background: color-mix(in oklab, var(--tone) 14%, transparent); color: var(--tone-text);
}
.status-chip.chip-md { height: 22px; padding-inline: 8px; font-size: 12px; }
.status-chip.chip-sm { height: 20px; padding-inline: 6px; font-size: 11px; }
.status-chip.is-solid { background: var(--tone); color: #fff; }
.chip-dot { width: 6px; height: 6px; border-radius: 999px; background: var(--tone); }
.status-chip.is-solid .chip-dot { background: #fff; }

/* ───────────────────────── Cards, KPI tiles, empty states ───────────────────────── */
.card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-header-icon { margin-top: 2px; display: grid; place-items: center; width: 28px; height: 28px; flex-shrink: 0; border-radius: 8px; background: color-mix(in oklab, var(--tone) 14%, transparent); color: var(--tone); }
.card-header-text { min-width: 0; flex: 1; }
.card-header-text .t-sub { margin-top: 2px; }
.card-header-action { flex-shrink: 0; }

.kpi-tile { display: block; width: 100%; padding: 16px; text-align: start; transition: transform .2s, box-shadow .2s; }
.kpi-tile.is-link:hover { transform: scale(1.01); }
.kpi-tile.is-link:active { transform: scale(.98); }
.kpi-head { display: flex; align-items: center; gap: 8px; }
.kpi-icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: color-mix(in oklab, var(--tone) 14%, transparent); color: var(--tone); }
.kpi-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.kpi-chevron { color: var(--label-tertiary); transition: transform .2s; }
.kpi-tile.is-link:hover .kpi-chevron { transform: translateX(2px); }
[dir="rtl"] .kpi-tile.is-link:hover .kpi-chevron { transform: scaleX(-1) translateX(2px); }
.kpi-value { margin-top: 8px; line-height: 1; }
.kpi-unit { margin-inline-start: 4px; font-size: 15px; font-weight: 600; color: var(--label-secondary); }
.kpi-footer { margin-top: 12px; border-top: 1px solid var(--separator); padding-top: 10px; }

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 48px 24px; text-align: center; }
.empty-state-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; background: var(--fill); color: var(--label-secondary); }
.empty-state-msg { max-width: 24rem; }
.coming-soon { min-height: 50vh; display: grid; place-items: center; }

.guard-denied { display: grid; min-height: 70vh; place-items: center; }
.guard-link { color: var(--accent); font-weight: 600; }

.avatar {
  display: inline-grid; flex-shrink: 0; place-items: center; border-radius: 999px; font-weight: 600; color: #fff; user-select: none;
  background: linear-gradient(160deg, color-mix(in oklab, var(--av) 80%, white), var(--av));
}
.avatar-ring { box-shadow: 0 0 0 2px var(--bg-elevated); }

.toggle { position: relative; display: inline-flex; flex-shrink: 0; align-items: center; padding: 2px; border-radius: 999px; background: var(--fill-strong); transition: background .2s; }
.toggle.is-on { background: var(--positive); }
.toggle:disabled { opacity: .4; }
.toggle-md { width: 46px; height: 28px; }
.toggle-sm { width: 38px; height: 22px; }
.toggle-thumb { display: block; border-radius: 999px; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2), 0 0 0 0.5px rgba(0,0,0,.04); transition: transform .2s cubic-bezier(.3,1.4,.6,1); }
.toggle-md .toggle-thumb { width: 24px; height: 24px; }
.toggle-sm .toggle-thumb { width: 18px; height: 18px; }
.toggle-md.is-on .toggle-thumb { transform: translateX(18px); }
.toggle-sm.is-on .toggle-thumb { transform: translateX(16px); }
[dir="rtl"] .toggle-md.is-on .toggle-thumb { transform: translateX(-18px); }
[dir="rtl"] .toggle-sm.is-on .toggle-thumb { transform: translateX(-16px); }

/* ───────────────────────── Overlays: scrim, sheet, inspector, toasts, popovers, menus ───────────────────────── */
.overlay-scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); animation: fadeIn .2s; }

.sheet {
  position: fixed; left: 50%; top: 6vh; z-index: 61; transform: translateX(-50%);
  width: min(94vw, var(--sheet-w, 520px)); max-height: 88vh; display: flex; flex-direction: column;
  border-radius: 20px; background: var(--bg-elevated); box-shadow: 0 30px 80px rgba(0,0,0,.25), 0 0 0 1px var(--separator);
  animation: sheetIn .25s cubic-bezier(.2,.9,.3,1.05);
}
@keyframes sheetIn { from { opacity: 0; transform: translateX(-50%) translateY(24px) scale(.98); } to { opacity: 1; transform: translateX(-50%); } }
.sheet-grabber { display: none; margin: 8px auto 0; width: 36px; height: 5px; border-radius: 999px; background: var(--fill-strong); flex-shrink: 0; }
.sheet-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; }
.sheet-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in oklab, var(--tone) 14%, transparent); color: var(--tone); }
.sheet-titles { min-width: 0; flex: 1; }
.sheet-body { min-height: 0; flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.sheet-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--separator); padding: 12px 20px; }
@media (max-width: 767px) {
  .sheet { left: 0; right: 0; top: auto; bottom: 0; transform: none; width: auto; max-height: 92dvh; border-radius: 20px 20px 0 0; animation: sheetUp .3s cubic-bezier(.2,.9,.3,1.05); }
  .sheet-grabber { display: block; }
  .sheet-body { padding-inline: 16px; padding-bottom: 16px; }
  .sheet-footer { padding: 12px 16px max(12px, env(safe-area-inset-bottom)); }
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: none; } }

.inspector-scrim { z-index: 44; display: none; }
.inspector-panel {
  position: fixed; inset-block: 8px; inset-inline-end: 8px; z-index: 45; width: 360px; display: flex; flex-direction: column;
  border-radius: 20px; overflow: hidden; background: var(--bg-elevated); box-shadow: 0 0 0 1px var(--separator), 0 24px 70px rgba(0,0,0,.22);
  animation: fadeIn .2s;
}
.inspector-panel .sheet-grabber { display: none; }
.inspector-header { display: flex; align-items: flex-start; gap: 8px; padding: 16px 20px 12px; }
.inspector-titles { min-width: 0; flex: 1; }
.inspector-titles .t-title3 { line-height: 1.25; }
.inspector-status { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.inspector-body { min-height: 0; flex: 1; overflow-y: auto; padding: 0 20px 20px; }
.inspector-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-top: 1px solid var(--separator); padding: 12px 20px max(12px, env(safe-area-inset-bottom)); }
/* Side panel (owner feedback 19-10-2026): a distinct background in both themes. Type, sizes, weights and label colours
   stay exactly as the approved prototype (owner, 22-10-2026). */
.inspector-panel { --inspector-bg: #EAF2EC; --inspector-card: #FFFFFF; background: var(--inspector-bg); }
[data-theme="dark"] .inspector-panel { --inspector-bg: #14201A; --inspector-card: #1F2B25; }
.inspector-panel .grouped { background: var(--inspector-card); box-shadow: 0 0 0 1px var(--separator); }
@media (max-width: 1023px) {
  .inspector-scrim { display: block; }
  .inspector-panel { inset: auto 0 0 0; width: auto; max-height: 88dvh; border-radius: 20px 20px 0 0; animation: sheetUp .3s cubic-bezier(.2,.9,.3,1.05); }
  .inspector-panel .sheet-grabber { display: block; }
}

.toast-host { pointer-events: none; position: fixed; inset-inline: 0; top: 12px; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-inline: 16px; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(92vw, 520px);
  border-radius: 999px; padding-block: 8px; padding-inline: 12px 8px; font-size: 14px; font-weight: 500; color: var(--label);
  animation: toastIn .35s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-24px) scale(.92); } to { opacity: 1; transform: none; } }
.toast-icon { flex-shrink: 0; }
.toast-msg { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-undo { margin-inline-start: 4px; display: inline-flex; height: 28px; align-items: center; gap: 4px; border-radius: 999px; background: var(--fill); padding-inline: 10px; font-size: 13px; font-weight: 600; color: var(--accent); }
.toast-undo:hover { background: var(--fill-strong); }
.toast-close { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 999px; color: var(--label-secondary); }
.toast-close:hover { background: var(--fill); }

.pop-anchor { position: relative; display: inline-flex; }
.pop-trigger { display: inline-flex; }
.pop-catcher { position: fixed; inset: 0; z-index: 74; }
.pop {
  position: absolute; top: calc(100% + 8px); z-index: 75; border-radius: 16px; padding: 8px; color: var(--label);
  max-width: calc(100vw - 24px); text-align: start; animation: popIn .18s cubic-bezier(.2,.9,.3,1.2); transform-origin: top;
}
.pop-end { inset-inline-end: 0; }
.pop-start { inset-inline-start: 0; }
.pop-center { left: 50%; translate: -50% 0; }
.pop-top { top: auto; bottom: calc(100% + 8px); transform-origin: bottom; }

.drop-menu { padding: 6px; border-radius: 14px; font-size: 14px; }
.menu-item { display: flex; width: 100%; height: 32px; align-items: center; gap: 10px; border-radius: 8px; padding-inline: 10px; text-align: start; }
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--on-accent); outline: none; }
.menu-item:disabled { opacity: .4; }
.menu-item.is-destructive { color: var(--critical-text); }
.menu-item.is-destructive:hover { background: var(--critical); color: #fff; }
.menu-item-icon { display: grid; width: 16px; place-items: center; }
.menu-item-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-shortcut { font-size: 12px; opacity: .6; }
.menu-sep { margin: 4px 8px; height: 1px; background: var(--separator); }
.menu-header { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .025em; color: var(--label-secondary); }
[dir="rtl"] .menu-header { letter-spacing: 0; }

.notif-pop { padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; }
.notif-list { max-height: 60vh; overflow-y: auto; padding: 0 8px 8px; }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding-block: 40px; color: var(--label-secondary); }

.account-pop { padding: 8px; }
.account-body { display: grid; gap: 12px; padding: 6px; }
.account-id { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--separator); padding-bottom: 12px; }
.account-id-text { min-width: 0; line-height: 1.25; }
.account-name { display: block; font-size: 14.5px; font-weight: 600; }
.account-sub { display: block; font-size: 12px; color: var(--label-secondary); }
.menu-section-label { margin-bottom: 6px; font-size: 11.5px; font-weight: 600; color: var(--label-secondary); }
.account-actions { display: grid; border-top: 1px solid var(--separator); padding-top: 8px; }
.menu-row { display: flex; width: 100%; height: 32px; align-items: center; gap: 8px; border-radius: 8px; padding-inline: 8px; font-size: 13.5px; text-align: start; }
.menu-row:hover { background: var(--fill); }
.menu-row.is-destructive { color: var(--critical-text); }
.avatar-btn { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 999px; transition: background .15s; }
.avatar-btn:hover { background: var(--fill); }
.avatar-btn.is-clear:hover { background: rgba(255,255,255,.15); }

/* ───────────────────────── Toolbar (Page header, Overview/hub top bar) ───────────────────────── */
/* The glass is drawn by ::before so the toolbar never becomes a containing block for fixed popover layers. */
.toolbar { position: sticky; top: 0; z-index: 20; }
.toolbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.toolbar-page::before {
  background: var(--glass-tint);
  -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 1px 0 var(--separator);
}
.toolbar-clear::before {
  background: rgba(0,0,0,.25);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
  transition-duration: .3s;
}
#main-scroll[data-s44] .toolbar-page::before, .toolbar.is-solid::before, #main-scroll[data-s24] .toolbar-clear::before { opacity: 1; }
@media (prefers-reduced-transparency: reduce) {
  .toolbar-page::before { background: var(--bg-elevated); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .toolbar-clear::before { background: rgba(14, 18, 16, .94); backdrop-filter: none; -webkit-backdrop-filter: none; }
}
.toolbar-inner { margin-inline: auto; display: flex; height: 56px; max-width: 1680px; align-items: center; gap: 8px; padding-inline: 16px; }
.toolbar-inner.is-wide { max-width: none; }
.toolbar-clear .toolbar-inner { height: 60px; }
@media (min-width: 768px) { .toolbar-inner { padding-inline: 20px; } .toolbar-clear .toolbar-inner { padding-inline: 24px; } }
@media (min-width: 1280px) { .toolbar-inner { padding-inline: 24px; } }
.toolbar-end { display: flex; min-width: 0; flex: 1; align-items: center; justify-content: flex-end; gap: 8px; }
.toolbar-spacer { flex: 1; }
.toolbar-controls { display: flex; min-width: 0; align-items: center; gap: 8px; overflow-x: auto; }
@media (max-width: 767px) { .toolbar-controls { display: none; } }
.toolbar-actions { display: flex; flex-shrink: 0; align-items: center; gap: 8px; }
.toolbar-title {
  min-width: 0; border-inline-start: 1px solid var(--separator); padding-inline-start: 12px; font-size: 15px; font-weight: 600;
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .18s, transform .18s, visibility .18s;
}
#main-scroll[data-s44] .toolbar-page .toolbar-title, .toolbar.is-solid .toolbar-title { opacity: 1; visibility: visible; transform: none; }
.toolbar-clock { display: none; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; color: rgba(255,255,255,.85); }
@media (min-width: 640px) { .toolbar-clock { display: inline-flex; } }

.shell-lead { display: flex; flex-shrink: 0; align-items: center; gap: 6px; }
.shell-trail { display: flex; flex-shrink: 0; align-items: center; gap: 4px; }
.brand-btn { display: flex; height: 36px; align-items: center; gap: 8px; border-radius: 999px; padding-inline: 4px 10px; transition: background .15s; }
.brand-btn:hover { background: var(--fill); }
.brand-btn.is-clear:hover { background: rgba(255,255,255,.12); }
.brand-mark { flex-shrink: 0; }
.brand-name { display: none; font-size: 14.5px; font-weight: 700; letter-spacing: -0.025em; }
@media (min-width: 1024px) { .brand-name { display: inline; } }
.toolbar-clear .brand-btn, .toolbar-clear .brand-name { color: #fff; }

.back-link { display: inline-flex; height: 32px; align-items: center; gap: 2px; border-radius: 999px; padding-inline-end: 8px; font-size: 15px; color: var(--accent); white-space: nowrap; }
.back-link:hover { background: var(--fill); }

/* ───────────────────────── Page frame ───────────────────────── */
.page { min-height: 100%; }
.page-body { margin-inline: auto; max-width: 1680px; padding: 0 16px 40px; }
.page-body.is-wide { max-width: none; }
@media (min-width: 768px) { .page-body { padding-inline: 20px; } }
@media (min-width: 1280px) { .page-body { padding-inline: 24px; } }
.page-header { padding: 4px 0 16px; }
.page-header-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.page-titles { min-width: 0; }
.page-subtitle { margin-top: 2px; }
.page-toolbar-phone { margin-top: 12px; display: flex; align-items: center; gap: 8px; overflow-x: auto; }
@media (min-width: 768px) { .page-toolbar-phone { display: none; } }
.page-accessory { margin-top: 12px; }

/* ───────────────────────── Data table (§7.5) ───────────────────────── */
.data-table { overflow: hidden; }
.dt-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; border-bottom: 1px solid var(--separator); padding: 10px 16px; }
.dt-title { margin-inline-end: auto; }
.dt-count { margin-inline-start: auto; }
.dt-scroll { overflow: auto; }
.dt-table { min-width: 100%; }
.dt-head { position: sticky; top: 0; z-index: 10; display: grid; border-bottom: 1px solid var(--separator); font-size: 12px; font-weight: 600; color: var(--label-secondary); }
.dt-th { display: flex; height: 36px; align-items: center; padding-inline: 12px; }
.dt-th.align-end { justify-content: flex-end; }
.dt-th.align-center { justify-content: center; }
.dt-sort { display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.dt-sort:hover, .dt-sort.is-sorted { color: var(--label); }
.dt-row { display: grid; height: 44px; align-items: center; border-bottom: 1px solid var(--separator); font-size: 13.5px; transition: background .15s; }
.dt-row:last-child { border-bottom: 0; }
.dt-row.is-clickable:hover { background: var(--fill); }
.dt-row.is-selected, .dt-row.is-selected:hover { background: var(--accent-soft); }
.dt-td { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 12px; }
.dt-td.align-end { text-align: end; font-variant-numeric: tabular-nums; }
.dt-td.align-center { text-align: center; }
.dt-card { display: flex; width: 100%; align-items: center; gap: 12px; padding: 12px 16px; text-align: start; }
.dt-card:active { background: var(--fill); }
.dt-card.is-selected { background: var(--accent-soft); }
.dt-card-body { min-width: 0; flex: 1; }
.dt-card-title { font-weight: 600; }
.dt-card-meta { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 12px; }

/* ───────────────────────── Immersive pages (Overview, hubs): video wall + photo tiles ───────────────────────── */
.immersive { position: relative; min-height: 100dvh; color: #fff; }
.immersive.is-entering { animation: overviewIn .8s cubic-bezier(.16,1,.3,1); }
@keyframes overviewIn { from { opacity: 0; transform: scale(1.04); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
.immersive-main { position: relative; z-index: 10; margin-inline: auto; max-width: 1680px; padding: 0 16px 56px; }
@media (min-width: 768px) { .immersive-main { padding-inline: 24px; } }
.immersive-credit { margin-top: 32px; text-align: center; font-size: 11.5px; color: rgba(255,255,255,.5); }
.immersive .toolbar { z-index: 20; }

.video-wall { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: #0d1512; }
.video-wall-media { width: 100%; height: 100%; object-fit: cover; transform: scale(1.02); }
/* Lighter wall (owner feedback 19-10-2026): less dim; the gradient only keeps the toolbar and the tile labels legible. */
.video-wall-dim { position: absolute; inset: 0; background: rgba(0,0,0,.16); }
/* Item photos (legacy Master Item): the catalogue's photo sheet and the picked item in a Store Issue line. */
.item-photo { display: flex; justify-content: center; margin: 4px 0 16px; }
.item-photo .thumb { background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.12); }
.issue-item-pick { display: flex; min-width: 0; align-items: center; gap: 8px; }
.issue-item-pick .select { flex: 1; min-width: 0; }
.video-wall-dim.is-strong { background: rgba(6,12,9,.62); }
/* An ordinary page over a video (Chinese Projects): the content sits above the fixed video wall. */
.video-page { position: relative; min-height: 100dvh; color: var(--label); }
.video-page > .page { position: relative; z-index: 1; }
.video-wall-grad { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(6,12,9,.40) 0%, rgba(6,12,9,0) 24%, rgba(6,12,9,.08) 55%, rgba(6,12,9,.62) 100%); }
.video-wall-tint { position: absolute; inset: 0; mix-blend-mode: soft-light; opacity: .7; background: radial-gradient(120% 70% at 15% 100%, var(--tone), transparent 65%); }

.section-caption { margin: 32px 0 12px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.7); }
[dir="rtl"] .section-caption { letter-spacing: 0; }

/* Overview */
.overview-hero-wrap { display: flex; min-height: calc(66.667dvh - 60px); flex-direction: column; justify-content: flex-end; padding-bottom: 16px; }
.overview-hero { padding: 24px 0 20px; }
.overview-greeting {
  font-size: clamp(34px, 5.4vw, 72px); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em;
  filter: drop-shadow(0 4px 24px rgba(0,0,0,.35)); animation: fadeUp .6s .18s both;
}
[dir="rtl"] .overview-greeting { line-height: 1.25; letter-spacing: normal; }
.overview-name { color: rgba(255,255,255,.9); }
.overview-dateline { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 15px; color: rgba(255,255,255,.85); animation: fadeIn .5s .3s both; }
.dateline-dot { color: rgba(255,255,255,.4); }
.overview-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: max(180px, calc(33.333dvh - 100px)); gap: 12px; }
@media (min-width: 768px) { .overview-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: max(188px, calc(33.333dvh - 24px)); gap: 16px; } }
@media (min-width: 1536px) { .overview-groups { grid-template-columns: repeat(8, minmax(0, 1fr)); } }
.overview-main-caption { margin-top: 32px; }
.overview-bento { display: grid; grid-auto-flow: dense; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 180px; gap: 12px; }
.overview-bento .size-xl { grid-column: span 2; grid-row: span 2; }
.overview-bento .size-wide { grid-column: span 2; }
.overview-bento .size-tall { grid-column: span 1; grid-row: span 2; }
.overview-bento .size-std { grid-column: span 1; }
@media (min-width: 768px) {
  .overview-bento { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-rows: 200px; gap: 16px; }
  .overview-bento .size-xl, .overview-bento .size-wide { grid-column: span 6; }
  .overview-bento .size-tall, .overview-bento .size-std { grid-column: span 3; }
}
@media (min-width: 1280px) {
  .overview-bento { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .overview-bento .size-xl, .overview-bento .size-wide { grid-column: span 6; }
  .overview-bento .size-tall, .overview-bento .size-std { grid-column: span 3; }
}

/* Photo tile */
.photo-tile {
  position: relative; isolation: isolate; display: block; min-height: 188px; overflow: hidden; border-radius: 22px;
  color: #fff; text-align: start; outline-offset: 4px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28), 0 0 0 1px rgba(255,255,255,.15);
  transition: transform .25s cubic-bezier(.2,.9,.3,1.2);
  animation: tileIn .55s cubic-bezier(.2,.9,.3,1.05) backwards; animation-delay: calc(.05s + var(--i, 0) * .045s);
}
@keyframes tileIn { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }
.photo-tile:hover { transform: translateY(-3px); }
.photo-tile:active { transform: scale(.98); }
.photo-tile.is-compact { min-height: 132px; }
.tile-photos { position: absolute; inset: 0; z-index: -1; background: #1b241f; }
.tile-photos img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.4s ease-in-out; animation: kenburns 28s ease-in-out infinite; will-change: transform; }
.tile-photos img[data-on] { opacity: 1; }
.tile-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.30) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,.18) 55%, rgba(0,0,0,.78) 100%); }
.tile-glow { position: absolute; inset: 0; opacity: 0; transition: opacity .3s; background: radial-gradient(120% 80% at 50% 120%, color-mix(in oklab, var(--accent) 35%, transparent), transparent 70%); }
.photo-tile:hover .tile-glow { opacity: 1; }
.tile-top { position: absolute; inset-inline: 12px; top: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tile-chip { display: inline-flex; min-width: 0; height: 32px; align-items: center; gap: 6px; border-radius: 999px; padding-inline: 8px 12px; font-size: 13px; font-weight: 600; }
.tile-chip-icon { display: grid; flex-shrink: 0; width: 20px; height: 20px; place-items: center; border-radius: 999px; background: var(--tone); }
.tile-top-end { display: flex; flex-shrink: 0; align-items: center; gap: 6px; }
.tile-kind { border-radius: 999px; background: rgba(0,0,0,.45); padding: 2px 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .025em; color: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
[dir="rtl"] .tile-kind { letter-spacing: 0; }
.tile-badge { display: grid; height: 24px; min-width: 24px; place-items: center; border-radius: 999px; background: var(--brand-red); padding-inline: 6px; font-size: 12px; font-weight: 700; box-shadow: 0 10px 15px rgba(0,0,0,.2); }
.tile-go { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 999px; opacity: 0; transition: opacity .2s; }
.photo-tile:hover .tile-go, .photo-tile:focus-visible .tile-go { opacity: 1; }
.tile-bottom { position: absolute; inset-inline: 16px; bottom: 14px; }
.tile-value { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -0.025em; filter: drop-shadow(0 2px 10px rgba(0,0,0,.45)); }
.photo-tile.size-xl .tile-value { font-size: 44px; }
.photo-tile.is-compact .tile-value { font-size: 24px; }
.tile-stat-label { margin-top: 4px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.85); }

/* Hubs */
.hub-hero { display: flex; min-height: calc(50dvh - 60px); flex-direction: column; justify-content: flex-end; gap: 20px; padding: 32px 0 24px; animation: fadeUp .5s .05s both; }
.hub-badge-row { display: flex; align-items: center; gap: 12px; }
.hub-icon { display: grid; width: 56px; height: 56px; place-items: center; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 1px rgba(255,255,255,.25); background: linear-gradient(150deg, color-mix(in oklab, var(--tone) 85%, white), var(--tone)); }
.hub-chip { border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,.9); }
[dir="rtl"] .hub-chip { letter-spacing: 0; }

/* Central Pivot contract card (PivotContractCard). */
.contract-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.contract-icon { display: grid; flex: none; width: 40px; height: 40px; place-items: center; border-radius: 12px; color: var(--c7); background: color-mix(in oklab, var(--c7) 14%, transparent); }
.contract-text { flex: 1; min-width: 160px; }
.contract-actions { display: flex; gap: 8px; }
.contract-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--separator); }
.contract-edit label.btn { cursor: pointer; }
.contract-edit label.btn.is-disabled { pointer-events: none; opacity: .5; }
.contract-edit label.btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Company logo (BrandLogo): cut out, no plate. Dark surfaces and the video get the file with white wording and a soft shadow. */
.brand-logo { display: inline-flex; flex: none; align-items: center; margin-inline-start: auto; }
.brand-logo img { display: block; height: 104px; width: auto; }
.brand-logo.is-lg img { height: 124px; }
.brand-logo .on-dark { display: none; }
[data-theme="dark"] .brand-logo .on-light { display: none; }
[data-theme="dark"] .brand-logo .on-dark { display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,.55)); }
@media (max-width: 767px) { .brand-logo img { height: 76px; } .brand-logo.is-lg img { height: 92px; } }
.hub-title { font-size: clamp(40px, 6vw, 84px); font-weight: 700; line-height: 1; letter-spacing: -0.035em; filter: drop-shadow(0 4px 24px rgba(0,0,0,.4)); }
[dir="rtl"] .hub-title { line-height: 1.2; letter-spacing: normal; }
.hub-desc { margin-top: 12px; max-width: 42rem; font-size: 17px; line-height: 1.625; color: rgba(255,255,255,.85); }
.hub-tiles { display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max(240px, calc(50dvh - 56px)); gap: 16px; }
@media (min-width: 640px) { .hub-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .hub-tiles.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-tiles.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hub-tiles.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1280px) { .hub-tiles.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.breadcrumb { display: none; min-width: 0; align-items: center; gap: 4px; font-size: 13.5px; color: rgba(255,255,255,.8); }
@media (min-width: 640px) { .breadcrumb { display: flex; } }
.crumb { display: inline-flex; align-items: center; gap: 4px; }
.crumb a { border-radius: 999px; padding: 4px 8px; }
.crumb a:hover { background: rgba(255,255,255,.12); color: #fff; }
.crumb-sep { color: rgba(255,255,255,.45); flex-shrink: 0; }
.crumb-current { padding-inline: 8px; font-weight: 600; color: #fff; }

/* ───────────────────────── Full-screen menu (Launcher) ───────────────────────── */
.launcher-scrim { position: fixed; inset: 0; z-index: 78; background: rgba(8,12,10,.55); -webkit-backdrop-filter: blur(40px) saturate(150%); backdrop-filter: blur(40px) saturate(150%); animation: fadeIn .22s; }
@media (prefers-reduced-transparency: reduce) { .launcher-scrim { background: rgba(8,12,10,.96); backdrop-filter: none; -webkit-backdrop-filter: none; } }
.launcher { position: fixed; inset: 0; z-index: 79; overflow-y: auto; color: #fff; background: transparent; animation: launcherIn .3s cubic-bezier(.2,.9,.3,1.05); }
@keyframes launcherIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.launcher-inner { margin-inline: auto; max-width: 1440px; padding: 20px 16px 40px; }
@media (min-width: 768px) { .launcher-inner { padding-inline: 32px; } }
.launcher-head { margin-bottom: 24px; display: flex; align-items: center; gap: 12px; }
.launcher-titles { min-width: 0; flex: 1; }
.launcher-title { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; }
[dir="rtl"] .launcher-title { letter-spacing: 0; }
.launcher-hint { font-size: 14px; color: rgba(255,255,255,.7); }
.launcher .section-caption { margin: 0 0 10px; font-size: 12.5px; }
.launcher .launcher-main-caption { margin-top: 24px; }
.launcher-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .launcher-groups { grid-template-columns: repeat(4, minmax(0, 1fr)); } .launcher-main { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .launcher-main { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ───────────────────────── Command palette ───────────────────────── */
.palette-scrim { z-index: 80; }
.palette { position: fixed; left: 50%; top: 12vh; z-index: 81; width: min(94vw, 620px); overflow: hidden; border-radius: 18px; transform: translateX(-50%); color: var(--label); animation: paletteIn .16s ease-out; }
@keyframes paletteIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px) scale(.97); } to { opacity: 1; transform: translateX(-50%); } }
.palette-input-row { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--separator); padding-inline: 16px; }
.palette-input { height: 56px; flex: 1; min-width: 0; border: 0; background: transparent; font-size: 17px; outline: none; }
.palette-input::placeholder { color: var(--label-secondary); }
.palette-kbd { border-radius: 6px; background: var(--fill); padding: 2px 6px; font-size: 11px; color: var(--label-secondary); }
.palette-list { max-height: 56vh; overflow-y: auto; padding: 8px; }
.palette-empty { padding-block: 40px; text-align: center; }
.palette-group { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--label-secondary); }
.palette-item { display: flex; height: 40px; align-items: center; gap: 12px; border-radius: 10px; padding-inline: 10px; cursor: default; }
.palette-item-icon { color: var(--accent); flex-shrink: 0; }
.palette-item.is-selected { background: var(--accent); color: var(--on-accent); }
.palette-item.is-selected .palette-item-icon { color: inherit; }
.palette-item-label { min-width: 0; flex: 1; font-size: 14px; }
.palette-item-sub { margin-inline-start: 8px; font-size: 12.5px; color: var(--label-secondary); }
.palette-item.is-selected .palette-item-sub { color: inherit; opacity: .8; }
.palette-enter { opacity: .8; flex-shrink: 0; }

/* ───────────────────────── Phone tab bar ───────────────────────── */
.tab-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; padding: 0 16px max(10px, env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .tab-bar { display: none; } }
.tab-bar-list { margin-inline: auto; display: flex; height: 62px; max-width: 28rem; align-items: stretch; border-radius: 999px; padding: 4px; }
.tab-bar-item { position: relative; flex: 1; }
.tab-link { position: relative; display: flex; height: 100%; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-radius: 999px; font-size: 10.5px; font-weight: 500; color: var(--label); transition: background .25s, color .2s; }
.tab-link.is-active { color: var(--accent); background: var(--fill-strong); }
.tab-icon { position: relative; }
.tab-badge { position: absolute; inset-inline-end: -10px; top: -4px; display: grid; height: 16px; min-width: 16px; place-items: center; border-radius: 999px; background: var(--brand-red); padding-inline: 4px; font-size: 10px; font-weight: 600; line-height: 1; color: #fff; }

/* ───────────────────────── More / Reports lists ───────────────────────── */
.narrow-column { margin-inline: auto; display: grid; max-width: 42rem; gap: 24px; }
.identity-card { display: flex; align-items: center; gap: 14px; padding: 16px; }
.identity-text { min-width: 0; flex: 1; }
.list-caption { margin-bottom: 6px; display: flex; align-items: center; gap: 6px; padding-inline: 16px; font-size: 0.75rem; line-height: 1rem; font-weight: 600; text-transform: uppercase; letter-spacing: .025em; color: var(--label-secondary); }
[dir="rtl"] .list-caption { letter-spacing: 0; }
.list-card { overflow: hidden; }
.list-card > * + * { border-top: 1px solid var(--separator); }
.list-row { display: flex; width: 100%; min-height: 48px; align-items: center; gap: 12px; padding: 8px 16px; text-align: start; transition: background .15s; }
a.list-row:hover, button.list-row:hover { background: var(--fill); }
a.list-row:active, button.list-row:active { background: var(--fill-strong); }
.list-row.is-child { padding-inline-start: 58px; }
.list-row.is-tall { min-height: 60px; padding-block: 10px; }
.list-row.is-wrap { flex-wrap: wrap; }
.list-row-label { min-width: 0; flex: 1; font-size: 15.5px; }
.list-row.is-child .list-row-label { font-size: 14.5px; }
.list-row.is-tall .list-row-label { font-weight: 500; }
.list-chevron { flex-shrink: 0; color: var(--label-tertiary); }
.icon-tile { display: grid; flex-shrink: 0; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: #fff; background: var(--tone); }
.icon-tile.is-small { width: 24px; height: 24px; border-radius: 7px; }
.icon-tile.is-large { width: 36px; height: 36px; border-radius: 10px; }
@media (max-width: 380px) { .list-row.is-wrap .segmented { width: 100%; margin-inline-start: 42px; } }

/* ───────────────────────── Sign in ───────────────────────── */
.login { position: relative; display: grid; min-height: 100dvh; place-items: center; overflow: hidden; background: #0d1512; padding: 40px 16px; color: #fff; }
.login-hero { position: absolute; inset: -32px; transform: translate(var(--px, 0px), var(--py, 0px)); transition: transform .65s cubic-bezier(.6,0,.4,1), opacity .65s cubic-bezier(.6,0,.4,1); }
.login-hero img { width: 100%; height: 100%; object-fit: cover; animation: heroSettle 22s ease-out forwards; }
@keyframes heroSettle { from { transform: scale(1.12); } to { transform: scale(1.04); } }
.login.is-leaving .login-hero { transform: translate(var(--px, 0px), var(--py, 0px)) scale(1.4); opacity: 0; }
.login-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(8,14,22,.15) 0%, rgba(8,14,22,0) 35%, rgba(10,12,10,.55) 100%); }
.login-dim { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.login-lang { position: absolute; inset-inline-end: 16px; top: 16px; z-index: 10; display: flex; border-radius: 999px; padding: 4px; }
.login-lang button { height: 32px; min-width: 44px; border-radius: 999px; padding-inline: 12px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.85); transition: background .15s, color .15s; }
.login-lang button:hover { color: #fff; }
.login-lang button.is-on { background: #fff; color: #14231d; }
.login-card { position: relative; z-index: 10; width: 100%; max-width: 400px; border-radius: 28px; padding: 28px; animation: cardIn .6s .15s cubic-bezier(.2,.9,.3,1.1) backwards; transition: opacity .45s cubic-bezier(.6,0,.4,1), transform .45s cubic-bezier(.6,0,.4,1), filter .45s; }
@media (min-width: 640px) { .login-card { padding: 32px; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.login.is-leaving .login-card { opacity: 0; transform: scale(1.08); filter: blur(6px); }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-logo-plate { border-radius: 18px; background: #fff; padding: 12px 20px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.login-logo-plate img { width: 240px; height: auto; }
.login-title { margin-top: 16px; font-size: 24px; font-weight: 700; line-height: 1.25; }
[dir="rtl"] .login-title { font-size: 26px; }
.login-subtitle { margin-top: 4px; font-size: 14px; color: rgba(255,255,255,.75); }
.login-fields { margin-top: 24px; display: grid; gap: 12px; }
.login-field { display: grid; gap: 6px; }
.login-label { font-size: 13px; font-weight: 500; color: rgba(255,255,255,.8); }
.login-input {
  height: 44px; width: 100%; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); padding-inline: 14px; font-size: 15px; color: #fff;
  outline: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); transition: background .15s, box-shadow .15s;
}
.login-input::placeholder { color: rgba(255,255,255,.55); }
.login-input:focus { background: rgba(255,255,255,.18); box-shadow: inset 0 0 0 2px rgba(255,255,255,.7); }
.login-input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px #ffb4b4; }
.login-error { font-size: 12.5px; color: #ffb4b4; }
.login-remember { margin-top: 4px; display: flex; align-items: center; justify-content: space-between; }
.login-remember label { font-size: 14px; color: rgba(255,255,255,.85); }
.login-problem { margin-top: 16px; display: flex; align-items: flex-start; gap: 8px; border-radius: 12px; background: rgba(229,72,77,.2); box-shadow: inset 0 0 0 1px rgba(255,180,180,.35); padding: 10px 12px; font-size: 13.5px; color: #ffe1e1; }
.login-problem .lucide { flex-shrink: 0; margin-top: 1px; color: #ffb4b4; }
.login-submit {
  margin-top: 24px; display: inline-flex; height: 48px; width: 100%; align-items: center; justify-content: center; gap: 8px; border-radius: 999px;
  background: #1E6B4E; font-size: 16px; font-weight: 600; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 24px rgba(30,107,78,.45); transition: background .15s, transform .15s;
}
.login-submit:hover { background: #185A41; }
.login-submit:active { transform: scale(.98); }
.login-submit:disabled { opacity: .75; }
.login-footer { position: absolute; inset-inline: 0; bottom: 16px; z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-size: 12.5px; color: rgba(255,255,255,.75); }
.login-footer-org { font-weight: 500; }
.login-footer-credit { font-size: 11px; color: rgba(255,255,255,.45); }

/* ───────────────────────── Motion preferences ───────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 120ms !important; }
  .tile-photos img, .kenburns { animation: none !important; transform: none; }
  .login-hero img { animation: none !important; transform: scale(1.04); }
  .login-hero { transform: none !important; }
}

/* Employee photo in place of the initials avatar (legacy photos are 192x192). */
.avatar.avatar-photo { display: inline-block; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px var(--separator); }
.avatar.avatar-ring.avatar-photo { box-shadow: 0 0 0 2px var(--bg-elevated); }
/* Zoom on the face: in the legacy photos it sits in the upper middle of the frame. */
.avatar-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.6); transform-origin: 50% 30%; }

/* Overview live activity (approved prototype layout; real events) */
.overview-hero-grid { display: grid; gap: 24px; align-items: end; }
@media (min-width: 1024px) { .overview-hero-grid { grid-template-columns: minmax(0, 1fr) 380px; } }
.live-feed { border-radius: 22px; padding: 14px; color: #fff; margin-bottom: 20px; }
@media (max-width: 1023px) { .live-feed { display: none; } }
.live-feed-title { margin: 0 0 8px; display: flex; align-items: center; gap: 8px; padding-inline: 4px; font-size: 12.5px; font-weight: 600; color: rgba(255,255,255,.8); }
.live-dot { width: 8px; height: 8px; flex-shrink: 0; border-radius: 999px; background: #ff5a5f; animation: live-dot 1.6s ease-in-out infinite; }
@keyframes live-dot { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.live-feed-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 4px; height: 172px; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.live-feed-item { display: flex; align-items: center; gap: 10px; border-radius: 12px; padding: 6px; font-size: 13px; }
.live-feed-item.is-new { animation: live-in .35s ease-out; }
@keyframes live-in { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.live-feed-icon { display: grid; width: 28px; height: 28px; flex-shrink: 0; place-items: center; border-radius: 999px; background: rgba(255,255,255,.12); }
.live-feed-text { min-width: 0; flex: 1; color: rgba(255,255,255,.9); }
a.live-feed-text:hover { text-decoration: underline; }
.live-feed-time { flex-shrink: 0; font-size: 11px; color: rgba(255,255,255,.55); }
@media (prefers-reduced-motion: reduce) { .live-dot, .live-feed-item.is-new { animation: none; } }
