/* cx-voice admin console: app shell (sidebar + topbar + content) on top of /styles.css tokens. */
:root {
  --sidebar-w: 248px;
  --topbar-h: 56px;
  --sidebar-bg: #fbfbfc;
  --hover: rgba(16, 24, 40, .05);
  --active-bg: rgba(47, 111, 237, .10);
  --row-hover: rgba(16, 24, 40, .025);
  --focus: 0 0 0 3px rgba(47, 111, 237, .25);
  --radius-sm: 8px;
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --sidebar-bg: #12151b; --hover: rgba(255,255,255,.05); --active-bg: rgba(91,140,255,.16); --row-hover: rgba(255,255,255,.025); --shadow-lg: 0 12px 32px rgba(0,0,0,.5); }
}
:root[data-theme="dark"] {
  --bg: #0f1115; --panel: #171a21; --text: #e7e9ee; --muted: #98a2b3; --border: #2a2f3a;
  --accent: #5b8cff; --ready: #3ccf7f; --ready-bg: #12301f; --paused: #f5b14c; --paused-bg: #33270f;
  --off: #98a2b3; --off-bg: #232833; --danger: #ff6b5e; --danger-bg: #3a1714; --shadow: none; color-scheme: dark;
  --sidebar-bg: #12151b; --hover: rgba(255,255,255,.05); --active-bg: rgba(91,140,255,.16); --row-hover: rgba(255,255,255,.025); --shadow-lg: 0 12px 32px rgba(0,0,0,.5);
}

body.admin { min-height: 100vh; }
.small { font-size: 12px; }
a { color: var(--accent); }

/* ---- brand ---- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -.01em; }
.logo { width: 28px; height: 28px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), #8b5cf6); position: relative; flex: none; }
.logo::after { content: ""; position: absolute; inset: 8px 7px; border: 2px solid #fff; border-top-color: transparent; border-bottom-color: transparent; border-radius: 50%; }

/* ---- sign in ---- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1200px 500px at 10% -10%, var(--active-bg), transparent), var(--bg); }
.auth-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 28px; box-shadow: var(--shadow-lg); gap: 18px; }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card p { margin: 0; }
.key-error { color: var(--danger); background: var(--danger-bg); padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13px; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 14px; padding: 16px 12px; background: var(--sidebar-bg); border-right: 1px solid var(--border); overflow-y: auto; }
.sidebar > .brand { padding: 4px 8px 6px; }
.tenant-box { display: grid; gap: 4px; padding: 0 4px; }
.tenant-box .label, .nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tenant-box select { padding: 7px 9px; }
.tenant-fixed { font-weight: 600; padding: 7px 9px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); }
#nav { display: grid; gap: 14px; }
.nav-group { padding: 0 10px 4px; }
.nav-list { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-weight: 500; }
.nav-item svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--active-bg); color: var(--accent); }
.nav-item.active svg { color: var(--accent); }
.nav-item .badge { margin-left: auto; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--paused-bg); color: var(--paused); }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding: 10px 6px 0; border-top: 1px solid var(--border); }
.sidebar-foot .pill { justify-self: start; white-space: normal; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.crumbs #crumb-page { color: var(--text); font-weight: 600; }
.crumbs .sep { opacity: .5; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: var(--radius-sm); background: transparent; border-color: transparent; }
.icon-btn:hover:not(:disabled) { background: var(--hover); border-color: transparent; }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: none; }
.content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 24px 24px 64px; }

/* ---- page ---- */
.page { display: grid; gap: 16px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.page-head .titles { display: grid; gap: 4px; min-width: 0; }
.page-head h1 { font-size: 22px; letter-spacing: -.015em; }
.page-head p { margin: 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-head .actions label { color: var(--text); }
.page h2 { font-size: 15px; }
.page > .row > h2 { font-size: 16px; }
.page > p.muted { margin: 0; font-size: 13px; }

/* ---- surfaces ---- */
.panel { border-radius: 12px; }
.panel > h2:first-child, .panel > .row:first-child h2 { margin-bottom: 2px; }
.panel.table-wrap, .panel > .table-wrap { padding: 0; }
.panel.table-wrap { overflow: auto; }
.panel.stack > .table-wrap { margin: 0 -16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.card { display: grid; gap: 6px; padding: 16px 18px; }
.card h3 { font-size: 12px; }
.card .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; align-items: start; }
.form-grid .wide { grid-column: 1 / -1; }
.feed { max-height: 280px; overflow: auto; font-size: 12px; font-family: var(--mono); display: grid; gap: 2px; color: var(--muted); }
.hint { font-size: 12px; color: var(--muted); margin: 0; }
.copy { display: flex; gap: 6px; align-items: center; }
.copy code { flex: 1; min-width: 0; overflow-wrap: anywhere; padding: 8px 10px; border: 1px dashed var(--border); border-radius: var(--radius-sm); font-family: var(--mono); font-size: 12px; }
.empty { padding: 32px; text-align: center; color: var(--muted); }

/* ---- tables ---- */
table { font-size: 13.5px; }
th { position: sticky; top: 0; background: var(--panel); text-transform: uppercase; letter-spacing: .04em; font-size: 11px; z-index: 1; }
th, td { padding: 10px 14px; }
tbody tr:hover { background: var(--row-hover); }
tbody tr:last-child td { border-bottom: 0; }
td .row { flex-wrap: nowrap; }
td .muted.mono { font-size: 12px; }

/* ---- controls ---- */
button, input, select, textarea { border-radius: var(--radius-sm); }
button { font-weight: 500; }
button.primary { box-shadow: 0 1px 2px rgba(16,24,40,.12); }
button.primary:hover:not(:disabled) { filter: brightness(1.06); border-color: var(--accent); }
button.ghost { border-color: transparent; }
button.ghost:hover:not(:disabled) { background: var(--hover); border-color: transparent; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: none; box-shadow: var(--focus); border-color: var(--accent); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: auto; }

/* ---- dialog / toast ---- */
dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--panel); color: var(--text); padding: 22px; width: min(680px, calc(100% - 32px)); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgba(10, 12, 16, .45); backdrop-filter: blur(2px); }
dialog h2 { font-size: 17px; }
.toast { left: auto; right: 20px; bottom: 20px; transform: none; border-radius: 10px; box-shadow: var(--shadow-lg); font-weight: 500; }

