/* Bekonek Switch design system: tokens, shell, components. No framework.
   Colors, type, radii, shadows and the shell layout are taken from the
   BeKonek production web app (bekonek-web: tailwind.config.js, index.css,
   components/shell/SideNav.jsx and TopNav.jsx, components/ui/*), so both
   platforms look the same. Tailwind names are noted where a value maps to
   one (brand-950, primary-600, slate-200, ...). */
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/inter-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 400; src: url(/fonts/jetbrains-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 500; src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 600; src: url(/fonts/jetbrains-mono-latin-600-normal.woff2) format("woff2"); }

:root {
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  /* production palette */
  --brand-950: #081D36; --brand-900: #0D2847; --brand-100: #EAF1FF; --brand-50: #F5F8FF;
  --primary-50: #EFF6FF; --primary-100: #DBEAFE; --primary-200: #BFDBFE; --primary-400: #60A5FA; --primary-500: #3B82F6; --primary-600: #2563EB; --primary-700: #1D4ED8; --primary-800: #1E40AF;
  --slate-50: #F8FAFC; --slate-100: #F1F5F9; --slate-200: #E2E8F0; --slate-300: #CBD5E1; --slate-400: #94A3B8; --slate-500: #64748B; --slate-600: #475569; --slate-700: #334155; --slate-800: #1E293B; --slate-900: #0F172A;
  /* roles used by the components */
  --bg: var(--brand-50);
  --surface: #ffffff;
  --surface-2: var(--slate-50);
  --ink: var(--slate-900);          /* headings, strong text */
  --text: var(--slate-800);         /* body text */
  --ink-2: var(--slate-700);        /* labels, secondary text */
  --muted: var(--slate-500);
  --line: rgba(226, 232, 240, .8);  /* slate-200/80 */
  --line-row: var(--slate-100);
  --line-strong: var(--slate-300);
  --brand: var(--primary-600);
  --brand-hover: var(--primary-700);
  --brand-ink: #ffffff;
  --brand-soft: var(--primary-50);
  --focus: var(--primary-500);
  --ok: #15803D; --ok-solid: #16A34A; --ok-soft: #F0FDF4;          /* success-700 / 600 / 50 */
  --warn: #B45309; --warn-solid: #D97706; --warn-soft: #FFFBEB;    /* warning-700 / 600 / 50 */
  --bad: #B91C1C; --bad-solid: #DC2626; --bad-soft: #FEF2F2;       /* danger-700 / 600 / 50 */
  --info: var(--primary-700); --info-soft: var(--primary-50);
  --neutral-soft: var(--slate-100);
  --radius: 14px;      /* rounded-card */
  --radius-sm: 10px;   /* rounded-btn: buttons, inputs */
  --radius-xs: 6px;    /* rounded-md: badges */
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);         /* shadow-card */
  --shadow-hover: 0 4px 12px rgba(16, 24, 40, .08), 0 2px 4px rgba(16, 24, 40, .04);  /* shadow-card-hover */
  --shadow-lg: 0 12px 36px rgba(16, 24, 40, .12), 0 4px 12px rgba(16, 24, 40, .06);   /* shadow-dropdown */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .05);
  --sidebar: 256px;    /* w-64 */
  color-scheme: light;
}
/* Production has no dark theme. This one keeps the same sidebar and
   accents on dark slate surfaces for people whose system is set to dark. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B1526; --surface: #111C2E; --surface-2: #16233A; --ink: #F1F5F9; --text: #E2E8F0; --ink-2: #CBD5E1; --muted: #94A3B8;
    --line: #22324A; --line-row: #1B2A40; --line-strong: #33465F; --brand: #3B82F6; --brand-hover: #2563EB; --brand-soft: #14284A; --focus: #60A5FA;
    --ok: #4ADE80; --ok-solid: #16A34A; --ok-soft: #12301F; --warn: #FBBF24; --warn-solid: #D97706; --warn-soft: #33260F; --bad: #F87171; --bad-solid: #DC2626; --bad-soft: #3A1719;
    --info: #93C5FD; --info-soft: #14284A; --neutral-soft: #1B2A40;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 1px 3px rgba(0, 0, 0, .25); --shadow-hover: 0 4px 12px rgba(0, 0, 0, .35); --shadow-lg: 0 12px 36px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { font-feature-settings: "cv02", "cv03", "cv04", "cv11"; scroll-behavior: smooth; }
body { font: 14px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
::selection { background: var(--primary-100); color: #1E3A8A; }
a { color: var(--brand); }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { line-height: 1.3; margin: 0; color: var(--ink); letter-spacing: -.025em; }
h1 { font-size: 24px; font-weight: 700; }            /* page titles: text-2xl font-bold tracking-tight */
h2 { font-size: 18px; font-weight: 600; }            /* card titles: text-lg font-semibold */
h3 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .92em; }
/* Keyboard focus: production's ring (primary-500, 2 px, offset 2 px), at full
   strength so it stays visible on every surface (WCAG non-text contrast). */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--mono); }
.right { text-align: right; }
.grow { flex: 1; }
.icon { width: 18px; height: 18px; flex: none; }
.divider { border-top: 1px solid var(--line); margin: 6px 0; }
button, a, [role="button"] { transition: background-color .2s ease-out, color .2s ease-out, border-color .2s ease-out, box-shadow .2s ease-out; }

