/* ---------- Brand font (Inter, SIL OFL — see /brand/fonts/Inter-OFL.txt) ---------- */
@font-face { font-family: "Inter"; src: url("/brand/fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/brand/fonts/Inter-Medium.ttf") format("truetype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/brand/fonts/Inter-SemiBold.ttf") format("truetype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/brand/fonts/Inter-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

/* ---------- Tokens (Rebytes: navy #011631, cyan #02C4F0, green #09C184) ---------- */
:root {
  color-scheme: light;
  --brand-navy: #011631;
  --brand-cyan: #02C4F0;
  --brand-green: #09C184;
  --brand-gradient: linear-gradient(110deg, #02C4F0 0%, #02C4F0 30%, #09C184 70%, #09C184 100%);
  --bg: #f2f5f8;
  --surface: #ffffff;
  --surface-2: #f5f8fa;
  --text: #0d1b2a;
  --text-2: #4a5768;
  --muted: #8592a3;
  --border: #e3e9ef;
  --accent: #02769f; /* readable cyan for text/links on white (≥ 4.5:1) */
  --accent-soft: #e2f6fc;
  --accent-ink: #ffffff;
  --btn-bg: var(--brand-navy);
  --btn-ink: #ffffff;
  --hl: #f3fafc;
  --neg: #d03b3b;
  --shadow: 0 1px 2px rgba(1, 22, 49, 0.04), 0 8px 24px rgba(1, 22, 49, 0.06);
  --radius: 18px;
  --radius-sm: 12px;
  /* data colours (validated categorical slots) */
  --tone-1: #2a78d6;
  --tone-2: #e87ba4;
  --tone-3: #eda100;
  --tone-4: #1baf7a;
  --track: #edf1f5;
  --flag-red: #d03b3b;
  --flag-yellow: #fab219;
  --flag-green: #0ca30c;
  --chip-due-bg: #fdecec;
  --chip-due-ink: #b42828;
  --tip-bg: #011631;
  --tip-ink: #f3f4f8;
  --font: "Inter", "Tajawal", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #010d1d; --surface: #071a2f; --surface-2: #0b2239; --text: #eef4f8; --text-2: #b9c7d4; --muted: #7f93a6;
    --border: #15304a; --accent: #02c4f0; --accent-soft: #0a2f45; --accent-ink: #011631; --hl: #0a2036; --neg: #ef6b6b;
    --btn-bg: #02c4f0; --btn-ink: #011631;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --tone-1: #3987e5; --tone-2: #d55181; --tone-3: #c98500; --tone-4: #199e70; --track: #16304a;
    --chip-due-bg: #3a1f22; --chip-due-ink: #ff9a9a; --tip-bg: #eef4f8; --tip-ink: #011631;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #010d1d; --surface: #071a2f; --surface-2: #0b2239; --text: #eef4f8; --text-2: #b9c7d4; --muted: #7f93a6;
  --border: #15304a; --accent: #02c4f0; --accent-soft: #0a2f45; --accent-ink: #011631; --hl: #0a2036; --neg: #ef6b6b;
  --btn-bg: #02c4f0; --btn-ink: #011631;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  --tone-1: #3987e5; --tone-2: #d55181; --tone-3: #c98500; --tone-4: #199e70; --track: #16304a;
  --chip-due-bg: #3a1f22; --chip-due-ink: #ff9a9a; --tip-bg: #eef4f8; --tip-ink: #011631;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; }
.muted { color: var(--muted); font-size: 12px; }
.icon { display: inline-flex; }
.print-only { display: none; }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); }

.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); padding: 9px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; font-weight: 500; transition: background .15s, transform .05s; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; }
.btn.spinning .icon { animation: spin .8s linear infinite; }
.icon-btn { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 6px; border-radius: 10px; display: inline-flex; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.input, .select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); min-height: 40px; }
.input:focus, .select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.logo { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, #3b8af0, #2a5fd0); color: #fff; font-weight: 700; font-size: 20px; }
.logo.sm { width: 34px; height: 34px; border-radius: 11px; font-size: 16px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Info "i" + tooltip ---------- */
button.info { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; color: var(--muted); font: italic 700 10px/1 Georgia, serif; cursor: help; padding: 0; background: transparent; flex: none; vertical-align: middle; opacity: .8; }
button.info:hover, button.info:focus-visible { color: var(--accent); opacity: 1; outline: none; }
.tooltip { position: fixed; z-index: 1000; max-width: 320px; background: var(--tip-bg); color: var(--tip-ink); padding: 12px 14px; border-radius: 12px; font-size: 12.5px; line-height: 1.5; box-shadow: 0 10px 30px rgba(0,0,0,.25); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; text-align: left; font-weight: 400; white-space: normal; }
.tooltip.show { opacity: 1; transform: none; }
.tooltip b { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; }
.tooltip code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; opacity: .85; }
.tooltip .tip-src { margin-top: 8px; padding-top: 8px; border-top: 1px solid color-mix(in srgb, var(--tip-ink) 20%, transparent); opacity: .8; font-size: 11.5px; }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 16px; position: relative; }
.login-page .theme-toggle { position: absolute; top: 16px; right: 16px; }
.login-card { width: 100%; max-width: 410px; background: var(--surface); border: 1px solid var(--border); border-radius: 24px; padding: 32px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.brand h1 { font-size: 20px; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.login-card label { display: grid; gap: 6px; font-weight: 500; font-size: 13px; color: var(--text-2); }
.login-card input { padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.login-card input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.login-card small { color: var(--muted); }
.advanced summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.advanced { display: grid; gap: 6px; }
.login-card .btn.primary { justify-content: center; padding: 12px; font-weight: 600; border-radius: var(--radius-sm); }
.alert { background: #fdecea; color: #8a1c12; border: 1px solid #f5c2bc; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-size: 16px; }
.side-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; }
.side-nav { display: grid; gap: 4px; }
.side-nav button { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 11px 12px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-2); text-align: left; font-weight: 500; }
.side-nav button:hover { background: var(--surface-2); }
.side-nav button.active { background: var(--accent-soft); color: var(--accent); }
.side-foot { margin-top: auto; display: grid; gap: 10px; }
.instance-card { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; color: var(--text-2); min-width: 0; }
.instance-card > div { min-width: 0; }
.ic-host { font-size: 12px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-meta { font-size: 11px; color: var(--muted); }
.user-card { display: flex; align-items: center; gap: 10px; padding: 6px 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.uc-name { flex: 1; font-weight: 500; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.main { padding: 22px 28px 28px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.main-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.page-title { font-size: 22px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.select-wrap { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 6px 0 14px; color: var(--muted); }
.select-wrap .select { border: 0; background: transparent; padding-left: 0; min-height: 38px; max-width: 260px; color: var(--text); font-weight: 500; }
.theme-toggle { gap: 6px; }
.content { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 14px 16px; align-items: end; padding: 16px 18px; }
.field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.field > span { display: inline-flex; align-items: center; gap: 6px; }
.field.grow { flex: 1 1 220px; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search .input { width: 100%; padding-left: 36px; }
.switches { display: flex; flex-wrap: wrap; gap: 10px 18px; padding-bottom: 9px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 34px; height: 20px; border-radius: 999px; background: var(--track); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; gap: 8px; margin-left: auto; }

.status { font-size: 13px; color: var(--muted); }
.status:empty { display: none; }
.status.error { color: var(--neg); }
.status.warn { color: var(--tone-3); }
.status.loading::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--muted); border-top-color: transparent; animation: spin .8s linear infinite; vertical-align: -1px; }

/* ---------- Overview: KPI rings + aging bars ---------- */
.overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.kpi { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; }
.kpi-text { min-width: 0; }
.kpi-label { color: var(--text-2); font-size: 13px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 24px; font-weight: 600; margin: 4px 0 2px; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-value.neg { color: var(--neg); }
.kpi-sub { color: var(--muted); font-size: 12px; }
.ring { position: relative; width: 76px; height: 76px; flex: none; }
.ring svg { display: block; }
.ring-track { fill: none; stroke: var(--track); stroke-width: 8; }
.ring-val { fill: none; stroke: currentColor; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ring-pct { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: var(--text); }
.tone-1 { color: var(--tone-1); }
.tone-2 { color: var(--tone-2); }
.tone-3 { color: var(--tone-3); }
.tone-4 { color: var(--tone-4); }

.aging { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-title h2 { font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.bars { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 58px minmax(0, 1fr) 84px; align-items: center; gap: 10px; font-size: 12px; }
.bar-label { color: var(--text-2); font-weight: 500; }
.bar-track { height: 12px; background: var(--track); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--tone-1); border-radius: 999px; transition: width .6s ease; }
.bar-row:hover .bar-fill { filter: brightness(1.1); }
.bar-value { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-value.neg { color: var(--neg); }

/* ---------- Table ---------- */
.table-card { overflow: hidden; }
.table-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.table-head h2 { font-size: 16px; }
.report-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.table-wrap { overflow: auto; max-height: calc(100vh - 170px); }
table.grid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1320px; font-variant-numeric: tabular-nums; font-size: 13px; }
.grid th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--text-2); font-weight: 600; font-size: 12px; padding: 12px 10px; border-bottom: 1px solid var(--border); cursor: pointer; user-select: none; text-align: right; vertical-align: bottom; line-height: 1.35; }
.grid th.text { text-align: left; min-width: 280px; }
.grid th.notes { text-align: left; min-width: 220px; }
.grid th.num { min-width: 104px; }
.grid th.hl { max-width: 130px; }
.th-in { display: inline-flex; align-items: flex-end; gap: 5px; }
.grid th .sort { font-style: normal; font-size: 11px; opacity: .35; }
.grid th.sorted { color: var(--accent); }
.grid th.sorted .sort { opacity: 1; }
.grid td { padding: 11px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; text-align: right; }
.grid td.hl { background: var(--hl); }
.grid td.strong { font-weight: 600; }
.grid td.neg { color: var(--neg); }
.grid td.vendor { text-align: left; font-weight: 500; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.grid td.vendor:dir(rtl) { text-align: right; }
.grid th:first-child, .grid td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--border); }
.grid th:first-child { z-index: 3; background: var(--surface-2); }
.grid tbody tr:hover td { background: var(--surface-2); }
.grid td.empty { text-align: center; padding: 36px; color: var(--muted); }
.grid tfoot td { position: sticky; bottom: 0; background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border); border-bottom: 0; }
.grid tfoot td:first-child { background: var(--surface-2); z-index: 3; }

.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 12px; }
.chip.due { background: var(--chip-due-bg); color: var(--chip-due-ink); }
.chip.zero { color: var(--muted); }

.grid td.notes { text-align: left; padding: 6px 8px; transition: box-shadow .3s; }
.note-box { display: flex; align-items: center; gap: 8px; }
.grid td.notes.saved { box-shadow: inset 0 0 0 2px var(--accent); }
.grid td.notes.flag-red { background: color-mix(in srgb, var(--flag-red) 14%, var(--surface)); }
.grid td.notes.flag-yellow { background: color-mix(in srgb, var(--flag-yellow) 18%, var(--surface)); }
.grid td.notes.flag-green { background: color-mix(in srgb, var(--flag-green) 14%, var(--surface)); }
.flag { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid var(--muted); background: transparent; cursor: pointer; padding: 0; opacity: .6; }
.flag:hover { opacity: 1; }
.flag.red { background: var(--flag-red); border-color: var(--flag-red); opacity: 1; }
.flag.yellow { background: var(--flag-yellow); border-color: var(--flag-yellow); opacity: 1; }
.flag.green { background: var(--flag-green); border-color: var(--flag-green); opacity: 1; }
.note-input { flex: 1; border: 0; background: transparent; padding: 6px 8px; min-width: 0; border-radius: 8px; }
.note-input::placeholder { color: var(--muted); opacity: .7; }
.note-input:focus { outline: 1px solid var(--accent); background: var(--surface); }

/* ---------- Help & docs ---------- */
.docs { display: grid; gap: 18px; max-width: 980px; }
.docs .card { padding: 22px 26px; }
.docs h2 { font-size: 17px; margin-bottom: 10px; }
.docs h3 { font-size: 14px; margin: 16px 0 6px; }
.docs p, .docs li { color: var(--text-2); line-height: 1.65; }
.docs ul, .docs ol { padding-left: 20px; margin: 6px 0; }
.docs code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
.docs table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; }
.docs th, .docs td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.docs th { color: var(--muted); font-weight: 600; font-size: 12px; }
.docs td:first-child { font-weight: 600; white-space: nowrap; color: var(--text); }
.docs .formula { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--accent); }
.docs .lead { font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .overview { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px 16px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--border); }
  .side-brand { padding: 0; }
  .side-label, .instance-card { display: none; }
  .side-nav { display: flex; }
  .side-foot { margin: 0 0 0 auto; }
  .main { padding: 16px; }
  .kpis { grid-template-columns: 1fr; }
  .actions { margin-left: 0; width: 100%; }
  .actions .btn { flex: 1; justify-content: center; }
}

/* ---------- Print ---------- */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  :root, :root[data-theme="dark"] {
    color-scheme: light;
    --bg: #fff; --surface: #fff; --surface-2: #f2f3f6; --text: #000; --text-2: #222; --muted: #555; --border: #bbb; --hl: #f5f7fb;
    --shadow: none; --tone-1: #2a78d6; --tone-2: #e87ba4; --tone-3: #eda100; --tone-4: #1baf7a; --track: #e6e8ee;
    --chip-due-bg: transparent; --chip-due-ink: #000; --neg: #b00;
  }
  body { font-size: 10px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .main-head, .filters, .status, .info, .tooltip, .grid th .sort, .flag { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; gap: 10px; }
  .print-only { display: block; }
  .print-title { text-align: center; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
  .print-meta { text-align: center; font-size: 10px; color: #555; margin-bottom: 8px; }
  .card { box-shadow: none; border-radius: 8px; }
  .overview { grid-template-columns: 2fr 1fr; gap: 8px; break-inside: avoid; }
  .kpis { gap: 8px; }
  .kpi, .aging { padding: 8px 12px; }
  .kpi-value { font-size: 15px; }
  .ring, .ring svg { width: 48px; height: 48px; }
  .ring-pct { font-size: 11px; }
  .bars { gap: 5px; }
  .table-card { overflow: visible; border: 0; }
  .table-head { display: none; }
  .table-wrap { overflow: visible; max-height: none; }
  table.grid { min-width: 0; font-size: 8.5px; }
  .grid th, .grid td { position: static !important; padding: 4px 4px; box-shadow: none !important; border: 1px solid #bbb; }
  .grid th { font-size: 8.5px; white-space: normal; text-align: center; vertical-align: middle; }
  .grid th.text, .grid th.num, .grid th.notes { min-width: 0; }
  .grid td.vendor { max-width: 200px; white-space: normal; }
  .grid thead { display: table-header-group; }
  .grid tfoot { display: table-footer-group; }
  .grid tr { break-inside: avoid; }
  .chip { padding: 0; }
  .note-input { padding: 0; }
  .grid td.notes { min-width: 0; }
}
.switch-wrap { display: inline-flex; align-items: center; gap: 6px; }
.docs table { table-layout: fixed; }
.docs th:nth-child(1), .docs td:nth-child(1) { width: 24%; white-space: normal; }
.docs th:nth-child(2), .docs td:nth-child(2) { width: 46%; }
.docs th:nth-child(3), .docs td:nth-child(3) { width: 30%; overflow-wrap: anywhere; }

/* ---------- Dynamic bits ---------- */
.updated { align-self: center; font-size: 12px; color: var(--muted); margin-right: 4px; white-space: nowrap; }
.updated:empty { display: none; }
.field.live > span::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tone-4); box-shadow: 0 0 0 0 var(--tone-4); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--tone-4) 60%, transparent); } 100% { box-shadow: 0 0 0 8px transparent; } }
.kpi { transition: transform .2s, box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(22, 28, 45, .05), 0 14px 32px rgba(22, 28, 45, .1); }
.ring-val { transition: stroke-dasharray 1s cubic-bezier(.2,.8,.2,1); }
.bar-fill { transition: width 1s cubic-bezier(.2,.8,.2,1); }
tbody.enter tr { animation: rowIn .35s ease both; animation-delay: calc(var(--i, 0) * 18ms); }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  tbody.enter tr, .field.live > span::after { animation: none; }
  .ring-val, .bar-fill, .kpi, .drawer, .drawer-overlay { transition: none !important; }
}