/* ---- small screens: off-canvas sidebar ---- */
.scrim { display: none; }
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 20; left: 0; top: 0; bottom: 0; width: min(var(--sidebar-w), 86vw); transform: translateX(-100%); transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  .shell.nav-open .sidebar { transform: none; }
  .shell.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 15; background: rgba(10,12,16,.4); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 16px; }
  .content { padding: 16px 16px 48px; }
}

/* ---- platform settings page */
.pill.accent { background: var(--active-bg); color: var(--accent); }
.settings-list { display: grid; margin: 0 -16px; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 340px); gap: 8px 24px; align-items: start; padding: 14px 16px; border-top: 1px solid var(--border); }
.setting:first-child { border-top: 0; }
.setting.dirty { background: var(--active-bg); box-shadow: inset 3px 0 0 var(--accent); }
.setting-meta { display: grid; gap: 4px; min-width: 0; }
.setting-meta .row { gap: 6px; }
.setting-key { font-weight: 600; color: var(--text); font-size: 13px; }
.setting-meta .hint.mono { font-size: 11px; overflow-wrap: anywhere; }
.setting-input { display: flex; gap: 6px; align-items: flex-start; min-width: 0; }
.setting-input > :first-child { flex: 1; min-width: 0; }
.setting-input textarea { min-height: 84px; width: 100%; }
.setting-input label.check { padding-top: 6px; }
.unit-input { display: flex; align-items: center; gap: 6px; }
.unit-input input { flex: 1; min-width: 0; }
.unit-input span { color: var(--muted); font-size: 12px; }
@media (max-width: 720px) { .setting { grid-template-columns: 1fr; } }

