/* Dialer console — design system. No inline styles anywhere (CSP style-src 'self'). */
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/InterVariable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "DejaVu Sans Mono", "Liberation Mono", monospace;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #f1f3f6;
  --hover: #f3f5f8;
  --border: #e3e6eb;
  --border-strong: #cfd4dc;
  --text: #111827;
  --text-2: #3f4856;
  --text-3: #667085;
  --text-4: #98a2b3;
  --primary: #2454e6;
  --primary-hover: #1c45c4;
  --primary-soft: #eef3ff;
  --primary-soft-2: #dbe5ff;
  --primary-text: #1d46c8;
  --success: #12a150;
  --success-soft: #eaf8ef;
  --success-text: #08703a;
  --warning: #e08a00;
  --warning-soft: #fff6e5;
  --warning-text: #9a5b00;
  --danger: #d92d20;
  --danger-soft: #fef1f0;
  --danger-text: #b42318;
  --info: #2454e6;
  --info-soft: #eef3ff;
  --info-text: #1d46c8;
  --neutral-soft: #f1f3f6;
  --focus: 0 0 0 3px rgba(36, 84, 230, 0.28);
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 18px 40px -12px rgba(16, 24, 40, 0.22), 0 4px 10px -4px rgba(16, 24, 40, 0.08);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --sidebar: 252px;
  /* Charts (validated palette: blue / orange, neutral gray for "unknown"). */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-neutral: #a6a49e;
  --chart-grid: #ececea;
  --chart-axis: #c9c8c1;
  --chart-ink: #7d7b75;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1b1f27;
  --surface-3: #222732;
  --hover: #1f242e;
  --border: #2a303b;
  --border-strong: #3a4250;
  --text: #f2f4f7;
  --text-2: #c9ced8;
  --text-3: #98a1b0;
  --text-4: #6b7485;
  --primary: #4d7cff;
  --primary-hover: #6a91ff;
  --primary-soft: #1b2440;
  --primary-soft-2: #24315a;
  --primary-text: #9db7ff;
  --success: #2ec26a;
  --success-soft: #11291c;
  --success-text: #6fdc9b;
  --warning: #f2a516;
  --warning-soft: #2c2210;
  --warning-text: #f8c564;
  --danger: #f0574b;
  --danger-soft: #331716;
  --danger-text: #ff938a;
  --info: #4d7cff;
  --info-soft: #1b2440;
  --info-text: #9db7ff;
  --neutral-soft: #222732;
  --focus: 0 0 0 3px rgba(77, 124, 255, 0.4);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, 0.7);
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-neutral: #6f6e69;
  --chart-grid: #262a31;
  --chart-axis: #3a3f48;
  --chart-ink: #8d929c;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3,
h4,
p {
  margin: 0;
}
h1 {
  font-size: 24px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 16px;
  font-weight: 620;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 14px;
  font-weight: 620;
}
a {
  color: var(--primary-text);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}
code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
}
.num {
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--text-3);
}
.small {
  font-size: 12.5px;
}
.strong {
  font-weight: 600;
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.spacer {
  flex: 1;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.row-wrap {
  flex-wrap: wrap;
}
.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}
.stack-sm {
  display: grid;
  gap: 8px;
  align-content: start;
}
.stack-lg {
  display: grid;
  gap: 24px;
  align-content: start;
}
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

/* ---------- Boot ---------- */
.boot {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--text-3);
}
.boot-inner {
  display: grid;
  justify-items: center;
  gap: 14px;
}

