:root {
  color-scheme: light;
  --navy: #082a46;
  --navy-2: #0d3b5f;
  --blue: #0878bd;
  --ink: #172536;
  --muted: #647487;
  --line: #dbe5ee;
  --surface: #fff;
  --canvas: #f3f7fa;
  --green: #198754;
  --amber: #c87500;
  --red: #c12d36;
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
[hidden] { display: none !important; }

.center-screen {
  min-height: 100vh; display: grid; place-content: center; text-align: center;
  padding: 32px; background: radial-gradient(circle at 50% 15%, #fff, #edf4f8 65%);
}
.center-screen h1 { margin: 6px 0 10px; font-size: clamp(32px, 5vw, 54px); }
.center-screen p { color: var(--muted); max-width: 560px; }
.spinner { width: 52px; height: 52px; margin: 0 auto 22px; border: 4px solid #d5e3ec; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.shield { margin: 0 auto 18px; width: 58px; height: 64px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 30px; background: var(--red); clip-path: polygon(50% 0, 94% 16%, 86% 72%, 50% 100%, 14% 72%, 6% 16%); }

.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; }
.eyebrow.danger { color: var(--red); }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, monospace; }

.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); }
.brand-panel { padding: clamp(48px, 8vw, 120px); display: flex; flex-direction: column; justify-content: center; color: #fff; background: linear-gradient(135deg, rgba(5,35,58,.96), rgba(8,74,112,.91)), radial-gradient(circle at 85% 10%, #2c91c2, transparent 45%); }
.brand-panel .eyebrow { color: #8ed5ff; }
.brand-panel h1 { max-width: 720px; margin: 12px 0 20px; font-size: clamp(42px, 5vw, 72px); line-height: 1.02; letter-spacing: -.04em; }
.brand-panel > p:not(.eyebrow) { max-width: 660px; color: #d5e7f2; font-size: 18px; line-height: 1.6; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 30px; border-radius: 15px; background: #fff; color: var(--navy); font-size: 34px; font-weight: 900; box-shadow: 0 16px 30px rgba(0,0,0,.16); }
.brand-mark.small { width: 38px; height: 38px; margin: 0; border-radius: 10px; font-size: 22px; box-shadow: none; }
.proof-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.proof-row span { padding: 9px 13px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; color: #d9ecf8; font-size: 13px; }
.login-card { align-self: center; width: min(440px, calc(100% - 48px)); margin: auto; padding: 42px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: 0 24px 70px rgba(30,55,75,.12); }
.login-card h2 { margin: 4px 0 8px; font-size: 32px; }
.login-card > p:not(.eyebrow):not(.form-error) { color: var(--muted); margin-bottom: 28px; }
label { display: grid; gap: 7px; margin: 15px 0; color: #425469; font-size: 13px; font-weight: 700; }
input, select { width: 100%; padding: 12px 14px; border: 1px solid #cbd8e3; border-radius: 10px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(8,120,189,.12); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 0; border-radius: 10px; cursor: pointer; text-decoration: none; font-weight: 800; }
.button.primary { width: 100%; margin-top: 12px; color: #fff; background: var(--blue); }
.button.secondary { color: var(--blue); border: 1px solid #b9d2e2; background: #fff; }
.form-error { color: var(--red); font-size: 13px; }

.topbar { height: 70px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; color: #fff; background: var(--navy); box-shadow: 0 4px 18px rgba(8,42,70,.16); }
.brand { display: flex; align-items: center; gap: 12px; }
.brand strong, .brand span { display: block; }
.brand span { margin-top: 2px; color: #a9c7da; font-size: 12px; }
.header-actions { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.user-chip { padding: 7px 11px; border-radius: 999px; background: rgba(255,255,255,.12); }
.text-button { border: 0; color: #d7e8f2; background: transparent; cursor: pointer; }
.content { max-width: 1500px; margin: auto; padding: 34px; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 20px; padding: 20px 2px 30px; }
.hero h1 { margin: 4px 0 10px; font-size: clamp(34px, 4vw, 54px); letter-spacing: -.04em; }
.hero p:not(.eyebrow) { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(160px, 1fr)); gap: 16px; }
.metric { padding: 20px; border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 14px; background: #fff; box-shadow: 0 10px 28px rgba(25,55,80,.05); }
.metric.good { border-top-color: var(--green); }
.metric.quiet { border-top-color: #8191a1; }
.metric.warning { border-top-color: var(--amber); }
.metric.danger { border-top-color: var(--red); }
.metric span, .metric small { display: block; color: var(--muted); }
.metric span { font-size: 13px; font-weight: 700; }
.metric strong { display: block; margin: 8px 0 3px; font-size: 38px; }
.metric small { font-size: 12px; }
.panel { margin-top: 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; overflow: hidden; }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; }
.filters { display: flex; gap: 10px; width: min(590px, 50%); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 18px; text-align: left; border-bottom: 1px solid #e8eef3; white-space: nowrap; }
th { color: #718194; background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: #f5f9fc; }
td strong, td span { display: block; }
td span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status.good { color: #137249; background: #e9f7f0; }
.status.warning { color: #9d5a00; background: #fff2dc; }
.status.quiet { color: #697887; background: #edf1f4; }
.empty { padding: 48px; color: var(--muted); text-align: center; }

dialog { width: min(840px, calc(100% - 30px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 100px rgba(6,32,52,.3); }
dialog::backdrop { background: rgba(7,29,47,.58); backdrop-filter: blur(3px); }
.dialog-card { position: relative; max-height: 86vh; overflow: auto; padding: 30px; }
.dialog-close { position: absolute; right: 20px; top: 16px; border: 0; background: transparent; color: #607184; font-size: 30px; cursor: pointer; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 20px 0; }
.detail { padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
.detail span, .detail strong { display: block; }
.detail span { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.detail strong { margin-top: 6px; overflow-wrap: anywhere; }
.assignment { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; padding: 15px; border-radius: 12px; background: #eef5f9; }
.assignment label { margin: 0; }
.events { display: grid; gap: 9px; }
.event { padding: 12px 14px; border-left: 3px solid var(--blue); background: #f8fafc; }
.event strong, .event span { display: block; }
.event span { margin-top: 4px; color: var(--muted); font-size: 12px; }

@media (max-width: 1000px) {
  .login-shell { grid-template-columns: 1fr; }
  .brand-panel { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-head { align-items: stretch; flex-direction: column; }
  .filters { width: 100%; }
}
@media (max-width: 650px) {
  .topbar { padding: 0 16px; }
  .header-actions .muted, .user-chip { display: none; }
  .content { padding: 20px 14px; }
  .hero { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr; }
  .filters { flex-direction: column; }
  .detail-grid { grid-template-columns: 1fr 1fr; }
  .assignment { grid-template-columns: 1fr; }
}
