:root {
  --nav: #071c29;
  --nav-soft: #0c3142;
  --mint: #36d9b3;
  --mint-strong: #0d9275;
  --bg: #f4f7f8;
  --surface: #fff;
  --text: #142930;
  --muted: #71808a;
  --line: #e6ecee;
  --good: #16876c;
  --good-bg: #e5f8f1;
  --wait: #9a6b12;
  --wait-bg: #fff4dc;
  --bad: #c44756;
  --bad-bg: #ffecef;
  --shadow: 0 16px 40px rgba(12, 40, 52, 0.06);
  --sidebar: 268px;
  --font: Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: #128c73; text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 34px; letter-spacing: -0.04em; line-height: 1.15; }
h2 { font-size: 22px; letter-spacing: -0.03em; }
.skip-link { position: fixed; left: 8px; top: -40px; background: var(--mint); color: #04241c; padding: 8px 12px; z-index: 20; }
.skip-link:focus { top: 8px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(54, 217, 179, 0.7); outline-offset: 2px; }

.auth-shell { display: grid; grid-template-columns: 51% 49%; min-height: 100vh; }
.visual { position: relative; overflow: hidden; color: #f3fffb; background: radial-gradient(circle at 78% 48%, #174958, #092a3a 46%, #061b2a 100%); display: flex; flex-direction: column; justify-content: space-between; padding: 40px 62px; }
.visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #082334 8%, rgba(8, 35, 52, 0.72) 58%, transparent); pointer-events: none; }
.visual-top, .visual-copy, .visual-bottom { position: relative; z-index: 1; }
.visual-top { display: flex; gap: 12px; align-items: center; }
.visual-top img, .sidebar-brand img, .user-chip img { width: auto; height: 36px; max-width: 188px; border-radius: 0; object-fit: contain; background: transparent; }
.visual-top strong { font-size: 22px; letter-spacing: -0.05em; }
.visual-top small { margin-left: 10px; color: #8abdb6; letter-spacing: 0.14em; font-size: 10px; font-weight: 800; }
.orb { position: absolute; width: 760px; right: -300px; top: 18%; opacity: 0.72; z-index: 0; }
.overline { display: flex; align-items: center; gap: 10px; color: #8ae6d0; letter-spacing: 0.18em; font-size: 11px; font-weight: 800; margin-bottom: 18px; }
.overline.dark { color: #19917a; letter-spacing: 0.16em; margin-bottom: 8px; }
.overline.light { color: #b7fff0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 6px rgba(53, 231, 181, 0.15); }
.visual h1 { font-size: clamp(44px, 5vw, 72px); max-width: 640px; margin-bottom: 18px; }
.visual p, .intro { color: #bbd0d2; max-width: 430px; }
.intro { color: #7a8c94; }
.visual-points { display: grid; gap: 10px; margin-top: 28px; color: #a6d9cb; }
.visual-bottom, .auth-main footer { color: #739ba8; font-size: 12px; }
.auth-main { display: flex; flex-direction: column; background: #fbfcfc; padding: 32px 54px; }
.main-top, .auth-main footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; color: #84979e; font-size: 12px; }
.pill, .pill-soft { display: inline-flex; padding: 7px 10px; border-radius: 8px; background: #e7f7f1; color: #0f856d; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; }
.form-wrap { width: min(450px, 100%); margin: auto; }
.auth-badge { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; background: #dcf8ec; color: #168c71; margin-bottom: 18px; }
.auth-main h2 { font-size: 42px; letter-spacing: -0.05em; margin: 0 0 10px; }
.info-note, .note { border: 1px solid #cfe7dc; background: #ebf9f3; color: #347e6d; border-radius: 10px; padding: 10px 12px; font-size: 12px; margin: 0 0 16px; }
.note.warn { background: #fff6e8; border-color: #f0ddb6; color: #8a5b10; }
.note.danger, .env-banner { background: #eef8f4; border: 1px solid #d5eee4; color: #1d6b59; border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }
.note.danger { background: #fff1f2; border-color: #f3c9ce; color: #8d303c; display: block; }
.field { display: grid; gap: 8px; margin-bottom: 16px; }
.field span, .field label, .filters label { font-size: 12px; font-weight: 750; }
.field input, .field select, .field textarea, .filters input, .stack input, .stack select, .stack textarea, .modal input {
  width: 100%; border: 1px solid #dce6e9; border-radius: 10px; padding: 12px 14px; background: #fff; color: #17393c;
}
.field textarea, .stack textarea { min-height: 90px; }
.password-field { position: relative; }
.password-field input { width: 100%; padding-right: 70px; }
.password-field button, .linkish { position: absolute; right: 8px; top: 8px; border: 0; background: #ecf7f4; color: #2c8b75; border-radius: 7px; padding: 8px; }
.linkish { position: static; background: none; padding: 0; }
.split { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.submit, .btn.primary { border: 0; border-radius: 11px; background: #123f3e; color: white; min-height: 48px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; }
.submit { width: 100%; }
.submit:hover, .btn.primary:hover { background: #0c6553; }
.response { display: none; margin-top: 14px; padding: 12px; border-radius: 9px; background: #fff8ea; color: #986c30; border: 1px solid #f1dbc3; }
.response.show { display: block; }
.otp-row { display: flex; gap: 10px; margin: 8px 0 18px; }
.otp-row input { width: 100%; height: 58px; text-align: center; font-size: 22px; font-weight: 800; border-radius: 11px; border: 1px solid #dce6e9; }

.shell { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar); background: linear-gradient(180deg, #061b29, #08222c); color: #c5d5d8; position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 5; }
.sidebar-brand { display: flex; gap: 10px; align-items: center; color: white; padding: 22px 20px 8px; }
.sidebar-brand strong { display: block; letter-spacing: -0.04em; font-size: 18px; }
.sidebar-brand small { color: #83bcb1; letter-spacing: 0.16em; font-size: 9px; font-weight: 800; }
.sidebar-scroll { padding: 12px; overflow: auto; }
.nav-label { margin: 16px 10px 6px; color: #7f9aa3; font-size: 10px; letter-spacing: 0.16em; font-weight: 800; }
.nav-item { display: flex; align-items: center; gap: 10px; color: #d5e4e6; border-radius: 12px; padding: 10px 12px; margin-bottom: 2px; }
.nav-item.active, .nav-item:hover { background: #123f3e; color: white; }
.nav-item em { margin-left: auto; background: #e45866; color: white; border-radius: 999px; min-width: 18px; text-align: center; font-style: normal; font-size: 11px; padding: 0 5px; }
.workspace { margin-left: var(--sidebar); min-width: 0; flex: 1; }
.topbar { height: 74px; display: flex; align-items: center; gap: 12px; padding: 0 22px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 3; }
.crumb { display: grid; min-width: 140px; }
.crumb span, .updated, .muted, .card header p, .kpi small { color: var(--muted); }
.crumb span { font-size: 12px; }
.search { flex: 1; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #f7fafb; border-radius: 999px; padding: 10px 14px; color: var(--muted); }
.search kbd { margin-left: auto; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; font-size: 11px; }
.icon-btn, .user-chip { border: 1px solid var(--line); background: white; border-radius: 12px; min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.user-chip { gap: 8px; padding: 0 10px 0 4px; width: auto; }
.user-chip img { height: 26px; filter: brightness(0); }
.user-chip span { display: grid; text-align: left; }
.user-chip small { color: var(--muted); font-size: 11px; }
.menu { display: none; }
.content { padding: 22px 26px 48px; }
.page-head, .section-head, .button-row, .filters { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.page-head { margin-bottom: 16px; }
.page-head .eyebrow, .eyebrow { color: var(--mint-strong); letter-spacing: 0.14em; font-size: 11px; font-weight: 800; }
.page-head p { color: var(--muted); max-width: 640px; }
.hero { position: relative; overflow: hidden; color: white; border-radius: 22px; padding: 28px; margin-bottom: 16px; background: radial-gradient(circle at 80% 40%, #1c5c6d, #0c3344 55%, #082433); min-height: 230px; }
.hero img { position: absolute; width: 460px; right: -40px; top: -20px; opacity: 0.55; pointer-events: none; }
.hero-copy { position: relative; z-index: 1; max-width: 560px; }
.hero h2 { font-size: 32px; max-width: 460px; }
.hero p { color: #d5ebe8; }
.hero-stats { position: relative; z-index: 1; display: flex; gap: 10px; margin-top: 18px; }
.hero-stats div { background: rgba(8, 30, 40, 0.45); border: 1px solid rgba(255,255,255,0.08); border-radius: 14px; padding: 12px 14px; min-width: 140px; }
.hero-stats strong { display: block; font-size: 22px; }
.hero-stats span, .kpi small { font-size: 12px; }
.kpi-grid, .split-grid, .triple { display: grid; gap: 14px; margin-bottom: 14px; }
.kpi-grid { grid-template-columns: repeat(4, 1fr); }
.kpi-grid.slim { grid-template-columns: repeat(4, 1fr); }
.split-grid { grid-template-columns: 1.3fr 0.9fr; }
.triple { grid-template-columns: repeat(3, 1fr); }
.kpi, .card { background: var(--surface); border: 1px solid #edf2f3; border-radius: 18px; box-shadow: var(--shadow); }
.kpi { padding: 16px; }
.kpi strong { display: block; font-size: 28px; letter-spacing: -0.04em; margin: 4px 0; }
.kpi.amber strong { color: var(--wait); }
.kpi.teal strong { color: var(--good); }
.card { padding: 16px 16px 8px; }
.chart-empty { min-height: 180px; border-radius: 14px; background: linear-gradient(#f7fbfb, #fff); display: grid; place-items: center; text-align: center; color: var(--muted); padding: 20px; }
.table-wrap { overflow: auto; }
.data { width: 100%; border-collapse: collapse; }
.data th { text-align: left; font-size: 11px; letter-spacing: 0.08em; color: #8aa0a6; padding: 8px; }
.data td { padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: top; }
.data small, .mono { display: block; color: var(--muted); font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 8px; background: #eef3f4; color: #49616a; font-size: 11px; font-weight: 750; }
.badge.good { background: var(--good-bg); color: var(--good); }
.badge.wait { background: var(--wait-bg); color: var(--wait); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.btn, .text-link { border-radius: 10px; border: 1px solid var(--line); background: white; color: var(--text); padding: 8px 12px; display: inline-flex; gap: 6px; align-items: center; }
.btn.tiny { padding: 6px 10px; font-size: 12px; }
.btn.danger, .submit.danger { background: #8d303c; color: white; border-color: transparent; }
.btn:disabled, .submit:disabled { opacity: 0.6; cursor: wait; }
.text-link { border: 0; background: none; color: var(--mint-strong); padding: 0; }
.empty, .skeleton { color: var(--muted); padding: 12px 0 18px; }
.attention, .feed, .snapshot, .meters { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.attention li, .feed li, .snapshot li, .meters li { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.filters { margin-bottom: 10px; }
.filters input { max-width: 320px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.modal-mask { position: fixed; inset: 0; background: rgba(7, 24, 34, 0.46); display: grid; place-items: center; z-index: 30; padding: 20px; }
.modal { width: min(560px, 100%); background: white; border-radius: 18px; padding: 22px; box-shadow: var(--shadow); }
/* A dialog taller or wider than the window scrolls inside itself, so its buttons stay reachable on small or zoomed screens (owner, 7 Nov 2026). */
.modal { max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain; overflow-wrap: anywhere; }
.sidebar-mask { position: fixed; inset: 0; border: 0; background: rgba(0,0,0,0.35); z-index: 4; }
.search-results { display: grid; gap: 6px; margin-top: 12px; }
.search-results a { display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: 10px; color: var(--text); }
.search-results a:hover { background: #f3faf7; }
.account-card dl { display: grid; gap: 8px; }
.account-card div { display: flex; justify-content: space-between; gap: 12px; }
#toast { position: fixed; right: 16px; bottom: 16px; background: #123f3e; color: white; padding: 12px 14px; border-radius: 12px; display: none; z-index: 40; max-width: 360px; }
#toast.show { display: block; }
#toast.danger { background: #8d303c; }

/* Headquarters oversight */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.range-form { justify-content: flex-start; align-items: flex-end; }
.filters select { border: 1px solid #dce6e9; border-radius: 10px; padding: 8px 10px; margin-left: 8px; background: #fff; max-width: 100%; }
.unavailable strong { display: block; margin-bottom: 4px; }
.skeleton-card { min-height: 104px; background: linear-gradient(90deg, #f2f6f7, #fbfdfd, #f2f6f7); }
.skeleton-block { min-height: 180px; margin-bottom: 14px; background: linear-gradient(90deg, #f2f6f7, #fbfdfd, #f2f6f7); }
.hq-chart { margin: 0 0 12px; }
.hq-chart svg { width: 100%; max-width: 640px; height: auto; }
.hq-chart-label, .hq-chart-value { font-size: 12px; fill: var(--text); }
.hq-chart-bar { fill: var(--mint-strong); }
.hq-chart-bar.wait { fill: #d39a2c; }
.hq-chart-bar.bad { fill: var(--bad); }
.checklist { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 12px; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.card h3 { font-size: 15px; margin: 12px 0 6px; }

@media (max-width: 1100px) {
  .kpi-grid, .kpi-grid.slim, .triple, .split-grid { grid-template-columns: 1fr 1fr; }
  .search span, .search kbd, .user-chip span { display: none; }
}
@media (max-width: 800px) {
  .auth-shell { display: block; }
  .visual { min-height: 220px; padding: 22px; }
  .visual h1 { font-size: 34px; }
  .visual-points, .visual-bottom, .orb { display: none; }
  .auth-main { padding: 22px; }
  .sidebar { transform: translateX(-105%); }
  .sidebar.mobile-open { transform: none; }
  .workspace { margin-left: 0; }
  .menu { display: inline-flex; }
  .kpi-grid, .kpi-grid.slim, .triple, .split-grid, .hero-stats { grid-template-columns: 1fr; display: grid; }
  .content, .topbar { padding-left: 14px; padding-right: 14px; }
  h1 { font-size: 28px; }
}

/* Family tabs: the pages that sit together under one sidebar entry. */
.family-tabs { display: flex; gap: 4px; margin: 0 0 18px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow-x: auto; scrollbar-width: thin; }
.family-tabs a { flex: 0 0 auto; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-weight: 650; font-size: 13px; text-decoration: none; white-space: nowrap; }
.family-tabs a:hover { color: var(--text); background: var(--bg); }
.family-tabs a.active { background: var(--nav); color: white; }
.family-tabs a:focus-visible { outline: 2px solid var(--mint-strong); outline-offset: 2px; }
.family-tabs em { font-style: normal; font-size: 11px; background: #e45866; color: white; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.icon-btn.bell { position: relative; }
.bell-count { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #e45866; color: white; font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.sub-head { font-size: 14px; margin: 18px 0 8px; color: var(--text); }
.detail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; margin: 12px 0; }
.detail-list dt { font-size: 12px; color: var(--muted); }
.detail-list dd { margin: 2px 0 0; overflow-wrap: anywhere; }