/* ---------- App shell ---------- */
.app {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 30;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 18px 14px;
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.03em;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
}
.brand-mark .icon {
  width: 17px;
  height: 17px;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0;
}
.env-pill {
  margin: 0 14px 6px;
  padding: 7px 10px;
  border-radius: var(--radius);
  background: var(--warning-soft);
  color: var(--warning-text);
  font-size: 12px;
  font-weight: 550;
  display: flex;
  gap: 8px;
  align-items: center;
}
.env-pill .icon {
  width: 15px;
  height: 15px;
}
.nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 16px;
}
.nav-group {
  margin-top: 14px;
}
.nav-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-4);
  padding: 4px 10px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-weight: 500;
  position: relative;
}
.nav-link:hover {
  background: var(--hover);
  color: var(--text);
  text-decoration: none;
}
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary-text);
}
.nav-link .icon {
  color: var(--text-3);
}
.nav-link.active .icon {
  color: var(--primary-text);
}
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 650;
  display: grid;
  place-items: center;
}
.nav-badge.soft {
  background: var(--warning-soft);
  color: var(--warning-text);
}
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px;
}
.user-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.user-btn:hover {
  background: var(--hover);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft-2);
  color: var(--primary-text);
  font-weight: 650;
  display: grid;
  place-items: center;
  flex: none;
  text-transform: uppercase;
}
.user-btn strong {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}
.user-btn small {
  color: var(--text-3);
  font-size: 12px;
}
.main {
  margin-left: var(--sidebar);
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .menu-toggle {
  display: none;
}
.pill-link:hover {
  text-decoration: none;
}
.table .col-main {
  min-width: 260px;
  max-width: 460px;
}
.table .cell-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  min-width: 0;
}
.table .cell-status {
  flex-wrap: wrap;
}
.table .cell-status .small {
  white-space: normal;
  max-width: 380px;
  line-height: 1.35;
}
.topsearch {
  position: relative;
  width: min(360px, 40vw);
}
.topsearch .icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-4);
  width: 16px;
  height: 16px;
}
.topsearch input {
  width: 100%;
  height: 36px;
  padding: 0 46px 0 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.topsearch input::placeholder {
  color: var(--text-4);
}
.topsearch kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
kbd {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text-3);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 5px;
  background: var(--surface-2);
}
.status-cluster {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
}
a.pill:hover {
  text-decoration: none;
  border-color: var(--border-strong);
}
.pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-4);
}
.pill.ok .dot {
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-soft);
}
.pill.warn .dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px var(--warning-soft);
}
.pill.bad .dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.pill .num {
  color: var(--text);
}
.pulse .dot {
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 6px transparent;
  }
}
.page {
  padding: 28px 28px 56px;
  max-width: 1440px;
}
.page-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head > div:first-child {
  flex: 1;
  min-width: 240px;
}
.page-head p {
  color: var(--text-3);
  margin-top: 4px;
  max-width: 760px;
}
.page-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 8px;
}
.crumbs a {
  color: var(--text-3);
}
.crumbs .icon {
  width: 14px;
  height: 14px;
}
.title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-3);
}
.meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.meta .icon {
  width: 15px;
  height: 15px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 560;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.btn:hover {
  text-decoration: none;
}
.btn .icon {
  width: 16px;
  height: 16px;
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-xs);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}
.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--hover);
}
.btn-ghost {
  background: transparent;
  color: var(--text-2);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover:not(:disabled) {
  filter: brightness(0.94);
}
.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  filter: brightness(0.95);
}
.btn-warning {
  background: var(--surface);
  color: var(--warning-text);
  border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
}
.btn-warning:hover:not(:disabled) {
  background: var(--warning-soft);
}
.btn-sm {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
}
.btn-lg {
  height: 42px;
  padding: 0 18px;
  font-size: 14.5px;
}
.btn-block {
  width: 100%;
}
.btn-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--primary-text);
  font-weight: 560;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-link:hover {
  text-decoration: underline;
}
.btn-link .icon {
  width: 15px;
  height: 15px;
}
.icon-btn {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: var(--radius);
  color: var(--text-3);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover {
  background: var(--hover);
  color: var(--text);
}
.icon-btn .icon {
  width: 17px;
  height: 17px;
}
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
.spinner-lg {
  width: 28px;
  height: 28px;
  border-width: 3px;
  color: var(--primary);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px 0;
  flex-wrap: wrap;
}
.card-head > div:first-child {
  flex: 1;
  min-width: 180px;
}
.card-head p {
  color: var(--text-3);
  font-size: 13px;
  margin-top: 2px;
}
.card-body {
  padding: 16px 20px 20px;
}
.card-body.flush {
  padding: 12px 0 0;
}
.card-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.card-section + .card-section {
  border-top: 1px solid var(--border);
}
.card-highlight {
  border-color: var(--primary-soft-2);
  background: linear-gradient(180deg, var(--primary-soft), var(--surface) 70%);
}

/* ---------- KPI tiles ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
  display: grid;
  gap: 4px;
  min-width: 0;
  position: relative;
}
.tile-label {
  font-size: 12.5px;
  color: var(--text-3);
  font-weight: 550;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tile-label .icon {
  width: 15px;
  height: 15px;
}
.tile-value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.tile-value small {
  font-size: 13px;
  font-weight: 550;
  color: var(--text-3);
  margin-left: 4px;
  letter-spacing: 0;
}
.tile-sub {
  font-size: 12.5px;
  color: var(--text-3);
}
.tile .spark {
  width: 100%;
  height: 30px;
  margin-top: 4px;
}
.tile.is-accent {
  border-color: var(--primary-soft-2);
}
.tile .meter {
  margin-top: 6px;
}
.tile a.tile-link {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}
.tile a.tile-link:hover {
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

/* ---------- Chips & callouts ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 560;
  white-space: nowrap;
  background: var(--neutral-soft);
  color: var(--text-2);
}
.chip .icon {
  width: 13px;
  height: 13px;
}
.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip-success {
  background: var(--success-soft);
  color: var(--success-text);
}
.chip-warning {
  background: var(--warning-soft);
  color: var(--warning-text);
}
.chip-danger {
  background: var(--danger-soft);
  color: var(--danger-text);
}
.chip-info {
  background: var(--info-soft);
  color: var(--info-text);
}
.chip-muted {
  background: transparent;
  color: var(--text-3);
  box-shadow: inset 0 0 0 1px var(--border);
}
.chip-lg {
  height: 26px;
  padding: 0 11px;
  border-radius: 13px;
  font-size: 12.5px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--neutral-soft);
  color: var(--text-3);
  vertical-align: middle;
}
.tag-primary {
  background: var(--primary-soft);
  color: var(--primary-text);
}
.callout {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  align-items: flex-start;
}
.callout > .icon {
  margin-top: 1px;
}
.callout-body {
  flex: 1;
  min-width: 0;
}
.callout strong {
  display: block;
  font-weight: 620;
}
.callout p {
  color: var(--text-2);
  font-size: 13.5px;
}
.callout-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  align-self: center;
}
.callout-success {
  background: var(--success-soft);
  border-color: color-mix(in srgb, var(--success) 25%, transparent);
}
.callout-success > .icon {
  color: var(--success);
}
.callout-warning {
  background: var(--warning-soft);
  border-color: color-mix(in srgb, var(--warning) 30%, transparent);
}
.callout-warning > .icon {
  color: var(--warning);
}
.callout-danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 25%, transparent);
}
.callout-danger > .icon {
  color: var(--danger);
}
.callout-info {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info) 22%, transparent);
}
.callout-info > .icon {
  color: var(--info);
}
.callout-neutral > .icon,
.callout-muted > .icon {
  color: var(--text-3);
}
.callout-compact {
  padding: 9px 12px;
  font-size: 13px;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 12px;
  color: var(--text-3);
  font-weight: 560;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover {
  color: var(--text);
  text-decoration: none;
}
.tab.active {
  color: var(--primary-text);
  border-bottom-color: var(--primary);
}
.tab .icon {
  width: 16px;
  height: 16px;
}
.tab .count {
  font-size: 11.5px;
  background: var(--neutral-soft);
  color: var(--text-3);
  border-radius: 9px;
  padding: 0 6px;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border-radius: var(--radius);
  background: var(--surface-3);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.segmented button,
.segmented a {
  border: 0;
  background: transparent;
  padding: 5px 11px;
  border-radius: 6px;
  font-weight: 560;
  font-size: 13px;
  color: var(--text-3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.segmented button:hover,
.segmented a:hover {
  color: var(--text);
  text-decoration: none;
}
.segmented .on {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.segmented .count {
  color: var(--text-4);
  font-size: 12px;
}

/* ---------- Tables ---------- */
.table-wrap {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  background: var(--surface-2);
  padding: 9px 14px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table th:first-child,
.table td:first-child {
  padding-left: 20px;
}
.table th:last-child,
.table td:last-child {
  padding-right: 20px;
}
.table .r {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.table .c {
  text-align: center;
}
.table tbody tr.clickable {
  cursor: pointer;
}
.table tbody tr:hover td {
  background: var(--surface-2);
}
.table .cell-main {
  font-weight: 580;
  color: var(--text);
}
.table .cell-main:hover {
  text-decoration: none;
  color: var(--primary-text);
}
.table .cell-sub {
  display: block;
  font-size: 12.5px;
  color: var(--text-3);
  max-width: 420px;
}
.table .actions {
  text-align: right;
  white-space: nowrap;
}
.table .actions > * {
  vertical-align: middle;
}
.table tfoot td {
  font-weight: 620;
  background: var(--surface-2);
  border-top: 1px solid var(--border);
}
.table-compact td {
  padding: 8px 14px;
}
.table-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-3);
  font-size: 13px;
  flex-wrap: wrap;
}
.dept-code {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-weight: 650;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-right: 8px;
}
.dept-code.off {
  background: var(--neutral-soft);
  color: var(--text-3);
}
.bar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.bar-track {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-3);
  overflow: hidden;
  min-width: 60px;
}
.bar-track span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--series-1);
}
.bar-track.off span {
  background: var(--text-4);
}

