:root {
  --navy: #0e2442;
  --navy-2: #16345a;
  --ink: #1b2b3a;
  --muted: #5d7082;
  --line: #d7e1e8;
  --cream: #fff8ec;
  --cream-2: #f6edd6;
  --gold: #e4c36a;
  --amber: #e8a317;
  --green: #2faf6a;
  --orange: #ef8b2a;
  --red: #e23d3d;
  --grey: #b7c3ce;
  --card: #ffffff;
  --shadow: 0 10px 28px rgba(16, 36, 64, 0.08);
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background-color: #e7eef3;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink);
}
a { color: inherit; }
button, input { font: inherit; }
h1, h2, h3, p { margin: 0; }

.wrap {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 4px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--navy);
  color: var(--amber);
  font-size: 18px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 14px; }
.brand-text span { color: var(--muted); font-size: 12px; font-weight: 700; }
.topbar nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.topbar nav a {
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
}
.topbar nav a[aria-current="page"] { color: var(--navy); background: rgba(255, 255, 255, 0.72); }
.topbar button, .login-card button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
}
.topbar button {
  background: var(--navy);
  color: white;
  padding: 8px 14px;
}
.topbar form { margin: 0; }

.demo-banner {
  background: #fff4d6;
  color: #6a4b00;
  border: 1px solid #efd48a;
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  margin-bottom: 14px;
}
.demo-banner[hidden] { display: none; }

.floor {
  position: relative;
  background-color: rgba(246, 249, 252, 0.78);
  background-image:
    linear-gradient(rgba(186, 201, 212, 0.45) 1px, transparent 1px),
    linear-gradient(90deg, rgba(186, 201, 212, 0.45) 1px, transparent 1px);
  background-size: 32px 32px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 26px 22px 46px;
  box-shadow: var(--shadow);
}

.director {
  width: min(460px, 100%);
  margin: 0 auto;
  text-align: center;
  color: white;
  background: linear-gradient(180deg, var(--navy-2), var(--navy));
  border-radius: 18px;
  padding: 14px 18px 16px;
  box-shadow: 0 12px 24px rgba(14, 36, 66, 0.22);
}
.director-icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 4px;
  color: white;
}
.person { width: 28px; height: 28px; }
.director h1 { font-size: 18px; font-weight: 800; }
.director p { margin-top: 4px; color: rgba(255, 255, 255, 0.76); font-size: 13px; font-weight: 650; }

.stem {
  width: 2px;
  height: 16px;
  margin: 0 auto;
  background: #c5d0da;
}