.table-head { gap: 16px; flex-wrap: wrap; }
.table-search { flex: 0 1 340px; min-width: 220px; }
.vendor-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 500; color: var(--text); cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: inherit; display: block; width: 100%; }
.vendor-link:dir(rtl) { text-align: right; }
.vendor-link:hover, .vendor-link:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; outline: none; }

/* ---------- Vendor drawer ---------- */
body.drawer-open { overflow: hidden; }
.drawer-overlay { position: fixed; inset: 0; z-index: 500; background: rgba(15, 17, 25, 0); transition: background .25s; display: flex; justify-content: flex-end; }
.drawer-overlay.open { background: rgba(15, 17, 25, .35); }
.drawer { width: min(920px, 100%); height: 100%; background: var(--bg); box-shadow: -20px 0 50px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; overflow: hidden; }
.drawer-overlay.open .drawer { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 22px 26px 12px; background: var(--surface); }
.drawer-head-text { min-width: 0; }
.drawer-title { font-size: 20px; line-height: 1.35; }
.drawer-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.drawer-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.contact { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 26px 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.contact:empty { display: none; }
.contact-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); text-decoration: none; max-width: 100%; }
a.contact-chip:hover { color: var(--accent); border-color: var(--accent); }
.contact-chip.note.flag-red { border-color: var(--flag-red); }
.contact-chip.note.flag-yellow { border-color: var(--flag-yellow); }
.contact-chip.note.flag-green { border-color: var(--flag-green); }
.drawer-body { flex: 1; overflow: auto; padding: 18px 26px 26px; display: flex; flex-direction: column; gap: 16px; }
.drawer-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.kpi.small { padding: 14px 16px; }
.kpi.small .kpi-value { font-size: 20px; }
.kpi.small .ring, .kpi.small .ring svg { width: 62px; height: 62px; }
.kpi.small .ring-pct { font-size: 13px; }
.drawer-aging { padding: 16px 18px; display: grid; gap: 12px; }
.drawer-tabs { overflow: hidden; }
.drawer-tabs-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.drawer-tabs-head .search { flex: 0 1 300px; min-width: 200px; }
.drawer-tabs-head .search .input { width: 100%; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg .count { background: var(--track); color: var(--text-2); border-radius: 999px; padding: 0 7px; font-size: 11px; font-weight: 600; }
.seg button.active .count { background: var(--accent-soft); color: var(--accent); }
.drawer-table { overflow: auto; max-height: 60vh; }
.grid.compact { min-width: 720px; font-size: 12.5px; }
.grid.compact th, .grid.compact td { padding: 9px 10px; }
.grid.compact th:first-child, .grid.compact td:first-child { position: static; box-shadow: none; }
.grid.compact td.txt { text-align: left; }
.grid.compact td.wrap { white-space: normal; min-width: 180px; }
.grid.compact td.wrap:dir(rtl) { text-align: right; }
.doc-link { color: var(--accent); text-decoration: none; font-weight: 500; }
.doc-link:hover { text-decoration: underline; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--track); color: var(--text-2); margin-right: 4px; }
.pill.b1, .pill.b2 { background: color-mix(in srgb, var(--tone-3) 20%, var(--surface)); color: var(--text); }
.pill.b3, .pill.b4, .pill.b5 { background: color-mix(in srgb, var(--flag-red) 16%, var(--surface)); color: var(--text); }
.pill.pay { background: var(--accent-soft); color: var(--accent); }
.skeleton { display: grid; gap: 14px; }
.skeleton div { height: 96px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.skeleton div:last-child { height: 280px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (max-width: 640px) {
  .drawer-head, .contact, .drawer-body { padding-left: 16px; padding-right: 16px; }
  .drawer-kpis { grid-template-columns: 1fr; }
}
@media print { .drawer-overlay { display: none !important; } }
.seg-wrap { display: inline-flex; align-items: center; gap: 8px; }
.drawer-title { unicode-bidi: plaintext; text-align: left; }
.cell-link { border: 0; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: 6px; font: inherit; color: inherit; cursor: pointer; }
.cell-link:hover, .cell-link:focus-visible { color: var(--accent); background: var(--accent-soft); text-decoration: underline; text-underline-offset: 3px; outline: none; }
.chip.cell-link { margin: 0; padding: 4px 10px; color: var(--chip-due-ink); background: var(--chip-due-bg); }
.chip.cell-link:hover, .chip.cell-link:focus-visible { color: var(--chip-due-ink); background: var(--chip-due-bg); box-shadow: inset 0 0 0 1.5px var(--chip-due-ink); }
.focus-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 10px 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.focus-chip:hover { filter: brightness(.97); }
@media print { .cell-link { text-decoration: none !important; background: none !important; } }

/* ---------- Nurse Commission ---------- */
.doctor-bars { gap: 6px; }
.doctor-row { border: 0; background: transparent; width: 100%; padding: 5px 6px; margin: 0 -6px; border-radius: 10px; cursor: pointer; font: inherit; color: inherit; grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) 84px; text-align: left; }
.doctor-row .bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doctor-row:hover { background: var(--surface-2); }
.doctor-row.active { background: var(--accent-soft); }
.doctor-row.active .bar-label { color: var(--accent); font-weight: 600; }
.nurse-grid { min-width: 1000px; }
.nurse-grid td.txt { text-align: left; }
.nurse-grid td.txt:dir(rtl) { text-align: right; }
.nurse-grid td .sub { font-size: 11px; color: var(--muted); }
.nurse-grid th.text { min-width: 0; }
.nurse-grid th:nth-child(2) { min-width: 220px; }
.tel { color: inherit; text-decoration: none; }
.tel:hover { color: var(--accent); }
.nurse-grid { min-width: 980px; }
.nurse-grid thead .group-row th { text-align: center; border-bottom: 0; padding-bottom: 4px; }
.nurse-grid thead .group-row th.text { text-align: left; vertical-align: bottom; }
.nurse-grid thead th.group { color: var(--text); font-size: 12px; border-left: 1px solid var(--border); }
.nurse-grid thead th.sub { top: 36px; font-weight: 500; font-size: 11.5px; padding-top: 6px; }
.nurse-grid thead th.net { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.nurse-grid thead .group-row th { cursor: default; }
.nurse-grid tr.nurse-row td { background: var(--surface-2); font-weight: 600; border-top: 1px solid var(--border); }
.nurse-grid tr.nurse-row td.vendor .nurse-name { font-weight: 600; }
.nurse-grid tr.phys-row td.vendor { padding-left: 28px; font-weight: 400; color: var(--text-2); }
.nurse-grid td.refund { color: var(--neg); }
.drawer-table.tall { max-height: calc(100vh - 220px); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; border: 1px solid; }
.notice strong { display: block; margin-bottom: 2px; }
.notice.n-info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--text); }
.notice.n-info .icon { color: var(--accent); }
.notice.n-warn { background: color-mix(in srgb, var(--flag-yellow) 15%, var(--surface)); border-color: color-mix(in srgb, var(--flag-yellow) 50%, transparent); color: var(--text); }
.notice.n-error { background: color-mix(in srgb, var(--flag-red) 10%, var(--surface)); border-color: color-mix(in srgb, var(--flag-red) 40%, transparent); color: var(--text); }
.notice.n-error .icon { color: var(--flag-red); }