/* ---- wide dialog: guided forms (queue editor) ---- */
dialog.wide { width: min(980px, calc(100% - 32px)); max-height: calc(100vh - 40px); padding: 0; }
dialog.wide > form { display: flex; flex-direction: column; max-height: calc(100vh - 42px); gap: 0; }
.qe-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding: 18px 22px 14px; border-bottom: 1px solid var(--border); }
.qe-head h2 { margin-right: auto; }
.qe-preset { min-width: 280px; }
.qe-body { overflow-y: auto; padding: 6px 22px 10px; }
.qe-body details { border-bottom: 1px solid var(--border); padding: 12px 0 16px; }
.qe-body details:last-child { border-bottom: 0; }
.qe-body summary { cursor: pointer; font-weight: 650; font-size: 15px; margin-bottom: 12px; list-style: none; display: flex; align-items: center; gap: 8px; }
.qe-body summary::before { content: "›"; display: inline-block; transition: transform .15s; color: var(--muted); font-size: 18px; line-height: 1; }
.qe-body details[open] summary::before { transform: rotate(90deg); }
.qe-body summary::-webkit-details-marker { display: none; }
.qe-body .hint { font-weight: 400; }
.qe-body textarea { min-height: 140px; }
dialog.wide #dlg-err { margin: 0; padding: 0 22px; }
dialog.wide #dlg-err:empty { display: none; }
.qe-foot { padding: 12px 22px; border-top: 1px solid var(--border); background: var(--panel); }