.chief-card {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none;
  background: linear-gradient(180deg, var(--cream), var(--cream-2));
  border: 2px solid var(--gold);
  border-radius: 18px;
  padding: 14px 18px;
  position: relative;
  box-shadow: 0 8px 20px rgba(180, 140, 40, 0.12);
}
.chief-card.selected { box-shadow: 0 0 0 3px rgba(232, 163, 23, 0.35), 0 8px 20px rgba(180, 140, 40, 0.12); }
.chief-copy { min-width: 0; }
.chief-card h2 { font-size: 20px; color: var(--navy); }
.chief-card p { color: #6d5b32; margin-top: 3px; font-size: 14px; }
.chief-card .focus { font-weight: 750; color: #8a6a28; }
.chief-card .dot { position: absolute; top: 12px; right: 12px; }

.desk { width: 64px; height: 50px; flex: 0 0 auto; }

.section-label {
  text-align: center;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #7d8d9c;
  font-size: 12px;
  font-weight: 800;
  margin: 22px 0 14px;
}

.stations {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.station {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  background: var(--card);
  border-radius: 20px;
  padding: 16px 12px 14px;
  min-height: 214px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}
.station.selected { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 163, 23, 0.28), var(--shadow); }
.station .dot { position: absolute; top: 12px; right: 12px; }
.station h3 {
  font-size: 14px;
  line-height: 1.25;
  margin-top: 8px;
  min-height: 2.5em;
  text-wrap: balance;
}
.emoji { margin-right: 2px; }
.remit { color: var(--muted); font-size: 13px; margin: 6px 0 12px; }
.pill {
  margin-top: auto;
  background: #f1f4f7;
  color: #5c6d7e;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  background: var(--grey);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8);
}
.dot-idle { background: var(--green); }
.dot-working {
  background: var(--amber);
  animation: pulse 1.8s ease-out infinite;
}
.dot-attention { background: var(--orange); }
.dot-blocked { background: var(--red); }
.dot-offline, .dot-none { background: var(--grey); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 163, 23, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(232, 163, 23, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 163, 23, 0); }
}

.plant {
  position: absolute;
  bottom: 8px;
  font-size: 26px;
  pointer-events: none;
}
.plant-left { left: 12px; }
.plant-right { right: 12px; }

.panels {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  margin-top: 16px;
}
.panel {
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.9);
}
.panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.panel h1, .panel h2 { font-size: 22px; color: var(--navy); }
.panel h3 { margin: 16px 0 8px; font-size: 15px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.reports, .summary, .status-note, .scope-note, .updated, .lede, .footnote, .fine, .checked {
  color: var(--muted);
}
.reports { margin-top: 8px; font-weight: 750; }
.summary { margin-top: 8px; line-height: 1.45; }
.status-note:empty { display: none; }
.status-note { margin-top: 6px; font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.stat {
  background: #f4f7fa;
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
}
.stat strong { display: block; font-size: 32px; color: var(--navy); }
.stat span { color: var(--muted); font-size: 13px; font-weight: 700; }
.detail ul { margin: 0; padding-left: 18px; }
.detail li { margin: 4px 0; }
.scope-note, .updated { margin-top: 12px; font-size: 13px; }
.checked { font-size: 13px; font-weight: 750; white-space: nowrap; }

.tabs {
  display: flex;
  gap: 4px;
  background: #eef2f6;
  padding: 4px;
  border-radius: 999px;
  width: fit-content;
  margin: 14px 0;
}
.tabs a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
}
.tabs a[aria-selected="true"] {
  background: white;
  color: var(--navy);
  box-shadow: 0 1px 3px rgba(16, 36, 64, 0.08);
}
.workspace-list { display: flex; flex-direction: column; }
.activity-row {
  display: flex;
  gap: 8px;
  padding: 11px 2px;
  border-top: 1px solid #edf1f5;
}
.chevron { color: var(--green); font-weight: 800; }
.activity-title { font-weight: 750; }
.activity-detail { color: var(--muted); font-size: 13px; margin-top: 3px; }
.empty { color: var(--muted); padding: 16px 2px; }
.flag {
  display: inline-block;
  background: #fff1d6;
  color: #8a5a00;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 800;
  margin-left: 6px;
}
.footnote { text-align: center; font-size: 13px; margin: 16px 8px 0; }

.table-panel { margin-top: 4px; }
.table-panel h1 { font-size: 28px; }
.lede { margin-top: 6px; max-width: 62ch; }
.table-scroll { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid #edf1f5; vertical-align: top; }
th {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.cell-detail { display: block; color: var(--muted); margin-top: 3px; }
.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 3px 8px;
  background: #eef3f7;
  font-weight: 800;
  font-size: 12px;
}
.status-done { background: #e5f7ee; color: #0f7a43; }
.status-blocked { background: #fdecec; color: #a12424; }
.status-waiting { background: #fff1d6; color: #8a5a00; }
.status-in_progress { background: #fff6df; color: #8a5a00; }

.page-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 0;
}
.login-card {
  width: min(440px, calc(100% - 32px));
  background: rgba(255, 255, 255, 0.96);
  border-radius: 28px;
  padding: 28px 26px 22px;
  box-shadow: 0 20px 50px rgba(14, 36, 66, 0.12);
}
.login-card h1 { margin: 18px 0 8px; font-size: 28px; color: var(--navy); }
.login-card form { display: grid; gap: 12px; margin-top: 16px; }
.login-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 800; color: #31475c; }
.login-card input {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid #d5dee6;
  background: #f8fbfc;
}
.login-card input:focus { outline: 3px solid rgba(232, 163, 23, 0.45); border-color: var(--amber); }
.login-card button {
  margin-top: 4px;
  background: var(--amber);
  color: #1d1403;
  padding: 12px 16px;
}
.form-error {
  background: #fff1f0;
  color: #9f2d2d;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 12px;
  font-weight: 750;
}
.fine { margin-top: 14px; font-size: 12px; }

.station:focus-visible, .chief-card:focus-visible, .tabs a:focus-visible, .topbar a:focus-visible, button:focus-visible {
  outline: 3px solid rgba(232, 163, 23, 0.7);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .stations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .stations { grid-template-columns: 1fr; }
  .plant { display: none; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .chief-card { align-items: flex-start; }
  .station { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .dot-working { animation: none; }
}