/* ---------- Admin ---------- */
.nav-badge { margin-left: auto; background: var(--flag-red); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600; padding: 1px 7px; min-width: 20px; text-align: center; }
.side-empty { padding: 6px 12px; }
.uc-text { flex: 1; min-width: 0; }
.uc-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status.ok { color: var(--tone-4); }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kpis.four { grid-template-columns: 1fr; } }
.admin-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-tools .search { min-width: 240px; }
.admin-tools .search .input { width: 100%; }
.seg .count.hot { background: var(--flag-red); color: #fff; }
.input.sm { min-height: 34px; padding: 6px 10px; font-size: 13px; }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.icon-btn.danger:hover { color: var(--flag-red); background: color-mix(in srgb, var(--flag-red) 10%, var(--surface)); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.admin-grid { min-width: 1060px; }
.admin-grid td.txt { text-align: left; vertical-align: middle; }
.admin-grid td { vertical-align: middle; }
.admin-grid th:first-child, .admin-grid td:first-child { position: static; box-shadow: none; }
.ucell { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.ucell-text { min-width: 0; }
.ucell-name { font-weight: 500; display: flex; align-items: center; gap: 6px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; position: relative; }
.avatar.online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--tone-4); border: 2px solid var(--surface); }
.spill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--track); color: var(--text-2); }
.spill.tiny { padding: 0 7px; font-size: 10.5px; }
.spill.s-ok { background: color-mix(in srgb, var(--tone-4) 16%, var(--surface)); color: color-mix(in srgb, var(--tone-4) 70%, var(--text)); }
.spill.s-info { background: var(--accent-soft); color: var(--accent); }
.spill.s-warn { background: color-mix(in srgb, var(--flag-yellow) 22%, var(--surface)); color: var(--text); }
.spill.s-bad { background: color-mix(in srgb, var(--flag-red) 13%, var(--surface)); color: color-mix(in srgb, var(--flag-red) 75%, var(--text)); }
.seen { display: inline-flex; align-items: center; gap: 7px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--track); flex: none; }
.dot.on { background: var(--tone-4); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone-4) 25%, transparent); }
.exp { display: inline-flex; align-items: center; gap: 4px; }
.warn-text { color: var(--tone-3); }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.empty-state { display: grid; justify-items: center; gap: 6px; padding: 48px 16px; color: var(--text-2); text-align: center; }
.empty-state .icon { color: var(--muted); }
.request-list { display: grid; gap: 12px; padding: 16px; }
.request { display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 8px 16px; padding: 16px 18px; align-items: center; }
.request-meta { grid-column: 1 / -1; order: 2; }
.request-actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; justify-content: flex-end; }
.request-actions .actions { margin-left: 0; }
@media (max-width: 860px) { .request { grid-template-columns: 1fr; } .request-actions { justify-content: flex-start; } }
.types-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 16px; }
.type-card { padding: 16px; display: grid; gap: 12px; box-shadow: none; }
.type-card.new { border-style: dashed; }
.type-head { display: flex; align-items: center; gap: 10px; }
.type-head .input { flex: 1; min-width: 0; font-weight: 600; }
.type-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.type-sections { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.check-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 12.5px; cursor: pointer; background: var(--surface-2); }
.check-chip:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.check-chip:has(input:disabled) { cursor: default; }
.type-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.nowrap { white-space: nowrap; }
.admin-grid { min-width: 900px; }
.admin-grid .input.sm { max-width: 170px; }
.admin-grid .ucell { min-width: 200px; }
.admin-grid th, .admin-grid td { padding-left: 8px; padding-right: 8px; }
.nurse-grid td.vendor .vendor-link { font-weight: 600; }
.nurse-grid thead .group-row th[rowspan] { vertical-align: bottom; }
.nurse-grid thead tr:not(.group-row) th:first-child { left: auto; box-shadow: none; z-index: 2; background: var(--surface-2); }
.nurse-grid thead tr:not(.group-row) th.net:first-child { background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }

/* ---------- Setup & login ---------- */
.login-card select { padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-weight: 400; }
.login-fields { display: grid; gap: 16px; }
.login-switch { display: flex; justify-content: center; }
.link-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 4px 8px; border-radius: 8px; }
.link-btn:hover { color: var(--accent); background: var(--surface-2); }
.setup-card { max-width: 470px; }
.setup-form { display: grid; gap: 14px; }
.steps { display: flex; gap: 8px; }
.steps span { flex: 1; text-align: center; font-size: 12px; font-weight: 600; padding: 7px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.steps span.on { background: var(--accent-soft); color: var(--accent); }
.setup-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.setup-actions .btn.primary { padding: 10px 16px; }
.tab-intro { padding: 14px 16px 0; margin: 0; }
.conn-msg { font-size: 12px; min-height: 16px; }
.ok-text { color: var(--tone-4); font-size: 12px; }
.err-text { color: var(--neg); font-size: 12px; }
.type-card .field .input { width: 100%; }
.drawer-overlay.modal { align-items: center; justify-content: center; padding: 16px; }
.modal-card { width: min(520px, 100%); max-height: calc(100vh - 32px); background: var(--surface); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.25); overflow: auto; transform: translateY(12px) scale(.98); opacity: 0; transition: transform .2s, opacity .2s; }
.drawer-overlay.modal.open .modal-card { transform: none; opacity: 1; }
.modal-form .drawer-head { border-bottom: 1px solid var(--border); padding: 18px 22px 14px; }
.modal-body { display: grid; gap: 12px; padding: 18px 22px; }
.modal-body .input { width: 100%; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--border); }