/* ---------- Forms ---------- */
.form {
  display: grid;
  gap: 16px;
}
.field {
  display: grid;
  gap: 6px;
  min-width: 0;
  align-content: start;
}
.field > label,
.label {
  font-weight: 560;
  font-size: 13.5px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.optional {
  font-weight: 450;
  color: var(--text-4);
  font-size: 12.5px;
}
.input,
.select,
.textarea {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}
.textarea.mono {
  font-size: 13px;
}
.select {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667085' 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 10px center;
  background-size: 16px;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--focus);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-4);
}
.input:disabled,
.select:disabled {
  background: var(--surface-3);
  color: var(--text-3);
}
.input-sm,
.select-sm {
  height: 32px;
  font-size: 13px;
}
.input.invalid,
.textarea.invalid {
  border-color: var(--danger);
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .input {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.input-group .addon {
  display: grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 13px;
  white-space: nowrap;
}
.field-help {
  font-size: 12.5px;
  color: var(--text-3);
}
.field-help strong {
  color: var(--text-2);
}
.field-warn {
  font-size: 12.5px;
  color: var(--warning-text);
  display: flex;
  gap: 6px;
  align-items: flex-start;
}
.field-warn .icon {
  width: 15px;
  height: 15px;
  margin-top: 1px;
}
.form-error {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--danger-soft);
  color: var(--danger-text);
  font-size: 13.5px;
}
.form-error .icon {
  width: 17px;
  height: 17px;
  margin-top: 1px;
}
.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.form-row-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: grid;
  gap: 14px;
}
.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  font-weight: 500;
}
.checkbox input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--primary);
  flex: none;
}
.checkbox small {
  display: block;
  color: var(--text-3);
  font-weight: 450;
  font-size: 12.5px;
}
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.switch-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.15s;
  flex: none;
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s;
}
.switch input:checked + .switch-track {
  background: var(--success);
}
.switch input:checked + .switch-track::after {
  transform: translateX(16px);
}
.switch input:focus-visible + .switch-track {
  box-shadow: var(--focus);
}
.switch input:disabled + .switch-track {
  opacity: 0.5;
}
.days {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.day-toggle {
  position: relative;
}
.day-toggle input {
  position: absolute;
  opacity: 0;
}
.day-toggle span {
  display: grid;
  place-items: center;
  width: 48px;
  height: 38px;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-3);
  cursor: pointer;
  background: var(--surface);
  user-select: none;
}
.day-toggle input:checked + span {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.day-toggle input:focus-visible + span {
  box-shadow: var(--focus);
}
.choice-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.choice {
  position: relative;
  display: block;
  cursor: pointer;
}
.choice input {
  position: absolute;
  opacity: 0;
}
.choice span {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  font-weight: 560;
}
.choice small {
  display: block;
  font-weight: 450;
  color: var(--text-3);
  font-size: 12.5px;
  margin-top: 2px;
}
.choice input:checked + span {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: var(--primary-soft);
}
.choice input:focus-visible + span {
  box-shadow: var(--focus);
}

/* ---------- Dropzone & import ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 26px;
  text-align: center;
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  display: grid;
  gap: 6px;
  justify-items: center;
}
.dropzone:hover,
.dropzone.drag {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone .icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
}
.dropzone strong {
  font-size: 14.5px;
}
.dropzone input {
  display: none;
}
.file-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
}
.file-card > .icon {
  width: 26px;
  height: 26px;
  color: var(--primary);
}
.preview-list {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  max-height: 160px;
  overflow: auto;
}
.preview-list div {
  display: flex;
  gap: 10px;
  justify-content: space-between;
}
.preview-list span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.preview-list .icon {
  width: 13px;
  height: 13px;
  color: var(--success);
}
.preview-list .bad {
  color: var(--danger-text);
}
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--surface-3);
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s;
}
.progress.done span {
  background: var(--success);
}
.progress.indeterminate span {
  width: 35%;
  animation: indeterminate 1.2s ease-in-out infinite;
}
@keyframes indeterminate {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(300%);
  }
}
.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 13px;
  color: var(--text-3);
}
.counts b {
  color: var(--text);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
}

/* ---------- Meter ---------- */
.meter {
  height: 6px;
  border-radius: 3px;
  background: var(--primary-soft-2);
  overflow: hidden;
}
.meter span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
}
.meter-warning {
  background: var(--warning-soft);
}
.meter-warning span {
  background: var(--warning);
}
.meter-danger {
  background: var(--danger-soft);
}
.meter-danger span {
  background: var(--danger);
}

