:root {
  --navy: #071a4f;
  --navy-deep: #04102f;
  --cobalt: #124cc7;
  --sky: #74b8ee;
  --mist: #eef4fb;
  --paper: #f8fafc;
  --ink: #172033;
  --slate: #61708a;
  --line: #d5e0ed;
  --success: #15755c;
  --warning: #b35b0a;
  --danger: #ad3030;
  --shadow: 0 18px 54px rgba(7, 26, 79, .13);
  font-family: Bahnschrift, "Aptos", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #e5a932; outline-offset: 3px; }
button:disabled { cursor: wait; opacity: .65; }
input { width: 100%; border: 1px solid #aebfd3; border-radius: 4px; padding: 11px 12px; color: var(--ink); background: #fff; }
input:focus { border-color: var(--cobalt); box-shadow: 0 0 0 3px rgba(18, 76, 199, .13); outline: none; }
label { display: grid; gap: 6px; color: #273750; font-size: .82rem; font-weight: 700; }
button:not(.quiet-button) { border: 0; border-radius: 4px; padding: 12px 16px; background: var(--cobalt); color: #fff; font-weight: 800; letter-spacing: .01em; box-shadow: 0 7px 15px rgba(18, 76, 199, .21); }
button:not(.quiet-button):hover { background: #0d3c9f; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(1.65rem, 3vw, 2.7rem); line-height: 1.05; letter-spacing: -.045em; }
h2 { margin-bottom: 10px; font-size: 1.05rem; letter-spacing: -.02em; }
.shell { min-height: 100vh; }
.eyebrow { margin-bottom: 8px; color: var(--cobalt); font-family: "Arial Narrow", Bahnschrift, sans-serif; font-size: .69rem; font-weight: 800; letter-spacing: .15em; }
.eyebrow.light { color: #b9d4ff; }
.login-view { display: grid; grid-template-columns: minmax(350px, .9fr) minmax(420px, 1.1fr); min-height: 100vh; }
.login-panel { display: flex; flex-direction: column; justify-content: center; width: min(470px, calc(100% - 60px)); margin: auto; padding: 52px 0; }
.brand-lockup img { display: block; width: min(255px, 88%); height: auto; }
.brand-lockup .eyebrow { margin-top: 18px; }
.intro { max-width: 34rem; color: var(--slate); line-height: 1.55; }
.form-stack { display: grid; gap: 16px; margin-top: 26px; }
.form-message { min-height: 1.25em; margin-top: 15px; color: var(--danger); font-size: .89rem; font-weight: 600; }
.form-message.success { color: var(--success); }
.security-note { margin: 18px 0 0; color: var(--slate); font-size: .77rem; line-height: 1.45; }
.security-note.dark { color: #697d98; }
.signal-panel { position: relative; overflow: hidden; display: grid; min-height: 480px; background: radial-gradient(circle at 80% 28%, #1f63d1, var(--navy) 48%, var(--navy-deep)); color: #fff; }
.signal-grid { position: absolute; inset: 0; opacity: .23; background-image: linear-gradient(rgba(185, 212, 255, .45) 1px, transparent 1px), linear-gradient(90deg, rgba(185, 212, 255, .45) 1px, transparent 1px); background-size: 52px 52px; transform: skewY(-6deg) scale(1.2); }
.signal-content { z-index: 1; align-self: center; padding: clamp(44px, 8vw, 110px); max-width: 660px; }
.signal-content h2 { margin: 18px 0; font-size: clamp(2rem, 4vw, 4.6rem); line-height: .95; letter-spacing: -.065em; }
.signal-content > p:not(.eyebrow) { max-width: 390px; color: #d6e6ff; line-height: 1.6; }
.pulse-line { display: flex; gap: 7px; align-items: center; height: 44px; margin: 31px 0 5px; }
.pulse-line span { display: block; width: 8px; border-radius: 999px; background: #f1b642; animation: pulse 1.7s ease-in-out infinite; }
.pulse-line span:nth-child(1), .pulse-line span:nth-child(5) { height: 13px; }
.pulse-line span:nth-child(2), .pulse-line span:nth-child(4) { height: 28px; animation-delay: .15s; }
.pulse-line span:nth-child(3) { height: 43px; background: #fff; animation-delay: .3s; }
@keyframes pulse { 50% { transform: scaleY(.3); opacity: .44; } }
@media (prefers-reduced-motion: reduce) { .pulse-line span { animation: none; } }
.health-chip { display: inline-flex; align-items: center; margin-top: 27px; border: 1px solid rgba(255,255,255,.25); padding: 8px 12px; color: #e8f0ff; font-family: "Arial Narrow", Bahnschrift, sans-serif; font-size: .76rem; font-weight: 700; letter-spacing: .07em; }
.health-chip::before, .status-dot { content: ""; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: #e5a932; box-shadow: 0 0 0 3px rgba(229,169,50,.18); }
.health-chip.good::before, .status-dot.good { background: #39c696; box-shadow: 0 0 0 3px rgba(57,198,150,.18); }
.health-chip.bad::before, .status-dot.bad { background: #ff776c; box-shadow: 0 0 0 3px rgba(255,119,108,.18); }

.app-view { min-height: 100vh; background: var(--paper); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 78px; padding: 15px clamp(20px, 4vw, 58px); background: var(--navy); color: white; }
.brand-lockup.compact { display: flex; align-items: center; gap: 17px; color: #dceaff; text-decoration: none; font-family: "Arial Narrow", Bahnschrift, sans-serif; font-size: .71rem; font-weight: 800; letter-spacing: .12em; }
.brand-lockup.compact img { width: 124px; max-height: 42px; object-fit: contain; object-position: left; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.operator { display: grid; margin-right: 9px; text-align: right; }
.operator-label { color: #9fb7df; font-family: "Arial Narrow", sans-serif; font-size: .63rem; font-weight: 700; letter-spacing: .1em; }
.operator strong { font-size: .86rem; }
.quiet-button { border: 1px solid currentColor; border-radius: 4px; padding: 8px 10px; color: inherit; background: transparent; font-size: .78rem; font-weight: 750; }
.quiet-button:hover { background: rgba(255,255,255,.1); }
.workspace { display: grid; grid-template-columns: 222px minmax(0, 1fr); min-height: calc(100vh - 78px); }
.side-nav { display: flex; flex-direction: column; gap: 5px; padding: 29px 18px; background: #e8eef6; border-right: 1px solid var(--line); }
.nav-link { padding: 10px 12px; border-left: 3px solid transparent; color: #485975; text-decoration: none; font-size: .85rem; font-weight: 700; }
.nav-link:hover, .nav-link.active { border-left-color: var(--cobalt); color: var(--navy); background: rgba(255,255,255,.62); }
.nav-footer { display: flex; align-items: center; margin-top: auto; padding: 14px 12px 0; color: var(--slate); font-size: .75rem; line-height: 1.25; }
.status-dot { flex: 0 0 auto; margin: 0 8px 0 0; }
.content { max-width: 1460px; padding: clamp(28px, 4vw, 64px); overflow: hidden; }
.app-message { min-height: 1.2em; margin-bottom: 16px; color: var(--danger); font-size: .88rem; font-weight: 650; }
.app-message.success { color: var(--success); }
.page-section { scroll-margin-top: 20px; padding-bottom: 70px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h1 { margin: 0; }
.updated-at, .section-note { max-width: 390px; margin: 0; color: var(--slate); font-size: .82rem; line-height: 1.5; text-align: right; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; }
.metric-card { min-height: 148px; padding: 20px; border: 1px solid var(--line); border-top: 4px solid #8295b2; background: #fff; box-shadow: 0 5px 14px rgba(33,55,89,.035); }
.metric-card.cobalt { border-top-color: var(--cobalt); }
.metric-card.amber { border-top-color: #e09629; }
.metric-card.wide { grid-column: span 2; }
.metric-card span { display: block; color: var(--slate); font-family: "Arial Narrow", Bahnschrift, sans-serif; font-size: .69rem; font-weight: 800; letter-spacing: .1em; }
.metric-card strong { display: block; margin: 18px 0 5px; color: var(--navy); font-size: 2.5rem; line-height: .8; letter-spacing: -.065em; }
.metric-card small { color: var(--slate); font-size: .76rem; }
.event-panel, .panel { border: 1px solid var(--line); background: #fff; box-shadow: 0 5px 14px rgba(33,55,89,.035); }
.event-panel { margin-top: 18px; }
.panel { padding: 22px; }
.panel-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.panel-heading h2 { margin: 0; }
.panel-heading span { color: var(--slate); font-family: "Arial Narrow", sans-serif; font-size: .71rem; font-weight: 800; letter-spacing: .1em; }
.audit-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 16px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.audit-list li { display: grid; gap: 4px; padding: 14px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.audit-list li:nth-child(3n) { border-right: 0; }
.event-time { color: var(--slate); font-family: "Arial Narrow", sans-serif; font-size: .67rem; font-weight: 800; letter-spacing: .08em; }
.event-name { color: var(--navy); font-size: .84rem; font-weight: 750; word-break: break-word; }
.event-actor { color: var(--slate); font-size: .72rem; }
.empty-state { color: var(--slate); font-size: .85rem; font-style: italic; }
.users-layout { display: grid; grid-template-columns: minmax(270px, .65fr) minmax(450px, 1.35fr); gap: 18px; align-items: start; }
.create-user-panel { position: sticky; top: 16px; }
.optional { color: var(--slate); font-weight: 500; }
.table-wrap { overflow-x: auto; margin: 13px -3px -3px; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
th { padding: 10px 9px; border-bottom: 1px solid var(--line); color: var(--slate); font-family: "Arial Narrow", sans-serif; font-size: .67rem; text-align: left; letter-spacing: .1em; }
td { padding: 12px 9px; border-bottom: 1px solid #e8eef5; vertical-align: middle; }
td strong { display: block; color: var(--navy); }
td small { color: var(--slate); }
.state-badge { display: inline-flex; border-radius: 999px; padding: 4px 8px; font-size: .68rem; font-weight: 800; }
.state-badge.active { color: #0f5c48; background: #daf4e9; }
.state-badge.inactive { color: #8c2828; background: #fae2e2; }
.state-badge.locked { color: #8a510a; background: #ffeed1; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.row-actions button { padding: 6px 8px; border: 1px solid #b8c6d6; border-radius: 3px; background: #fff; color: var(--navy); font-size: .7rem; font-weight: 750; }
.row-actions button:hover { border-color: var(--cobalt); color: var(--cobalt); }
.password-panel { display: flex; align-items: end; justify-content: space-between; gap: 25px; margin-top: 18px; background: #fff9ef; border-color: #edcc9e; }
.password-panel h2 { margin: 0; }
.password-form { display: flex; align-items: end; gap: 9px; min-width: min(100%, 470px); }
.password-form label { flex: 1; }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(190px, 1fr)); gap: 13px; }
.setting-card { padding: 19px; border: 1px solid var(--line); background: #fff; }
.setting-card span { display: block; color: var(--slate); font-family: "Arial Narrow", sans-serif; font-size: .68rem; font-weight: 800; letter-spacing: .1em; }
.setting-card strong { display: block; margin-top: 11px; color: var(--navy); font-size: 1.6rem; line-height: 1; letter-spacing: -.04em; }
.scope-notice { display: flex; gap: 9px; margin-top: 14px; padding: 15px 17px; border-left: 4px solid var(--cobalt); background: #eaf1ff; color: #34486a; font-size: .82rem; line-height: 1.5; }

@media (max-width: 920px) { .login-view { grid-template-columns: 1fr; } .signal-panel { min-height: 370px; grid-row: 1; } .login-panel { width: min(540px, calc(100% - 44px)); } .workspace { grid-template-columns: 1fr; } .side-nav { position: sticky; top: 0; z-index: 5; flex-direction: row; overflow-x: auto; padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--line); } .nav-footer { display: none; } .nav-link { white-space: nowrap; } .content { padding: 29px 21px; } .users-layout { grid-template-columns: 1fr; } .create-user-panel { position: static; } }
@media (max-width: 670px) { .topbar { align-items: flex-start; flex-direction: column; } .topbar-actions { width: 100%; justify-content: flex-end; } .operator { margin-right: auto; text-align: left; } .brand-lockup.compact span { display: none; } .section-heading, .password-panel { align-items: flex-start; flex-direction: column; } .updated-at, .section-note { text-align: left; } .metric-grid, .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .metric-card.wide { grid-column: span 2; } .audit-list { grid-template-columns: 1fr; } .audit-list li, .audit-list li:nth-child(3n) { border-right: 0; } .password-form { width: 100%; flex-direction: column; align-items: stretch; } }
@media (max-width: 420px) { .metric-grid, .settings-grid { grid-template-columns: 1fr; } .metric-card.wide { grid-column: span 1; } .topbar-actions { flex-wrap: wrap; } }