/* ---------- Rebytes brand ---------- */
.brand-lockup { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.brand-lockup img { display: block; height: 30px; width: auto; }
.brand-lockup.lg img { height: 44px; }
.brand-lockup .lockup-dark { display: none; }
:root[data-theme="dark"] .brand-lockup .lockup-light { display: none; }
:root[data-theme="dark"] .brand-lockup .lockup-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .brand-lockup .lockup-light { display: none; }
  :root:not([data-theme="light"]) .brand-lockup .lockup-dark { display: block; }
}
.brand-product { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); padding-left: 2px; }
.brand-lockup.lg .brand-product { font-size: 12px; }
.brand.brand-stack { flex-direction: column; align-items: flex-start; gap: 10px; }
.brand.brand-stack p { margin: 0; color: var(--text-2); font-size: 14px; }
.setup-title { font-size: 20px; }
.login-card { border-top: 4px solid transparent; background-image: linear-gradient(var(--surface), var(--surface)), var(--brand-gradient); background-origin: border-box; background-clip: padding-box, border-box; }
.side-brand { padding: 2px 8px 22px; }
.sidebar { border-top: 3px solid transparent; border-image: var(--brand-gradient) 1; border-image-width: 3px 0 0 0; }
.login-page { background: radial-gradient(1100px 500px at 85% -10%, color-mix(in srgb, var(--brand-cyan) 10%, transparent), transparent 70%), radial-gradient(900px 500px at -10% 110%, color-mix(in srgb, var(--brand-green) 9%, transparent), transparent 70%); }
.avatar { background: var(--accent-soft); color: var(--accent); }
.logo { background: var(--brand-gradient); }