/* ---------- Charts ---------- */
.chart-box {
  position: relative;
  min-height: 120px;
}
.chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart .grid {
  stroke: var(--chart-grid);
  stroke-width: 1;
}
.chart .baseline {
  stroke: var(--chart-axis);
  stroke-width: 1;
}
.chart .axis {
  fill: var(--chart-ink);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.chart .line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart .area {
  stroke: none;
  opacity: 0.1;
}
.chart .ref {
  stroke: var(--text-4);
  stroke-width: 1;
}
.chart .ref-label {
  fill: var(--text-3);
  font-size: 11px;
}
.chart .dot {
  stroke: var(--surface);
  stroke-width: 2;
}
.chart .crosshair {
  stroke: var(--text-4);
  stroke-width: 1;
}
.chart .hit {
  fill: transparent;
  cursor: crosshair;
}
.chart .col-hit {
  cursor: default;
}
.chart .col-hit.on {
  fill: var(--text);
  fill-opacity: 0.04;
}
.chart .hit:focus {
  outline: none;
}
.line.s-1,
.spark-line {
  stroke: var(--series-1);
}
.spark-line {
  fill: none;
  stroke: var(--text-4);
  stroke-width: 1.5;
}
.area.s-1,
.dot.s-1,
.bar.s-1,
.key.s-1 {
  fill: var(--series-1);
  background: var(--series-1);
}
.line.s-2 {
  stroke: var(--series-2);
}
.area.s-2,
.dot.s-2,
.bar.s-2,
.key.s-2 {
  fill: var(--series-2);
  background: var(--series-2);
}
.bar.s-n,
.key.s-n {
  fill: var(--series-neutral);
  background: var(--series-neutral);
}
.spark .dot {
  stroke: var(--surface);
  stroke-width: 1.5;
}
.chart-empty {
  display: grid;
  place-items: center;
  min-height: 140px;
  color: var(--text-3);
  font-size: 13px;
  text-align: center;
  padding: 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}
.chart-tip {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 12.5px;
  min-width: 120px;
  display: grid;
  gap: 2px;
}
.chart-tip strong {
  font-size: 15px;
  font-weight: 650;
}
.chart-tip small,
.chart-tip span {
  color: var(--text-3);
}
.tip-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tip-row strong {
  font-size: 13px;
  min-width: 48px;
  font-variant-numeric: tabular-nums;
}
.tip-total {
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 4px;
  color: var(--text-2);
  font-weight: 560;
}
.key {
  display: inline-block;
  width: 12px;
  height: 3px;
  border-radius: 2px;
  flex: none;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.legend li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.legend .key {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}
.legend .key-line {
  height: 3px;
  width: 14px;
}

/* ---------- Modal, drawer, menu, toasts ---------- */
dialog.modal {
  border: 0;
  padding: 0;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}
dialog.modal:not([open]) {
  display: none;
}
dialog.modal::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
}
.modal-sm {
  width: min(440px, calc(100vw - 32px)) !important;
}
.modal-lg {
  width: min(780px, calc(100vw - 32px)) !important;
}
.modal-xl {
  width: min(980px, calc(100vw - 32px)) !important;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 12px;
}
.modal-head > div {
  flex: 1;
}
.modal-head h2 {
  font-size: 17px;
}
.modal-sub {
  color: var(--text-3);
  font-size: 13.5px;
  margin-top: 3px;
}
.modal-body {
  padding: 4px 20px 20px;
  overflow-y: auto;
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 14px 14px;
}
.confirm {
  display: flex;
  gap: 14px;
}
.confirm-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--info-soft);
  color: var(--info);
}
.confirm-danger .confirm-icon {
  background: var(--danger-soft);
  color: var(--danger);
}
.confirm-warning .confirm-icon {
  background: var(--warning-soft);
  color: var(--warning);
}
.confirm p {
  color: var(--text-2);
}
.confirm-details {
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-3);
}
.confirm-details ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
dialog.drawer {
  margin: 0 0 0 auto;
  height: 100vh;
  max-height: 100vh;
  width: min(520px, 100vw) !important;
  border-radius: 0;
  animation: slide-in 0.18s ease-out;
}
dialog.drawer .modal-foot {
  border-radius: 0;
}
@keyframes slide-in {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
}
.menu {
  position: fixed;
  z-index: 1000;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 5px;
}
.menu-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: var(--text);
  font-weight: 500;
}
.menu-item small {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 450;
}
.menu-item .icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
  margin-top: 2px;
}
.menu-item:hover:not(:disabled),
.menu-item:focus-visible {
  background: var(--hover);
  box-shadow: none;
}
.menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.menu-item.danger,
.menu-item.danger .icon {
  color: var(--danger-text);
}
.menu-sep {
  height: 1px;
  background: var(--border);
  margin: 5px 0;
}
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2000;
  display: grid;
  gap: 10px;
  width: min(400px, calc(100vw - 40px));
}
.toast {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.18s ease-out;
}
.toast.leaving {
  opacity: 0;
  transform: translateY(6px);
  transition: 0.18s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
.toast-icon .icon {
  width: 20px;
  height: 20px;
}
.toast-success .toast-icon {
  color: var(--success);
}
.toast-error .toast-icon {
  color: var(--danger);
}
.toast-info .toast-icon {
  color: var(--info);
}
.toast-warning .toast-icon {
  color: var(--warning);
}
.toast-body {
  flex: 1;
  min-width: 0;
}
.toast-body strong {
  display: block;
}
.toast-body p {
  color: var(--text-2);
  font-size: 13.5px;
}
.toast-close {
  width: 26px;
  height: 26px;
}

/* ---------- Empty, skeleton, hints ---------- */
.empty {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 40px 20px;
  color: var(--text-3);
}
.empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--text-3);
  margin-bottom: 4px;
}
.empty-icon .icon {
  width: 22px;
  height: 22px;
}
.empty h3 {
  color: var(--text);
  font-size: 15px;
}
.empty p {
  max-width: 440px;
}
.empty .btn {
  margin-top: 8px;
}
.empty-error .empty-icon {
  background: var(--danger-soft);
  color: var(--danger);
}
.skeleton {
  display: grid;
  gap: 10px;
  padding: 16px 20px;
}
.skeleton span {
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}
.skeleton span:nth-child(3n + 2) {
  width: 82%;
}
.skeleton span:nth-child(3n) {
  width: 64%;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.hint {
  position: relative;
  display: inline-grid;
  color: var(--text-4);
  cursor: help;
  vertical-align: middle;
}
.hint .icon {
  width: 15px;
  height: 15px;
}
.hint:hover,
.hint:focus {
  color: var(--text-2);
}
[data-tip]:hover::after,
[data-tip]:focus::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  width: max-content;
  max-width: 300px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background: #111827;
  color: #f9fafb;
  font-size: 12.5px;
  font-weight: 450;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}