/* ------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
/* SideNav: bg-gradient-to-b from-brand-950 to-brand-900, shadow-sidebar */
.sidebar { background: linear-gradient(to bottom, var(--brand-950), var(--brand-900)); color: #fff; box-shadow: 4px 0 24px rgba(0, 0, 0, .15);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 30; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid rgba(255, 255, 255, .1); color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 12px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px;
  background: linear-gradient(to bottom right, var(--primary-400), var(--primary-600)); box-shadow: 0 10px 15px -3px rgba(59, 130, 246, .25), 0 4px 6px -4px rgba(59, 130, 246, .25); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -.025em; line-height: 1.35; }
.brand-text small { font-size: 11px; color: var(--slate-400); letter-spacing: .025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { display: block; height: auto; max-width: 100%; }
.login-card .brand-logo { width: 200px; }
.nav { flex: 1; padding: 12px; overflow-y: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-group { margin-bottom: 4px; }
.nav-section { padding: 16px 12px 6px; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--slate-500); }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; margin: 2px 4px; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--slate-400); text-decoration: none; transition: all .15s; }
.nav a svg { width: 18px; height: 18px; flex: none; stroke-width: 1.75; color: var(--slate-500); transition: color .15s; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: var(--slate-200); }
.nav a:hover svg { color: var(--slate-300); }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: #fff; }
.nav a[aria-current="page"] svg { color: var(--primary-400); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 16px; background: var(--primary-400); border-radius: 0 999px 999px 0; }
.nav a:focus-visible { outline-color: var(--primary-400); outline-offset: 0; }
.nav-label { min-width: 0; overflow-wrap: anywhere; }
.nav .count { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #EF4444; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.sidebar-foot { padding: 16px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar-foot .me { display: flex; align-items: center; gap: 12px; }
.sidebar-foot .avatar { width: 36px; height: 36px; font-size: 14px; font-weight: 600; box-shadow: 0 0 0 2px rgba(96, 165, 250, .2); background: linear-gradient(to bottom right, var(--primary-400), var(--primary-600)); color: #fff; }
.me-text { min-width: 0; display: flex; flex-direction: column; }
.me-text strong { font-size: 14px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text span { font-size: 11px; color: var(--slate-400); }
.env-note { margin-top: 10px; font-size: 11px; line-height: 1.45; color: var(--slate-400); }
.main { min-width: 0; display: flex; flex-direction: column; }
/* TopNav: sticky, bg-white/80 backdrop-blur-xl, border-b slate-200/60, px-6 py-3.5 */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 24px; min-height: 64px;
  background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border-bottom: 1px solid color-mix(in srgb, var(--slate-200) 60%, transparent); }
@media (prefers-color-scheme: dark) { .topbar { border-bottom-color: var(--line); } }
.topbar-title { font-size: 18px; font-weight: 600; color: var(--ink); letter-spacing: -.025em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar-left { flex: 1; min-width: 0; }
.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.topbar .topbar-right { gap: 6px; flex-wrap: nowrap; }
.topbar .menu-btn { display: none; }
.icon-btn { display: inline-grid; place-items: center; position: relative; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; text-decoration: none; }
.icon-btn:hover { background: var(--slate-100); color: var(--muted); }
.icon-btn:active { background: var(--slate-200); }
.icon-btn .icon { width: 20px; height: 20px; }
@media (prefers-color-scheme: dark) { .icon-btn:hover { background: var(--surface-2); } .icon-btn:active { background: var(--line); } }
.user-chip { position: relative; margin-left: 4px; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font: inherit; color: var(--ink-2); }
.user-btn:hover { background: var(--slate-100); }
@media (prefers-color-scheme: dark) { .user-btn:hover { background: var(--surface-2); } }
.user-btn .avatar { background: linear-gradient(to bottom right, var(--primary-500), var(--primary-700)); color: #fff; font-weight: 500; font-size: 14px; }
.user-name { font-size: 14px; font-weight: 500; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-btn .chev { width: 14px; height: 14px; color: var(--slate-400); }
.page { padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; font-size: 14px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(to bottom right, var(--primary-400), var(--primary-600)); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }

/* --------------------------------------------------------- layout */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 6px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }

/* ---------------------------------------------------------- cards */
/* .card: bg-white rounded-card shadow-card border slate-200/80 */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .2s; }
/* .card-head: px-5 pt-4 pb-2, 15 px semibold slate-700 */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px 8px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 15px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.card-body { padding: 12px 20px 20px; }
.card-head + .card-body { padding-top: 8px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line); }
.card + .card { margin-top: 16px; }
.grid > .card + .card { margin-top: 0; }
.card.accent { border-top: 2px solid var(--primary-500); }
.card.alert { border: 2px solid var(--primary-500); box-shadow: 0 0 0 4px var(--brand-soft), var(--shadow); }

/* KPIStat: card p-4; label 14 px medium slate-500; value 24 px semibold slate-900 */
.stat { padding: 16px; }
.stat .label { font-size: 14px; color: var(--muted); font-weight: 500; }
.stat .value { font-size: 24px; font-weight: 600; color: var(--ink); letter-spacing: -.025em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.kv { display: grid; grid-template-columns: minmax(120px, 34%) 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--text); }

/* -------------------------------------------------------- buttons */
/* .btn = btn-secondary; .primary / .danger / .ghost as in production;
   px-5 py-2.5, rounded-btn, text-sm font-medium, shadow-sm. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 500; font-size: 14px; line-height: 20px; padding: 9px 20px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); cursor: pointer; text-decoration: none; min-height: 40px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover:not(:disabled) { background: var(--surface-2); color: var(--ink-2); }
.btn:active:not(:disabled) { background: var(--slate-100); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icon { width: 16px; height: 16px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, .1), 0 2px 4px -2px rgba(0, 0, 0, .1); }
.btn.primary:active:not(:disabled) { background: var(--primary-800); }
.btn.success { background: var(--ok-solid); border-color: var(--ok-solid); color: #fff; }
.btn.success:hover:not(:disabled) { background: #15803D; border-color: #15803D; color: #fff; }
.btn.danger { background: var(--bad-solid); border-color: var(--bad-solid); color: #fff; }
.btn.danger:hover:not(:disabled) { background: #B91C1C; border-color: #B91C1C; color: #fff; }
.btn.danger:active:not(:disabled) { background: #991B1B; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--slate-600); box-shadow: none; }
.btn.ghost:hover:not(:disabled) { background: var(--slate-100); color: var(--slate-700); }
@media (prefers-color-scheme: dark) { .btn.ghost { color: var(--ink-2); } .btn.ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--ink); } }
/* .btn-sm: px-3.5 py-1.5 text-xs */
.btn.sm { min-height: 30px; padding: 5px 14px; font-size: 12px; line-height: 18px; }
.btn.lg { min-height: 48px; padding: 12px 24px; font-size: 15px; }
.btn.icon-only { padding: 0; width: 40px; }
.btn.sm.icon-only { width: 30px; }
.btn.round { border-radius: 999px; }
.btn[aria-pressed="true"] { background: var(--bad-soft); border-color: var(--bad-solid); color: var(--bad); }
.btn .spinner { width: 14px; height: 14px; }

/* ---------------------------------------------------------- forms */
.form { display: grid; gap: 16px; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
/* .input-label: 14 px medium slate-700 */
.field > label, .label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.field .hint { font-size: 13px; color: var(--muted); }
.field .error { font-size: 13px; color: var(--bad); font-weight: 500; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad-solid); box-shadow: 0 0 0 2px rgba(239, 68, 68, .2); }
.req::after { content: " *"; color: var(--bad-solid); }
/* .input / .select: px-4 py-2.5 rounded-btn text-sm, slate-300 border, hover slate-400,
   focus primary-500 border with a 2 px primary ring at 20 % */
input, select, textarea { font: inherit; font-size: 14px; line-height: 20px; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 9px 16px; min-height: 40px; width: 100%; min-width: 0; transition: border-color .2s ease-out, box-shadow .2s ease-out; }
input:hover:not(:disabled), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: var(--slate-400); }
input::placeholder, textarea::placeholder { color: var(--slate-400); }
select { appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select[multiple], select[size]:not([size="1"]) { background-image: none; padding-right: 16px; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 2px rgba(59, 130, 246, .2); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, .35); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--brand); box-shadow: none; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--text); }
fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; margin: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 500; padding: 0 6px; color: var(--ink-2); }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.segmented button { font: inherit; font-weight: 500; font-size: 14px; border: 0; background: var(--surface); color: var(--ink-2); padding: 9px 16px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.segmented button + button { border-left: 1px solid var(--line-strong); }
.segmented button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--surface-2); }
.segmented button[aria-pressed="true"] { background: var(--brand); color: #fff; }
.segmented button:disabled { opacity: .45; cursor: not-allowed; }

/* ----------------------------------------------------- badges etc */
/* .badge: rounded-md px-2.5 py-0.5 text-xs font-medium; green/yellow/red/blue/gray */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: var(--radius-xs); font-size: 12px; font-weight: 500; line-height: 16px; background: var(--neutral-soft); color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--primary-700); }
@media (prefers-color-scheme: dark) { .badge.brand { color: var(--info); } }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; flex: none; }
.alert-box { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; border: 1px solid transparent; }
.alert-box .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-box.info { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 15%, transparent); }
.alert-box.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 15%, transparent); }
.alert-box.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 18%, transparent); }
.alert-box.bad { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 15%, transparent); }
.alert-box .grow > * + * { margin-top: 4px; }
.alert-box .btn { margin-left: auto; }
.alert-box .actions .btn { margin-left: 0; }
.warn-text { color: var(--warn); }
.access-log > div { padding: 8px 0; border-top: 1px solid var(--line); }

