:root {
  color-scheme: dark;
  --ink: #e5eff0;
  --muted: #a9bdc0;
  --faint: #789195;
  --line: #315259;
  --line-bright: #3b6970;
  --surface: #152d33;
  --surface-raised: #1a373d;
  --surface-deep: #10262c;
  --bg: #09191f;
  --navy: #d6e7e8;
  --blue: #78d3cf;
  --petrol: #4baba8;
  --green: #72d19c;
  --amber: #f0bf61;
  --red: #e98582;
  --shadow: 0 12px 30px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: var(--bg);
  background-image:
    linear-gradient(135deg, rgba(102, 150, 151, .026) 25%, transparent 25%, transparent 75%, rgba(102, 150, 151, .026) 75%),
    linear-gradient(45deg, rgba(102, 150, 151, .018) 25%, transparent 25%, transparent 75%, rgba(102, 150, 151, .018) 75%);
  background-size: 10px 10px;
}
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid #8cdad5; outline-offset: 2px; }

.shell { max-width: 1440px; margin: auto; padding: 22px 28px 48px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { font-size: 10px; letter-spacing: .15em; font-weight: 800; color: var(--blue); margin: 0 0 5px; }
.topbar h1 { font-size: clamp(27px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.1; margin: 0; }
.header-meta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.user-chip { font-weight: 700; color: var(--navy); }
.status-pill, .badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 750; }
.status-pill { background: #164d3d; color: var(--green); }
.status-pill:before { content: ""; width: 7px; height: 7px; background: var(--green); border-radius: 50%; }
.logout { font-weight: 750; text-decoration: none; }

.summary { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 34px; }
.summary-item, .card, .login-card {
  background-color: var(--surface);
  background-image: linear-gradient(135deg, rgba(143, 194, 193, .025), transparent 38%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.summary-item { position: relative; overflow: hidden; border-radius: 11px; padding: 15px 18px; }
.summary-item:before, .card:before { content: ""; position: absolute; top: 0; left: 18px; right: 18px; height: 1px; background: rgba(113, 193, 188, .38); }
.summary-label { display: block; color: var(--muted); font-size: 12px; }
.summary-value { display: block; font-size: 25px; font-weight: 780; letter-spacing: -.025em; margin-top: 3px; }

.section { margin-top: 30px; }
.section h2 { font-size: 18px; letter-spacing: -.025em; margin: 0 0 12px; color: var(--navy); }
.section-intro { color: var(--muted); margin: -6px 0 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(285px, 1fr)); gap: 16px; }
.card { position: relative; overflow: hidden; border-radius: 11px; padding: 19px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card h3 { font-size: 16px; line-height: 1.3; margin: 0; color: var(--navy); letter-spacing: -.02em; }
.card-body { margin: 16px 0; color: var(--ink); }
.card-state strong { color: var(--navy); font-size: 16px; }
.card-state p { margin: 5px 0; }
.card-lead { font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.card-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.card-list li { display: grid; gap: 2px; border-bottom: 1px solid rgba(73, 112, 117, .72); padding-bottom: 8px; }
.card-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.card-list span, .muted { color: var(--muted); }
.calendar-time { color: var(--blue); font-size: 13px; font-weight: 600; }
.calendar-label { display: inline-flex; margin-left: 5px; padding: 1px 6px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #315259; color: var(--ink); }
.calendar-biz { background: #245b78; color: #bfe9ff; }
.calendar-privates { background: #5d3b73; color: #efd8ff; }
.calendar-denise { background: #185740; color: var(--green); }

.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.metric-grid > div { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: rgba(31, 62, 67, .72); }
.metric-label { display: block; color: var(--muted); font-size: 12px; }
.metric-grid strong { display: block; font-size: 18px; overflow-wrap: anywhere; }

.archive-item { gap: 7px !important; }
.metric-grid + .card-list { margin-top: 14px; }
.archive-facts { color: var(--ink); font-weight: 400; line-height: 1.45; }
.archive-note { color: var(--muted); font-size: 13px; font-weight: 400; }
.archive-filename { color: var(--faint); font-size: 11px; line-height: 1.35; opacity: .7; overflow-wrap: anywhere; }
.archive-filename .pdf-button { opacity: 1; }
.pdf-button { display: inline-flex; align-items: center; justify-content: center; margin-right: 8px; padding: 2px 7px; border: 1px solid var(--petrol); border-radius: 5px; color: var(--blue); font-size: 11px; font-weight: 800; text-decoration: none; letter-spacing: .04em; }
.pdf-button:hover { background: var(--petrol); color: #092127; }

.diagnostic summary { color: var(--muted); font-size: 11px; cursor: pointer; width: max-content; }
.status-light { display: inline-block; width: 9px; height: 9px; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.status-light-unknown { background: var(--amber); box-shadow: 0 0 0 3px rgba(240, 191, 97, .13); }
meter { width: 72px; height: 8px; vertical-align: middle; accent-color: var(--petrol); }
.diagnostic { margin-top: 16px; color: var(--muted); font-size: 12px; }
.diagnostic code { display: block; max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; padding: 8px; background: var(--bg); border-radius: 6px; }
.card-footer { border-top: 1px solid rgba(73, 112, 117, .72); padding-top: 12px; color: var(--faint); font-size: 11px; display: grid; gap: 3px; }
.badge { padding: 4px 9px; font-size: 11px; }
.badge-ok { background: #185740; color: var(--green); }
.badge-unknown, .badge-open { background: #2a4147; color: #d2e1e1; }
.badge-stale, .badge-conflict { background: #5a491f; color: #f7d990; }
.badge-source_unavailable { background: #593438; color: #f2b8b4; }
.alert { padding: 11px 13px; border-radius: 8px; }
.alert-error { background: #552d31; border: 1px solid #a95758; color: #ffcbc7; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(100%, 430px); border-radius: 16px; padding: 36px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; background: var(--petrol); color: #092127; font-weight: 800; margin-bottom: 24px; }
.login-card h1 { margin: 0 0 8px; font-size: 28px; }
.login-card form { display: grid; gap: 8px; margin-top: 24px; }
.login-card label { font-weight: 650; margin-top: 8px; }
.login-card input { font: inherit; border: 1px solid #5e7d83; border-radius: 7px; padding: 11px 12px; background: #10242b; color: var(--ink); }
.button { border: 0; border-radius: 7px; padding: 11px 16px; font: inherit; font-weight: 700; cursor: pointer; margin-top: 12px; }
.button-primary { background: var(--petrol); color: #092127; }
.button-primary:hover { background: #70c3c0; }
.screen-reader { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 800px) { .shell { padding: 20px; } .summary { grid-template-columns: repeat(2, 1fr); } .topbar { align-items: flex-start; flex-direction: column; } .header-meta { justify-content: flex-start; } }
@media (max-width: 480px) { .shell { padding: 16px; } .summary { gap: 8px; } .summary-item { padding: 12px; } .summary-value { font-size: 22px; } .card-grid { grid-template-columns: 1fr; } .login-card { padding: 26px 22px; } }

.priority-low { background: #aec0c2; }