/* ---------- Lists & misc components ---------- */
.list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.list-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
}
.list-item:first-child {
  border-top: 0;
}
.icon-wrap {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--surface-3);
  color: var(--text-3);
}
.icon-wrap .icon {
  width: 17px;
  height: 17px;
}
.icon-wrap.warning {
  background: var(--warning-soft);
  color: var(--warning);
}
.icon-wrap.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.icon-wrap.success {
  background: var(--success-soft);
  color: var(--success);
}
.icon-wrap.info {
  background: var(--info-soft);
  color: var(--info);
}
.list-body {
  flex: 1;
  min-width: 0;
}
.list-body p {
  color: var(--text-3);
  font-size: 13px;
}
.list-meta {
  font-size: 12px;
  color: var(--text-4);
  white-space: nowrap;
}
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.step {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
}
.step:hover {
  background: var(--surface-2);
}
.step-mark {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: grid;
  place-items: center;
  font-weight: 650;
  font-size: 13px;
  color: var(--text-3);
  flex: none;
}
.step.done .step-mark {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.step.done .step-mark .icon {
  width: 15px;
  height: 15px;
}
.step.next .step-mark {
  border-color: var(--primary);
  color: var(--primary-text);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
.step-body {
  flex: 1;
  min-width: 0;
}
.step-body p {
  color: var(--text-3);
  font-size: 13px;
}
.step.done .step-body strong {
  color: var(--text-2);
}
.kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  margin: 0;
  font-size: 13.5px;
}
.kv dt {
  color: var(--text-3);
}
.kv dd {
  margin: 0;
  font-weight: 520;
  min-width: 0;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  gap: 10px;
  padding-bottom: 14px;
  position: relative;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline li:last-child::before {
  display: none;
}
.timeline .tl-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 4px 0 0 3px;
  background: var(--border-strong);
}
.timeline .tl-dot.on {
  background: var(--primary);
}
.timeline .tl-dot.ok {
  background: var(--success);
}
.timeline .tl-dot.bad {
  background: var(--danger);
}
.timeline small {
  color: var(--text-3);
  display: block;
}
.timeline time {
  color: var(--text-3);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.code-block {
  position: relative;
  background: #0f1729;
  color: #dbe4ff;
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}
.code-block .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  color: #9fb0d8;
}
.code-block .copy-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.secret {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px dashed var(--border-strong);
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 13px;
  word-break: break-all;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
}
.section-title h2 {
  flex: 1;
}
.divider {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 4px 0;
}
.wizard-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-weight: 560;
  font-size: 13px;
}
.wizard-step .step-mark {
  width: 24px;
  height: 24px;
  font-size: 12px;
}
.wizard-step.current {
  color: var(--text);
}
.wizard-step.current .step-mark {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.wizard-step.done .step-mark {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.wizard-step .icon {
  width: 13px;
  height: 13px;
}
.wizard-sep {
  width: 28px;
  height: 1px;
  background: var(--border-strong);
  align-self: center;
}
.dept-picker {
  display: grid;
  gap: 12px;
}
.dept-regions {
  max-height: 360px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.dept-region {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
}
.dept-region:first-child {
  border-top: 0;
}
.dept-region-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 13px;
}
.dept-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.dept-opt {
  position: relative;
}
.dept-opt input {
  position: absolute;
  opacity: 0;
}
.dept-opt span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-2);
}
.dept-opt span b {
  font-variant-numeric: tabular-nums;
  background: var(--surface-3);
  border-radius: 4px;
  padding: 0 5px;
  color: var(--text);
}
.dept-opt input:checked + span {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-text);
}
.dept-opt input:checked + span b {
  background: var(--primary);
  color: #fff;
}
.dept-opt input:disabled + span {
  opacity: 0.55;
  cursor: not-allowed;
}
.dept-opt input:focus-visible + span {
  box-shadow: var(--focus);
}
.selected-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  align-items: center;
}
.recap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.recap-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
}
.recap-item small {
  color: var(--text-3);
  display: block;
  font-size: 12px;
  font-weight: 560;
  margin-bottom: 2px;
}
.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.status-line p {
  color: var(--text-3);
  font-size: 13px;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink {
  50% {
    opacity: 0.35;
  }
}
.help-content h2 {
  margin: 0 0 8px;
}
.help-content p,
.help-content li {
  color: var(--text-2);
}
.help-content ul,
.help-content ol {
  margin: 6px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 4px;
}
.toc {
  position: sticky;
  top: 84px;
  display: grid;
  gap: 2px;
}
.toc a {
  color: var(--text-3);
  padding: 6px 10px;
  border-radius: 6px;
  font-weight: 520;
}
.toc a:hover {
  background: var(--hover);
  color: var(--text);
  text-decoration: none;
}
.glossary {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 18px;
  margin: 8px 0 0;
}
.glossary dt {
  font-weight: 600;
}
.glossary dd {
  margin: 0;
  color: var(--text-2);
}

/* ---------- Login ---------- */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.login-aside {
  background: radial-gradient(1200px 600px at -10% -10%, #3b6cff 0%, transparent 55%), linear-gradient(160deg, #1638b8 0%, #0d1f6b 100%);
  color: #fff;
  padding: 44px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}
.login-aside .brand {
  color: #fff;
  padding: 0;
}
.login-aside .brand-mark {
  background: rgba(255, 255, 255, 0.16);
}
.login-aside .brand small {
  color: rgba(255, 255, 255, 0.7);
}
.login-aside h1 {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.03em;
  max-width: 460px;
}
.login-aside p {
  color: rgba(255, 255, 255, 0.78);
  margin-top: 12px;
  max-width: 460px;
  font-size: 15px;
}
.login-points {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
  max-width: 460px;
}
.login-points li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.9);
}
.login-points .icon {
  width: 20px;
  height: 20px;
  padding: 2px;
  margin-top: 1px;
  color: #b9cbff;
}
.login-foot {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.6);
}
.login-main {
  display: grid;
  place-items: center;
  padding: 32px;
  background: var(--surface);
}
.login-card {
  width: min(380px, 100%);
  display: grid;
  gap: 18px;
}
.login-card h2 {
  font-size: 22px;
  letter-spacing: -0.02em;
}
.login-card .muted {
  margin-top: 4px;
}
.password-wrap {
  position: relative;
}
.password-wrap .input {
  padding-right: 42px;
}
.password-wrap .icon-btn {
  position: absolute;
  right: 3px;
  top: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 960px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar {
    transform: none;
  }
  .app.nav-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 25;
  }
  .main {
    margin-left: 0;
  }
  .topbar .menu-toggle {
    display: inline-grid;
  }
  .topbar {
    padding: 0 16px;
  }
  .page {
    padding: 20px 16px 48px;
  }
  .status-cluster .pill-optional {
    display: none;
  }
  .login {
    grid-template-columns: 1fr;
  }
  .login-aside {
    display: none;
  }
}
@media (max-width: 720px) {
  .grid-2,
  .grid-3,
  .form-row,
  .form-row-3 {
    grid-template-columns: minmax(0, 1fr);
  }
  .topsearch {
    width: auto;
    flex: 1;
  }
  .topsearch kbd {
    display: none;
  }
  .status-cluster .pill-text {
    display: none;
  }
  h1 {
    font-size: 21px;
  }
  .glossary {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
@media print {
  .sidebar,
  .topbar,
  .page-actions {
    display: none;
  }
  .main {
    margin: 0;
  }
}

/* ---------- Additions ---------- */
.status-banner {
  margin-top: 16px;
}
.card .form-error {
  margin: 0 20px 16px;
}
.chip .icon-btn {
  width: 18px;
  height: 18px;
  margin-right: -4px;
  color: inherit;
}
.chip .icon-btn .icon {
  width: 12px;
  height: 12px;
}
.card-head .select,
.card-head .input,
.card-foot .select,
.card-foot .input {
  width: auto;
}
.card-head input[type="search"] {
  min-width: 240px;
}
.card-head > .segmented:first-child {
  flex: 0 1 auto;
  min-width: 0;
}
.phone {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.help-content > section {
  scroll-margin-top: 80px;
}
.toc .card-body {
  display: grid;
  gap: 2px;
}
.card-head > .icon-wrap + div {
  flex: 1;
  min-width: 180px;
}
.row > .input,
.row > .select {
  width: auto;
}
.row > .grow {
  flex: 1 1 auto;
  min-width: 0;
}
.card > .card-body.flush:first-child {
  padding-top: 0;
}
.card > .card-body.flush:first-child .table th {
  border-top: 0;
}
.card > .card-body.flush:first-child .table-wrap {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.form > div:empty {
  display: none;
}
.input-cps {
  max-width: 170px;
}
.env-pill.env-danger {
  background: var(--danger-soft);
  color: var(--danger-text);
}
.mode-card {
  display: grid;
  gap: 6px;
  align-content: start;
  justify-items: start;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
}
.mode-card small {
  color: var(--text-3);
  font-size: 12.5px;
}
.mode-card.on {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
  background: var(--primary-soft);
}
.mode-card.on.danger {
  border-color: var(--danger);
  box-shadow: inset 0 0 0 1px var(--danger);
  background: var(--danger-soft);
}
.card-danger {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}
.list-item.check-item {
  padding: 6px 0;
  border-top: 0;
  align-items: center;
}
.check-item .icon-wrap {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.check-item .icon-wrap .icon {
  width: 14px;
  height: 14px;
}
.table .col-campaign {
  max-width: 340px;
}
.icon-btn-outline {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
}