/* --------------------------------------------------------- tables */
/* production tables: header 11 px semibold uppercase tracking-wider slate-500,
   cells px-6 py-3.5, rows divided by slate-100, hover primary-50/40 */
.table-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.table-tools input[type=search] { max-width: 280px; }
.table-tools select { width: auto; }
.table-wrap { overflow-x: auto; position: relative; } /* keeps .sr-only cells inside the scroll box */
/* Wide tables keep short values on one line and scroll sideways instead of
   squeezing names into narrow columns; long text still wraps (360 px). */
@media (min-width: 768px) {
  .table-wrap > table { width: max-content; min-width: 100%; }
  .table-wrap > table td { max-width: 360px; }
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 14px 24px 14px 0; border-bottom: 1px solid var(--line-row); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 24px; }
th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; border-bottom-color: var(--slate-200); }
@media (prefers-color-scheme: dark) { th { border-bottom-color: var(--line); } }
td { color: var(--ink-2); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: color-mix(in srgb, var(--primary-50) 40%, transparent); }
@media (prefers-color-scheme: dark) { tbody tr:hover { background: var(--surface-2); } }
tbody tr.clickable { cursor: pointer; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; border-top: 1px solid var(--line-row); }
/* EmptyState: centred, 14 px semibold title, 14 px slate-500 description */
.state-empty, .state-loading, .state-error { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.state-empty strong, .state-error strong { display: block; color: var(--ink); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.state-error { color: var(--bad); }
.spinner { width: 20px; height: 20px; border: 2.5px solid var(--slate-200); border-top-color: var(--primary-600); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--slate-200) 25%, var(--slate-100) 50%, var(--slate-200) 75%); background-size: 200% 100%; animation: shimmer 1.5s ease-in-out infinite; border-radius: 8px; height: 16px; }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

