:root {
  --bg: #e8e4da;
  --surface: #fbf8f2;
  --surface-2: #f3efe6;
  --ink: #102033;
  --ink-2: #3a4654;
  --mute: #6b7380;
  --line: #ddd6c8;
  --line-2: #c9c1b2;
  --sea: #1a5c58;
  --sea-2: #134743;
  --sea-soft: #e4efee;
  --copper: #b56a32;
  --navy: #0c1a28;
  --ok: #1b6b43;
  --ok-soft: #e5f3eb;
  --warn: #9a6408;
  --warn-soft: #f7eed8;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --shadow: 0 1px 1px rgba(16,32,51,.04), 0 16px 40px rgba(16,32,51,.06);
  --radius: 14px;
  --sidebar: 252px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(26,92,88,.08), transparent 50%),
    var(--bg);
  color: var(--ink);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  font-size: 15.5px;
  line-height: 1.45;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--sea); text-decoration: none; }
a:hover { color: var(--sea-2); text-decoration: underline; text-underline-offset: 3px; }
.mono, code, .stat-val, th, input, select, textarea {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
}

.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 22px 14px 16px;
  background: var(--navy);
  color: #d7ddd8;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 10px 22px; }
.brand img { width: 32px; height: 32px; }
.brand-mark {
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 22px; font-weight: 600; letter-spacing: -0.03em; color: #fff;
}
.brand-sub { font-size: 11px; color: #8b9590; margin-top: 1px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-group {
  margin: 18px 10px 6px;
  font-size: 10px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: #6d7873;
}
.nav a {
  color: #c5cdc8; text-decoration: none;
  padding: 8px 10px; border-radius: 9px; font-size: 14.5px;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav a.active { background: var(--sea); color: #fff; }
.rail-foot {
  margin-top: auto; padding: 14px 10px 4px;
  border-top: 1px solid rgba(255,255,255,.08);
  color: #8b9590; font-size: 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.rail-foot form { margin: 0; }

.stage { padding: 32px 40px 72px; max-width: 1220px; }
.top {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 24px;
}
.kicker {
  margin: 0 0 6px; font-size: 12px; font-weight: 650;
  letter-spacing: .08em; text-transform: uppercase; color: var(--copper);
}
h1 {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 34px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.1;
}
.meta { color: var(--mute); font-size: 13px; text-align: right; line-height: 1.5; }

.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(4, 1fr); }
.stats-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: 1.35fr .95fr; }
.hours {
  display: flex; align-items: flex-end; gap: 6px;
  height: 120px; padding: 8px 0 0;
}
.hour { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; height: 100%; }
.hour-col {
  flex: 1; width: 100%; display: flex; align-items: flex-end;
  background: var(--surface-2); border-radius: 4px 4px 0 0;
}
.hour-col span {
  display: block; width: 100%; background: var(--sea);
  border-radius: 4px 4px 0 0; min-height: 2px;
}
.hour-lab { font-family: "IBM Plex Mono", monospace; font-size: 10px; color: var(--mute); margin-top: 4px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}
.card h2 {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--mute);
}
.stat-val { font-size: 28px; font-weight: 500; letter-spacing: -0.04em; color: var(--ink); }
.stat-label { margin-top: 6px; color: var(--mute); font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; font-size: 11px; font-weight: 500; letter-spacing: .04em;
  text-transform: uppercase; color: var(--mute);
  padding: 8px 12px 8px 0; border-bottom: 1px solid var(--ink);
}
td {
  padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line);
  color: var(--ink-2); vertical-align: middle;
}
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--surface-2); }

.lamp {
  display: inline-block; width: 8px; height: 8px; border-radius: 99px;
  margin-right: 8px; background: var(--mute); vertical-align: 1px;
}
.lamp.ok { background: var(--ok); }
.lamp.warn { background: var(--warn); }
.lamp.bad { background: var(--bad); }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 99px; padding: 2px 8px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.btn, button, input[type=submit] {
  appearance: none; font-family: inherit; font-size: 14px; font-weight: 650;
  background: var(--sea); color: #fff; border: 1px solid transparent;
  border-radius: 10px; padding: 9px 14px; cursor: pointer;
}
.btn:hover, button:hover { background: var(--sea-2); }
.btn.ghost, button.ghost {
  background: transparent; color: var(--ink); border-color: var(--line-2);
}
.btn.ghost:hover, button.ghost:hover { background: var(--surface-2); }
.btn.danger, button.danger { background: var(--bad); }
form.inline { display: inline; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 650; color: var(--ink-2); }
input, select, textarea {
  width: 100%; background: #fff; color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 9px 11px; font-size: 13.5px;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--sea);
  box-shadow: 0 0 0 3px rgba(26,92,88,.16);
}
textarea { min-height: 132px; resize: vertical; font-family: inherit; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.search { max-width: 280px; }

.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.login-hero {
  background:
    linear-gradient(165deg, rgba(26,92,88,.35), transparent 42%),
    var(--navy);
  color: #e6ebe7; padding: 56px 56px 40px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.login-hero h1 {
  font-size: clamp(40px, 4.6vw, 58px); color: #fff; max-width: 12ch;
}
.login-hero p { color: #b4beb8; font-size: 17px; max-width: 34ch; }
.login-card {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px 11vw;
  background: var(--surface);
}
.login-card h2 {
  margin: 0 0 6px;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 32px; font-weight: 600;
}
.err { background: var(--bad-soft); color: var(--bad); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.okmsg { background: var(--ok-soft); color: var(--ok); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; }
.empty { color: var(--mute); padding: 18px 0; }
.pill {
  display: inline-flex; border-radius: 99px; background: var(--sea-soft);
  padding: 2px 8px; font-size: 12px; color: var(--sea);
  font-family: "IBM Plex Mono", monospace;
}
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.lock-banner {
  background: var(--bad-soft); border: 1px solid #f0c4bf;
  border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px;
}
.lock-banner h2 { color: var(--bad); margin: 0 0 6px; text-transform: none; letter-spacing: 0; font-size: 16px; }

.attn { display: flex; flex-direction: column; gap: 10px; }
.attn a.rowish {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit;
}
.attn a.rowish:hover { color: var(--sea); }
.attn .n { font-family: "IBM Plex Mono", monospace; font-size: 20px; }

.filters {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr auto;
  gap: 10px 12px;
  align-items: end;
}
.filters .field { margin: 0; }
a.badge { text-decoration: none; }
a.badge:hover { text-decoration: none; filter: brightness(0.97); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset:disabled { opacity: .72; }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: relative; height: auto; flex-direction: row; flex-wrap: wrap; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-group { display: none; }
  .rail-foot { margin-left: auto; border: 0; padding-top: 0; }
  .stats, .stats-3, .cards-2, .form-grid, .login, .filters { grid-template-columns: 1fr; }
  .stage { padding: 20px 16px 48px; }
  .login-hero { min-height: 260px; padding: 32px 24px; }
  .login-card { padding: 32px 20px 48px; }
}