/* ---- hold music ---- */
.button-like { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--panel); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer; color: var(--text); font-weight: 500; }
.button-like.small { padding: 4px 10px; font-size: 13px; }
.button-like:hover { border-color: var(--muted); }
.moh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.moh-card h2 { font-size: 15px; }
.moh-builtin { border-style: dashed; }
.tracks, .picklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tracks li, .picklist li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: var(--radius-sm); }
.tracks li:hover, .picklist li:hover { background: var(--row-hover); }
.tracks li > span:first-of-type, .picklist li > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.moh-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.moh-pick .picklist { max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; min-height: 120px; }
.moh-queues { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
@media (max-width: 720px) { .moh-pick { grid-template-columns: 1fr; } }
.qe-foot { flex-wrap: nowrap; }
.qe-foot .hint { flex: 1; min-width: 0; }
@media (max-width: 600px) { .qe-foot { flex-wrap: wrap; } }

/* ---- AI assistants ---- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 4px; flex-wrap: wrap; }
.tabs .tab { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 14px; color: var(--muted); font-weight: 550; }
.tabs .tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tpl { display: grid; gap: 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; cursor: pointer; color: var(--text); }
.tpl input { width: auto; justify-self: start; }
.tpl:has(input:checked) { border-color: var(--accent); background: var(--active-bg); }
.rowline { flex-wrap: wrap; margin-bottom: 6px; }
.rowline input, .rowline select { width: auto; }
.qe-body .fn { margin-bottom: 10px; }
.qe-body .fn textarea { min-height: 52px; }
.chat { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; min-height: 140px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; }
.msg { max-width: 80%; padding: 7px 11px; border-radius: 12px; font-size: 14px; line-height: 1.4; white-space: pre-wrap; unicode-bidi: plaintext; text-align: start; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; }
.msg.bot { align-self: flex-start; background: var(--off-bg); }
.msg.sys { align-self: center; max-width: 95%; background: none; color: var(--muted); font-size: 12.5px; }
dialog.call-dlg > form { max-height: none; }
.rec-cell { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding-top: 6px; }
.bars .bar { flex: 1; min-width: 4px; height: 100%; display: flex; align-items: flex-end; }
.bars .bar span { display: block; width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .85; }
.bars .bar:hover span { opacity: 1; }
table.prices .price-in { display: grid; gap: 2px; color: var(--muted); font-size: 11px; }
table.prices .price-in input { width: 96px; padding: 4px 6px; }
.choose { display: grid; gap: 6px; }
.choose input[hidden] { display: none; }

/* ---- live dashboard ---- */
.pill.info { background: var(--active-bg); color: var(--accent); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.kpi { padding: 14px 16px; display: grid; gap: 2px; }
.kpi .big { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi.ok .big { color: var(--ready); }
.kpi.bad .big { color: var(--danger); }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .live-grid { grid-template-columns: 1fr; } }
.live-table td { white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--row-hover, rgba(0,0,0,.03)); }
.agent-col { position: sticky; top: 12px; max-height: calc(100vh - 140px); overflow: hidden; display: flex; flex-direction: column; }
.agent-list { overflow-y: auto; display: grid; gap: 10px; padding-right: 2px; }
.agent-list { gap: 0; }
.agent-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 34px 34px 62px 0; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px solid var(--border); font-size: 13px; position: relative; }
.agent-row:last-child { border-bottom: 0; }
.agent-row:hover { background: var(--row-hover, rgba(0,0,0,.03)); }
.agent-row.head { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 0; }
.agent-row.head span:nth-child(n+3) { text-align: right; }
.agent-row .avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; background: var(--off); }
.agent-row .avatar.ready { background: #2f9e6e; }
.agent-row .avatar.paused { background: #c98a1f; }
.agent-row .who { display: grid; min-width: 0; line-height: 1.25; }
.agent-row .who b, .agent-row .who .st { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-row .who b { font-weight: 600; }
.agent-row .st { font-size: 11.5px; color: var(--muted); }
.agent-row .st.ready { color: var(--ready); }
.agent-row .st.paused { color: var(--paused); }
.agent-row .st.danger { color: var(--danger); }
.agent-row .st.info { color: var(--accent); }
.agent-row .n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.agent-row .n.warn { color: var(--danger); }
.agent-row .n.t { font-weight: 500; font-size: 12px; }
.agent-row .acts { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: none; gap: 2px; background: var(--panel); padding-left: 4px; }
.agent-row:hover .acts { display: flex; }
.agent-row .acts button { padding: 2px 6px; }
.chip { border: 1px solid var(--border); background: var(--panel); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--text); }
.chip b { margin-left: 4px; }
.chip.on { border-color: var(--accent); color: var(--accent); background: var(--active-bg); }
#view:fullscreen { background: var(--bg, #fff); overflow: auto; padding: 16px; }
@media (max-width: 1100px) { .agent-col { position: static; max-height: none; } }
.agent-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.agent-counts .ac { display: grid; gap: 0; padding: 6px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); text-align: center; cursor: pointer; }
.agent-counts .ac b { font-size: 20px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.agent-counts .ac span { font-size: 11px; color: var(--muted); }
.agent-counts .ac.ready b { color: var(--ready); }
.agent-counts .ac.paused b { color: var(--paused); }
.agent-counts .ac.danger b { color: var(--danger); }
.agent-counts .ac.on { border-color: var(--accent); background: var(--active-bg); }
.agent-row .call { font-size: 11.5px; color: var(--danger); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agent-row .call.ringing { color: var(--accent); }
.agent-row .call .tick { font-variant-numeric: tabular-nums; }
/* supervisor monitoring */
.mon { display: inline-flex; gap: 2px; }
.mon button { padding: 2px 6px; line-height: 1.2; }
.live-table td:last-child { overflow: visible; }
.monitor-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-color: var(--danger); background: var(--danger-bg); position: sticky; top: 0; z-index: 3; }
.monitor-bar .pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: mon-pulse 1.2s ease-in-out infinite; }
@keyframes mon-pulse { 50% { opacity: .25; } }
button.danger-btn { background: var(--danger); border-color: var(--danger); color: #fff; }

/* typed text in any language: Arabic lines right-to-left, others left-to-right (per line) */
textarea[dir="auto"], input[dir="auto"] { unicode-bidi: plaintext; text-align: start; }

/* ---- billing ---- */
.nav-item.locked { opacity: .55; }
.nav-item .lock { margin-left: auto; font-size: 11px; }
.meter { height: 8px; background: var(--off-bg); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ready); border-radius: 99px; }
.meter.warn span { background: var(--paused); }
.meter.full span { background: var(--danger); }
.feat { font-size: 13.5px; padding: 2px 0; color: var(--muted); }
.feat.on { color: var(--text); }
.plans-table th, .plans-table td { text-align: center; }
.plans-table th:first-child, .plans-table td:first-child { text-align: left; color: var(--muted); }
.plans-table .cur { background: var(--active-bg); }

/* the monitoring extension in this browser (sidebar foot) */
.phone-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; font-size: 12px; justify-content: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-card a.small { align-self: center; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; max-height: 46vh; overflow: auto; }
.perm-grid fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px 8px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.perm-grid legend { font-size: 12px; color: var(--muted); padding: 0 4px; }
.perm-grid .check { font-size: 13px; }

/* quality: an evaluation (recording + transcript | scorecard) */
.qc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .qc-grid { grid-template-columns: 1fr; } }
.qc-q { border-top: 1px solid var(--border); padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.qc-q.unanswered b { color: var(--accent, inherit); }
.qc-q input.small { font-size: 13px; }
.qc-ai { background: var(--active-bg); border-radius: var(--radius-sm); padding: 4px 8px; unicode-bidi: plaintext; }
.qc-edit-s { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.qc-edit-s legend input { font-weight: 600; }
.qc-edit-q { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border-bottom: 1px dashed var(--border); padding-bottom: 6px; }

/* grid children may shrink below their content (wide tables scroll inside .table-wrap, not the page) */
.page > *, .stack > * { min-width: 0; }

/* ---- charts (workforce): series and a one-hue sequential ramp, light and dark steps */
.viz { --series-1: #2a78d6; --series-2: #eb6834; --viz-grid: rgba(0,0,0,.08);
  --seq-0: #f3f3f1; --seq-1: #cde2fb; --seq-2: #9ec5f4; --seq-3: #6da7ec; --seq-4: #3987e5; --seq-5: #256abf; --seq-6: #184f95; --seq-7: #0d366b; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .viz { --series-1: #3987e5; --series-2: #d95926; --viz-grid: rgba(255,255,255,.08);
    --seq-0: #232322; --seq-1: #0d366b; --seq-2: #104281; --seq-3: #184f95; --seq-4: #256abf; --seq-5: #2a78d6; --seq-6: #5598e7; --seq-7: #86b6ef; }
}
:root[data-theme="dark"] .viz { --series-1: #3987e5; --series-2: #d95926; --viz-grid: rgba(255,255,255,.08);
  --seq-0: #232322; --seq-1: #0d366b; --seq-2: #104281; --seq-3: #184f95; --seq-4: #256abf; --seq-5: #2a78d6; --seq-6: #5598e7; --seq-7: #86b6ef; }
.heat { display: grid; gap: 2px; font-size: 11px; overflow-x: auto; }
.heat .c { height: 22px; border-radius: 3px; background: var(--seq-0); cursor: default; }
.heat .lbl { color: var(--muted); white-space: nowrap; display: flex; align-items: center; padding-right: 6px; }
.heat .day { cursor: pointer; }
.heat .day.sel { color: var(--text); font-weight: 600; }
.heat-scale { display: flex; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); }
.heat-scale i { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.viz-tip { position: fixed; pointer-events: none; z-index: 50; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; font-size: 12px; box-shadow: var(--shadow-lg); white-space: nowrap; }
.viz-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); align-items: center; }
.viz-legend .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; vertical-align: -2px; margin-right: 4px; }
.viz-legend .ln { width: 14px; height: 2px; display: inline-block; vertical-align: 3px; margin-right: 4px; }
/* the schedule grid */
.sched { width: 100%; border-collapse: separate; border-spacing: 2px; font-size: 12px; }
.sched td.cell { min-width: 92px; height: 38px; border-radius: 6px; background: var(--hover); cursor: pointer; padding: 3px 6px; vertical-align: top; }
.sched td.cell.work { background: var(--active-bg); }
.sched td.cell.leave { background: rgba(236,131,90,.18); }
.sched td.cell .acts { color: var(--muted); font-size: 11px; }
.feed-item { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.feed-item:first-child { border-top: 0; }
.feed-item .sev { font-size: 12px; font-weight: 600; white-space: nowrap; }
.feed-item .sev.critical { color: #d03b3b; } .feed-item .sev.warning { color: #c98500; } .feed-item .sev.info { color: var(--muted); }
.feed-item .act { color: var(--text); font-size: 13px; }
/* rows of small controls (breaks in a shift) keep their natural width */
.act-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.act-row select, .act-row input[type="time"] { width: auto; }
.act-row input[type="number"] { width: 80px; }
/* platform announcements above the page */
#banner { padding: 8px 24px 0; display: flex; flex-direction: column; gap: 6px; }
.banner { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--active-bg); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.banner.maintenance { background: rgba(250,178,25,.18); }
.banner.warning { background: rgba(208,59,59,.14); }
.banner .link { margin-left: auto; }