/* ------------------------------------------------------------ tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--slate-200); margin-bottom: 16px; overflow-x: auto; }
@media (prefers-color-scheme: dark) { .tabs { border-bottom-color: var(--line); } }
.tabs button { font: inherit; font-weight: 500; font-size: 14px; background: none; border: 0; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink-2); }
.tabs button[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

/* ----------------------------------------------- modal / drawer */
dialog { border: 1px solid var(--line); padding: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); box-shadow: 0 8px 24px rgba(16, 24, 40, .10), 0 4px 8px rgba(16, 24, 40, .04);
  width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); }
dialog[open] { animation: scale-in .2s ease-out; }
@keyframes scale-in { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }
dialog.wide { width: min(980px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(15, 23, 42, .5); }
dialog .dlg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 1; }
dialog .dlg-head h2 { font-size: 18px; }
dialog .dlg-body { padding: 20px; }
dialog .dlg-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); }

/* ---------------------------------------------------------- toasts */
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--slate-900); color: #fff; padding: 12px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: slide-in .25s ease-out; }
.toast.bad { background: var(--bad-solid); color: #fff; }
.toast.ok { background: var(--ok-solid); color: #fff; }
@keyframes slide-in { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ------------------------------------------- dropdowns, notifications */
.bell { position: relative; }
.bell .count { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; border-radius: 999px; background: #EF4444; color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
/* .dropdown-panel: rounded-xl, slate-200/80 border, shadow-dropdown, slide-down */
.popover { position: absolute; right: 0; top: calc(100% + 8px); width: min(320px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; overflow: hidden; animation: slide-down .2s ease-out; }
@keyframes slide-down { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.popover .card-head { padding: 12px 16px; border-bottom: 1px solid var(--line-row); }
.popover .card-head h2 { font-size: 14px; color: var(--ink); }
.popover.menu { width: 220px; }
.menu-head { padding: 12px 16px; border-bottom: 1px solid var(--line-row); display: flex; flex-direction: column; min-width: 0; }
.menu-head strong { font-size: 14px; font-weight: 600; color: var(--ink); }
.menu-head span { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-items { padding: 4px 0; }
.menu-items a, .menu-items button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 16px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--ink-2); text-decoration: none; cursor: pointer; text-align: left; }
.menu-items .icon { width: 16px; height: 16px; color: var(--slate-400); }
.menu-items a:hover, .menu-items button:hover { background: var(--surface-2); color: var(--ink-2); }
.menu-items .danger, .menu-items .danger .icon { color: var(--bad-solid); }
.menu-items .danger:hover { background: var(--bad-soft); color: var(--bad-solid); }
.notif-list { max-height: 420px; overflow-y: auto; }
.notif { display: block; padding: 12px 16px; border-bottom: 1px solid var(--line-row); color: var(--ink-2); text-decoration: none; font-size: 14px; }
.notif:hover { background: var(--surface-2); color: var(--ink-2); }
.notif.unread { background: color-mix(in srgb, var(--primary-50) 50%, transparent); }
@media (prefers-color-scheme: dark) { .notif.unread { background: var(--brand-soft); } }
.notif .t { font-weight: 500; color: var(--slate-600); }
.notif.unread .t { font-weight: 600; color: var(--ink); }
@media (prefers-color-scheme: dark) { .notif .t { color: var(--ink-2); } }
.notif .b { color: var(--muted); font-size: 12px; margin-top: 2px; }
.notif .w { color: var(--slate-400); font-size: 11px; margin-top: 4px; }

/* ------------------------------------------------------- call stage */
.call { overflow: hidden; }
.stage { position: relative; background: #0b1118; aspect-ratio: 16 / 9; display: grid; place-items: center; color: #dfe7f1; }
.stage.audio-only { aspect-ratio: auto; min-height: 220px; padding: 28px 16px; }
.stage video.remote { width: 100%; height: 100%; object-fit: contain; background: #000; }
.stage .local { position: absolute; right: 14px; bottom: 14px; width: 24%; min-width: 120px; max-width: 260px; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 2px solid rgba(255, 255, 255, .7); background: #222; box-shadow: 0 6px 20px rgba(0, 0, 0, .4); }
.stage .local video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.stage .local .off { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; background: #222; color: #bbb; }
.stage .overlay { position: absolute; left: 14px; top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.stage .overlay .badge { background: rgba(0, 0, 0, .55); color: #fff; backdrop-filter: blur(4px); }
.stage .center-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; pointer-events: none; }
.stage .center-msg .big { font-size: 18px; font-weight: 650; }
.stage .peer { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.stage .peer .avatar { width: 72px; height: 72px; font-size: 26px; background: #1d3540; color: #8fe3ea; }
.call-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; border-top: 1px solid var(--line); }
.call-bar .timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 18px; }
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; min-width: 80px; }
.meter > div { height: 100%; width: 0; background: var(--ok); transition: width .08s linear; }
.preview { position: relative; background: #0b1118; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; display: grid; place-items: center; color: #bbb; }
.preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.diag { font: 12px/1.45 var(--mono); color: var(--muted); white-space: pre-wrap; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px; margin: 0; overflow-x: auto; }
details > summary { cursor: pointer; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ------------------------------------------------------------ offer */
.offer-card { border: 2px solid var(--brand); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--brand-soft); } }
.countdown { font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 800; color: var(--brand); }
.status-light { width: 12px; height: 12px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 4px var(--neutral-soft); background: var(--muted); }
.status-light.available { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.status-light.busy, .status-light.offered { background: var(--warn); box-shadow: 0 0 0 4px var(--warn-soft); }

/* ------------------------------------------------------------ list */
.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 18px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.list > li:last-child { border-bottom: 0; }
.when { min-width: 64px; text-align: center; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); padding: 6px 4px; line-height: 1.15; flex: none; }
.when .d { font-size: 18px; font-weight: 800; }
.when .m { font-size: 11px; text-transform: uppercase; font-weight: 700; }

/* --------------------------------------------------------- login */
/* Production Login.jsx: slate-50 page; brand panel 520 px (580 px from
   1280 px) shown from 1024 px; form column max 420 px; logo 160 px tall. */
.auth { min-height: 100vh; display: flex; align-items: flex-start; background: var(--slate-50); }
@media (prefers-color-scheme: dark) { .auth { background: var(--bg); } }
.auth-hero { display: none; position: sticky; top: 0; height: 100vh; overflow: hidden; flex: none; width: 520px; color: #fff; padding: 32px 40px 40px;
  background: radial-gradient(120% 80% at 100% 0%, rgba(59, 130, 246, .35), transparent 60%), linear-gradient(to top, var(--brand-950), var(--brand-900)); flex-direction: column; justify-content: space-between; }
.auth-hero { isolation: isolate; }
.auth-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -1; }
/* production overlays: bottom-up brand-950 → 60 % → transparent, and brand-950/40 from the left */
.auth-hero::before, .auth-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.auth-hero::before { background: linear-gradient(to top, var(--brand-950), rgba(8, 29, 54, .6), transparent); }
.auth-hero::after { background: linear-gradient(to right, rgba(8, 29, 54, .4), transparent); }
.auth-hero-brand, .auth-hero-copy { position: relative; z-index: 1; }
.auth-hero-brand { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.auth-hero-brand strong { font-weight: 600; color: rgba(255, 255, 255, .9); letter-spacing: -.025em; }
.auth-hero-brand span span { color: rgba(255, 255, 255, .5); }
.auth-hero-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .2); backdrop-filter: blur(12px); }
.auth-hero-title { font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -.025em; margin-bottom: 12px; }
.auth-hero-text { font-size: 13px; line-height: 1.6; color: rgba(203, 213, 225, .9); max-width: 300px; margin-bottom: 24px; }
.auth-hero-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .1); font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .8); }
.auth-main { flex: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; overflow: hidden; }
.auth-main::before { content: ""; position: absolute; top: 0; right: 0; width: 384px; height: 384px; border-radius: 50%; background: var(--primary-50); filter: blur(64px); opacity: .4; transform: translate(50%, -50%); pointer-events: none; }
@media (prefers-color-scheme: dark) { .auth-main::before { display: none; } }
.auth-panel { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.auth-panel > .form { gap: 20px; }
.auth-logo { display: flex; justify-content: center; }
.auth-logo img { height: 80px; width: auto; }
.auth-head { text-align: center; margin-bottom: 8px; }
.auth-head h1 { margin-bottom: 4px; }
.auth-head p { color: var(--muted); font-size: 14px; }
@media (min-width: 1024px) { .auth-hero { display: flex; } .auth-main { padding: 40px; } }
@media (min-width: 1280px) { .auth-hero { width: 580px; } }
@media (max-width: 520px) { .auth-logo img { height: 64px; } }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: min(440px, 100%); }
.demo-grid { display: grid; gap: 6px; }
.demo-grid button { text-align: left; justify-content: flex-start; font-weight: 500; }
.demo-grid button span { margin-left: auto; }

/* ------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Below 768 px (Tailwind md) the sidebar becomes a drawer opened from the
   top bar; production hides it there with no replacement. */
@media (max-width: 767px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(256px, 85vw); z-index: 60; transform: translateX(-100%); transition: transform .2s ease-out; visibility: hidden; }
  .shell.nav-open .sidebar { transform: none; visibility: visible; }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 55; }
  .topbar { padding: 10px 16px; gap: 8px; min-height: 56px; }
  .topbar .menu-btn { display: inline-grid; margin-left: -6px; }
  .topbar-title { font-size: 16px; }
  .topbar-left:empty { display: none; }
  .topbar [data-shortcut] { display: none; }  /* in the menu; no room on phones */
  .user-btn { padding: 4px; }
}
@media (max-width: 860px) {
  .page { padding: 16px; }
  .cols-2, .cols-3, .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dt { margin-top: 6px; }
  h1 { font-size: 22px; }
  .table-tools input[type=search] { max-width: none; }
  .stage .local { width: 32%; min-width: 96px; right: 10px; bottom: 10px; }
  .hide-sm { display: none; }
}
@media (max-width: 520px) {
  .cols-4 { grid-template-columns: 1fr 1fr; }
  .stat .value { font-size: 21px; }
  th, td { padding: 10px 12px 10px 0; }
  th:first-child, td:first-child { padding-left: 14px; }
  .card-head, .card-body { padding-left: 14px; padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.stage .big { font-size: 18px; font-weight: 650; }
.grid > * { min-width: 0; }
#page:focus { outline: none; }
.compact th, .compact td { padding: 8px 10px; font-size: 13px; }
.compact .badge { font-size: 11px; padding: 1px 7px; }

/* ------------------------------------------------------------ charts */
/* production Charts.jsx: series #3B82F6 / line #2563EB, dashed #E2E8F0 grid, status green / blue / amber / slate */
:root { --series-1: #3B82F6; --series-line: #2563EB; --series-1-soft: rgba(59, 130, 246, .12); --status-available: #22C55E; --status-busy: #3B82F6; --status-break: #F59E0B; --status-offline: #94A3B8; }
@media (prefers-color-scheme: dark) { :root { --series-1: #3987e5; --series-1-soft: rgba(57, 135, 229, .18); --status-available: #4cc777; --status-busy: #3987e5; --status-break: #e2a33a; --status-offline: #6b7686; } }
.viz { position: relative; }
.viz svg { width: 100%; display: block; overflow: visible; }
.viz-grid { stroke: var(--slate-200); stroke-width: 1; stroke-dasharray: 3 3; }
@media (prefers-color-scheme: dark) { .viz-grid { stroke: var(--line); } }
.viz-axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.viz-center { fill: var(--ink); font-size: 26px; font-weight: 750; font-family: var(--font); }
.viz-line { fill: none; stroke: var(--series-line, var(--series-1)); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.viz-area { fill: var(--series-1-soft); }
.viz-bar { fill: var(--series-1); }
.viz-cross { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.viz-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.viz-hit { fill: transparent; cursor: crosshair; }
.viz-seg { stroke: var(--surface); stroke-width: 2; }
.viz-seg.available { fill: var(--status-available); stroke: var(--status-available); }
.viz-seg.busy { fill: var(--status-busy); stroke: var(--status-busy); }
.viz-seg.break { fill: var(--status-break); stroke: var(--status-break); }
.viz-seg.offline { fill: var(--status-offline); stroke: var(--status-offline); }
path.viz-seg { stroke: var(--surface) !important; }
.viz-tip { position: absolute; display: none; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 12.5px; padding: 6px 9px; border-radius: 6px; white-space: nowrap; z-index: 5; box-shadow: var(--shadow); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.legend .sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.legend .sw.available { background: var(--status-available); } .legend .sw.busy { background: var(--status-busy); }
.legend .sw.break { background: var(--status-break); } .legend .sw.offline { background: var(--status-offline); }
.legend .n { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 650; }
.legend .pct { color: var(--muted); font-size: 12px; min-width: 40px; text-align: right; }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.rank-row { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.rank-value { font-variant-numeric: tabular-nums; font-weight: 650; }
.rank-track { height: 8px; border-radius: 4px; background: var(--neutral-soft); margin-top: 4px; overflow: hidden; }
.rank-bar { height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.mini-stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.mini-stats .v { font-family: var(--mono); font-size: 18px; font-weight: 700; }
.mini-stats .k { font-size: 12px; color: var(--muted); }
.queue-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.queue-tiles > div { border-radius: var(--radius-sm); padding: 14px; text-align: center; background: var(--surface-2); border: 1px solid var(--line); }
.queue-tiles .v { font-family: var(--mono); font-size: 22px; font-weight: 750; }
.queue-tiles .k { font-size: 12.5px; color: var(--muted); }
.queue-tiles .hold { background: var(--info-soft); } .queue-tiles .offer { background: var(--warn-soft); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; padding: 2px 12px; border-radius: 999px; background: var(--brand-100); color: var(--ink-2); }  /* production .chip */
@media (prefers-color-scheme: dark) { .chip { background: var(--neutral-soft); } }
/* KPIStat icon tile: 36 px rounded-xl, primary-50 to primary-100, primary-600 icon at stroke 1.75 */
.stat .ico { float: right; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(to bottom right, var(--primary-50), var(--primary-100)); color: var(--primary-600); transition: transform .2s; }
.stat:hover .ico { transform: scale(1.1); }
.stat .ico .icon { stroke-width: 1.75; }
@media (prefers-color-scheme: dark) { .stat .ico { background: var(--brand-soft); color: var(--primary-400); } }
.topsearch { position: relative; }
.topsearch .popover { width: min(320px, calc(100vw - 24px)); }
.search-box { position: relative; padding: 12px; }
.search-box input { padding-left: 40px; }
.search-box > .icon { position: absolute; left: 24px; top: 24px; width: 16px; height: 16px; color: var(--slate-400); pointer-events: none; }
.search-hint { padding: 0 16px 12px; font-size: 13px; color: var(--muted); }
.search-results .notif:last-child { border-bottom: 0; }
.stars { color: #c98500; letter-spacing: 1px; white-space: nowrap; }
.star-input { display: inline-flex; gap: 2px; }
.star-input button { font-size: 26px; line-height: 1; background: none; border: 0; cursor: pointer; color: var(--line-strong); padding: 2px; }
.star-input button[aria-checked="true"] { color: #c98500; }
@media (max-width: 860px) { .queue-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.viz-ring { fill: none; }
.viz-ring.available { stroke: var(--status-available); } .viz-ring.busy { stroke: var(--status-busy); }
.viz-ring.break { stroke: var(--status-break); } .viz-ring.offline { stroke: var(--status-offline); }

/* ---- live call control (monitoring, hold, guests, callbacks) ---- */
.call-people { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 16px 10px; }
.call-people:empty { display: none; }
.call-people .chip { font-family: inherit; }
.chip-x { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0; display: inline-grid; place-items: center; }
.chip-x .icon { width: 14px; height: 14px; }
.stage .center-msg .btn { pointer-events: auto; }
.stage .overlay .badge .icon { width: 14px; height: 14px; }
.ewt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ewt > div { background: var(--neutral-soft); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.ewt strong { font-size: 18px; }
.call.monitor .card-head .icon { color: var(--brand); }
.call.monitor .segmented button { padding: 6px 12px; font-size: 13px; }
.seg-radio { position: relative; }
.seg-radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg-radio span { display: inline-block; min-width: 40px; text-align: center; padding: 7px 0; font-weight: 600; border-left: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); }
.seg-radio:first-child span { border-left: 0; }
.seg-radio input:checked + span { background: var(--brand); color: var(--brand-ink); }
.seg-radio input:focus-visible + span { outline: 2px solid var(--focus, var(--brand)); outline-offset: -2px; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.guest-card { width: min(720px, 100%); }
.guest-card .call { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }

/* ---- workforce: roster week board ---- */
.roster-summary { padding: 10px 18px; border-bottom: 1px solid var(--line); }
.roster { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; }
.roster-day { border-right: 1px solid var(--line); padding: 10px 8px 14px; display: flex; flex-direction: column; gap: 8px; min-height: 160px; min-width: 0; }
.roster-day:last-child { border-right: 0; }
.roster-day.today { background: var(--brand-soft, var(--neutral-soft)); }
.roster-date { display: flex; align-items: baseline; gap: 6px; color: var(--muted); font-size: 13px; }
.roster-date strong { color: var(--ink); font-size: 18px; }
.roster-empty { padding: 6px 2px; }
.shift-card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; border-radius: var(--radius-sm); background: var(--surface);
  border: 1px solid var(--line-strong); border-left-width: 4px; cursor: pointer; min-width: 0; overflow-wrap: anywhere; }
.shift-card:hover { box-shadow: var(--shadow, 0 2px 8px rgba(0,0,0,.08)); }
.shift-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.shift-card .badge { font-size: 11px; padding: 1px 6px; }
.shift-card.cov-full { border-left-color: var(--ok); }
.shift-card.cov-open { border-left-color: var(--info); }
.shift-card.cov-at_risk { border-left-color: var(--warn); }
.shift-card.cov-unstaffed { border-left-color: var(--bad); }
.shift-card.cov-draft { border-style: dashed; border-left-style: solid; border-left-color: var(--muted); }
.shift-card.cov-cancelled, .shift-card.cov-closed { opacity: .55; border-left-color: var(--muted); }
.strong { font-weight: 650; }
@media (max-width: 900px) {
  .roster { grid-template-columns: minmax(0, 1fr); }
  .roster-day { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; }
  .roster-day:last-child { border-bottom: 0; }
  .table-tools [data-legend] { display: none; }
}
/* interpreter shift lists */
.shift-row { display: flex; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.shift-row:last-child { border-bottom: 0; }
.shift-row .when { min-width: 64px; }
.shift-row .grow { min-width: 180px; }
.refusal { font-size: 12px; color: var(--muted); }

/* ---- messages and tickets ---- */
.chat { display: flex; flex-direction: column; min-height: 420px; }
.chat-body { flex: 1; min-height: 0; }
.thread { max-height: min(62vh, 640px); overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.bubble-row { display: flex; }
.bubble-row.mine { justify-content: flex-end; }
.bubble { max-width: min(560px, 85%); background: var(--neutral-soft); border-radius: 14px 14px 14px 4px; padding: 8px 12px; overflow-wrap: anywhere; }
.bubble.ops { background: var(--brand-soft, var(--info-soft)); }
.bubble-row.mine .bubble { background: var(--brand); color: var(--brand-ink); border-radius: 14px 14px 4px 14px; }
.bubble-row.mine .bubble .bubble-meta, .bubble-row.mine .bubble .xs { color: inherit; opacity: .85; }
.bubble-meta { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.bubble-body { white-space: pre-wrap; }
.linkish { all: unset; cursor: pointer; text-decoration: underline; }
.composer { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; flex-direction: column; gap: 8px; }
.composer textarea { resize: vertical; min-height: 54px; }
.att { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px 8px; border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); border: 1px solid var(--line); max-width: 100%; }
.att img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--neutral-soft); }
.att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.inbox-layout { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 16px; align-items: start; }
.inbox-list { list-style: none; margin: 0; padding: 0; max-height: 70vh; overflow-y: auto; }
.inbox-list a { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.inbox-list a:hover, .inbox-list a.active { background: var(--neutral-soft); }
.inbox-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; color: var(--muted); }
.count { background: var(--bad); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.comment { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.comment.ops { background: var(--brand-soft, var(--neutral-soft)); }
.comment.internal { background: var(--warn-soft); border-color: var(--warn); border-style: dashed; }
@media (max-width: 900px) {
  .inbox-layout { grid-template-columns: minmax(0, 1fr); }
  .inbox-layout.has-thread .inbox { display: none; }
  .inbox-layout:not(.has-thread) .chat { display: none; }
}

/* ---- interpreter scripts ---- */
.scripts-panel { padding: 0 16px 12px; border-top: 1px solid var(--line); }
.scripts-panel > summary { padding: 10px 0; font-weight: 650; cursor: pointer; }
.scripts-panel [data-script-list] { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow-y: auto; }
.script { border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: var(--radius-sm); padding: 10px 12px; }
.script.emergency { border-left-color: var(--bad); background: var(--bad-soft); }
.script.closing { border-left-color: var(--info); }
.script.done { opacity: .75; }
.script-text { margin: 6px 0 0; white-space: pre-wrap; line-height: 1.5; }
.script-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.script-preview { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; max-width: 520px; }

/* ---- security ---- */
.secret { font-size: 18px; letter-spacing: .08em; background: var(--neutral-soft); padding: 8px 12px; border-radius: var(--radius-sm); display: inline-block; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-size: 16px; }
.codes span { background: var(--neutral-soft); padding: 6px 10px; border-radius: 6px; text-align: center; }
dialog.forced { max-width: 480px; }

/* ------------------------------------------- incoming-call alert, sound */
.incoming-alert { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 90; width: min(560px, calc(100vw - 24px));
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); background: var(--surface); color: var(--ink);
  border: 2px solid var(--brand); box-shadow: var(--shadow-lg); }
.incoming-alert .ring-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); flex: none; animation: ring-pulse 1.2s ease-in-out infinite; }
.incoming-alert .xs { color: var(--warn); margin-top: 2px; }
@keyframes ring-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(42, 120, 214, .45); } 50% { box-shadow: 0 0 0 8px rgba(42, 120, 214, 0); } }
@media (prefers-reduced-motion: reduce) { .incoming-alert .ring-icon { animation: none; } }
.btn.attn { color: var(--warn); box-shadow: inset 0 0 0 2px var(--warn); }

/* Phone simulator keypad */
.keypad { display: grid; grid-template-columns: repeat(3, 64px); gap: 8px; }
.keypad .btn { justify-content: center; font-size: 18px; font-weight: 700; height: 48px; }
#msg:empty { display: none; }

/* Audit / activity log date range: two date boxes that share one line */
.audit-range { gap: 6px; flex-wrap: nowrap; min-width: 0; }
.audit-range input[type=date] { min-width: 0; width: 150px; }
@media (max-width: 767px) { .audit-range { flex: 1 1 100%; } .audit-range input[type=date] { flex: 1 1 0; width: auto; } }

/* ------------------------------------------------ screen share and effects */
.field .hint.error { color: var(--bad); }
/* While a screen is shared the composed picture carries it full width; the
   self view shrinks so it never covers shared text. */
.stage.presenting .local { width: 16%; min-width: 96px; max-width: 180px; right: 10px; bottom: 10px; opacity: .92; }
.stage.presenting video.remote { object-fit: contain; }
.call-bar .btn.round.danger[data-share] { color: #fff; }
.fx { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.fx-preview { position: relative; aspect-ratio: 16 / 9; background: #0b1118; border-radius: 10px; overflow: hidden; }
.fx-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.fx-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .45); font-size: 13px; gap: 8px; }
.fx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 6px; }
.fx-tile { display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); color: inherit; font: inherit; font-size: 12px; cursor: pointer; text-align: center; }
.fx-tile:hover { border-color: var(--primary-600, #2563eb); }
.fx-tile[aria-pressed="true"] { border-color: var(--primary-600, #2563eb); box-shadow: 0 0 0 2px var(--primary-600, #2563eb) inset; }
.fx-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; background: #e5e7eb center / cover no-repeat; }
.fx-thumb.none { background: linear-gradient(135deg, #e5e7eb 0 45%, #cbd5e1 45% 55%, #e5e7eb 55%); }
.fx-thumb.blur { background: radial-gradient(circle at 50% 60%, #64748b 0 22%, transparent 23%), linear-gradient(135deg, #cbd5e1, #94a3b8); filter: blur(1.5px); }
.fx-thumb.blur.strong { filter: blur(3px); }
.fx-thumb.custom { background-color: #f1f5f9; background-image: linear-gradient(45deg, transparent 45%, #94a3b8 45% 55%, transparent 55%); }
@media (max-width: 700px) { .fx { grid-template-columns: 1fr; } }