/* ---------- Branded print / PDF ---------- */
@page {
  size: A4 landscape;
  margin: 12mm 10mm 14mm;
  @bottom-left { content: "Rebytes LLC · Confidential"; font: 500 8pt "Inter", sans-serif; color: #5b6b7c; }
  @bottom-right { content: "Page " counter(page) " of " counter(pages); font: 500 8pt "Inter", sans-serif; color: #5b6b7c; }
}
@media print {
  .print-head { display: grid !important; grid-template-columns: auto 1fr; align-items: center; gap: 4px 18px; margin-bottom: 10px; }
  .print-brand { display: flex; align-items: center; gap: 12px; }
  .print-brand img { height: 34px; width: auto; }
  .print-brand-text { border-left: 1px solid #c9d3dd; padding-left: 12px; }
  .print-product { font-size: 9px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #011631; }
  .print-legal { font-size: 8.5px; color: #5b6b7c; }
  .print-titles { text-align: right; }
  .print-head .print-title { text-align: right; font-size: 15px; font-weight: 700; color: #011631; margin: 0; }
  .print-head .print-meta { text-align: right; font-size: 9px; color: #5b6b7c; margin: 2px 0 0; }
  .print-strip { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: linear-gradient(110deg, #02C4F0 0%, #02C4F0 30%, #09C184 70%, #09C184 100%); margin-top: 6px; }
  .grid th { background: #011631 !important; color: #fff !important; }
  .grid thead .group-row th { background: #0b2a4a !important; }
  .grid tfoot td { background: #e6f7fb !important; color: #011631 !important; }
  .kpi-value { color: #011631; }
}

/* ---------- Nurse Commission table polish ---------- */
.nurse-grid th.gstart, .nurse-grid td.gstart { border-left: 1px solid var(--border); }
.nurse-grid thead th.group { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.nurse-grid td.zero { color: var(--muted); opacity: .55; }
.nurse-grid td.net-col { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.nurse-grid td.net-col.strong { color: var(--text); }
.nurse-grid tbody tr.same-nurse td.vendor .vendor-link { color: var(--muted); font-weight: 500; }
.nurse-grid tbody tr.nurse-break td { border-top: 2px solid var(--border); }
.nurse-grid tbody td { padding-top: 10px; padding-bottom: 10px; }
.nurse-grid tbody tr:hover td.vendor .vendor-link { color: var(--accent); }

/* ---------- Account pages ---------- */
.login-card { max-width: 460px; grid-template-columns: minmax(0, 1fr); box-sizing: border-box; justify-self: center; }
.login-card > *, .login-card label { min-width: 0; }
.login-card input, .login-card select { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; font-size: 14px; font-weight: 400; }
.login-card select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8796' stroke-width='2.5' 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 14px center; }
.login-card select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.login-card small { font-size: 12px; line-height: 1.4; font-weight: 400; }
.login-links { display: flex; justify-content: center; gap: 6px 14px; flex-wrap: wrap; }
.login-card .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 480px) { .login-card .two { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .login-page { padding-top: 68px; } .login-card { padding: 24px 20px; } }
.section-label { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); padding-top: 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.odoo-who { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.odoo-who .icon { color: var(--accent); }
.unlock-card { max-width: 480px; margin: 40px auto; padding: 24px; display: grid; gap: 14px; }
.unlock-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.unlock-card input { padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); }
.unlock-card small { color: var(--muted); }
.locked-hint { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); padding: 2px 12px 8px; }

/* ---------- Admin v3 ---------- */
.admin-sections { padding: 4px 0 12px; }
.admin-h { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 16px 16px 4px; }
.empty-state.small { padding: 24px 16px; }
.copy-row { display: flex; gap: 8px; }
.copy-row .input { flex: 1; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.modal-card.wide { width: min(720px, 100%); }
.modal-body .two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .modal-body .two { grid-template-columns: 1fr; } }
.settings-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; padding: 16px; }
@media (max-width: 1000px) { .settings-grid { grid-template-columns: 1fr; } }
.settings-card { padding: 18px; display: grid; gap: 12px; box-shadow: none; align-content: start; }
.settings-card .admin-h { margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.form-grid .input, .settings-card .input { width: 100%; }
.type-actions .input { max-width: 240px; }
.compact-admin { min-width: 760px; }

/* ---------- Company sign-in ---------- */
.company-found { min-height: 1em; font-size: 12px; }
.company-found.ok { color: var(--brand-green, #09a06f); font-weight: 600; }
.company-found.bad { color: #c0392b; }
.login-card .login-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: -4px; }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.code-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; color: var(--text-2); }
