:root {
  --ink: #171614;
  --muted: #696154;
  --line: #ded5c7;
  --paper: #f5efe4;
  --panel: #fffaf1;
  --dark: #24211b;
  --gold: #ad7e2f;
  --green: #1f7658;
  --red: #96362f;
  --blue: #2e5d78;
  --shadow: 0 18px 50px rgba(36, 33, 27, 0.14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(173, 126, 47, 0.16), transparent 35%),
    repeating-linear-gradient(90deg, rgba(36, 33, 27, 0.035) 0 1px, transparent 1px 64px),
    var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  letter-spacing: 0;
}
a { color: inherit; }
code { color: #4d3918; font: 0.86rem Consolas, "Courier New", monospace; overflow-wrap: anywhere; }

.login-shell, .setup-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-panel, .setup-panel {
  width: min(480px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 34px;
}
.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
h1, h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0;
}
h1 { font-size: clamp(2rem, 4vw, 3.4rem); line-height: 0.95; }
h2 { font-size: 1.15rem; }
.muted, .setup-panel p { color: var(--muted); line-height: 1.55; }
.alert {
  margin: 20px 0;
  padding: 12px 14px;
  border: 1px solid rgba(150, 54, 47, 0.35);
  border-radius: 6px;
  background: rgba(150, 54, 47, 0.08);
  color: var(--red);
  font-weight: 700;
}
.login-form { display: grid; gap: 14px; margin-top: 24px; }
.login-form label { display: grid; gap: 7px; color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.login-form input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  padding: 10px 12px;
}
.login-form button {
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--dark);
  color: #fffaf0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}
.setup-panel dl { display: grid; gap: 14px; }
.setup-panel dt { color: var(--muted); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; }
.setup-panel dd { margin: 5px 0 0; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  border-right: 1px solid rgba(255, 250, 240, 0.14);
  background: var(--dark);
  color: #fffaf0;
  padding: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 250, 240, 0.24);
  border-radius: 8px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}
.brand strong, .brand span { display: block; }
.brand span { color: rgba(255, 250, 240, 0.6); font-size: 0.82rem; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a, .logout {
  border-radius: 6px;
  color: rgba(255, 250, 240, 0.74);
  padding: 10px 12px;
  text-decoration: none;
}
.sidebar nav a:hover, .logout:hover { background: rgba(255, 250, 240, 0.08); color: #fffaf0; }
.logout { margin-top: auto; }
.dashboard { min-width: 0; padding: 34px; }
.topbar { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.stamp {
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.64);
  padding: 14px;
}
.stamp span, .metric span, .section-head span, .task span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.stamp strong { display: block; margin-top: 5px; overflow-wrap: anywhere; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(36, 33, 27, 0.08);
}
.metric { min-height: 112px; padding: 18px; }
.metric strong { display: block; margin-top: 12px; font-size: 1.05rem; overflow-wrap: anywhere; }
.panel { margin-top: 18px; padding: 20px; scroll-margin-top: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { border-bottom: 1px solid var(--line); padding: 12px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.78rem; text-transform: uppercase; }
.split { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 24px; }
.check-list, .notes, .task-grid, .link-grid { display: grid; gap: 12px; }
.check, .task, .link-grid a, .notes p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf8;
  padding: 14px;
}
.check { border-left: 5px solid var(--blue); }
.check.ok { border-left-color: var(--green); }
.check.warn, .check.watch { border-left-color: var(--gold); }
.check.risk { border-left-color: var(--red); }
.check strong, .check span, .link-grid strong, .link-grid span { display: block; }
.check span, .task p, .link-grid span { margin: 6px 0 0; color: var(--muted); line-height: 1.45; }
.task-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.task strong { display: block; margin-top: 9px; }
.link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.link-grid a { text-decoration: none; }
.link-grid a:hover { border-color: rgba(173, 126, 47, 0.7); }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .sidebar nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .metric-grid, .split, .task-grid, .link-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .dashboard { padding: 20px; }
  .topbar { display: grid; }
  .stamp { min-width: 0; }
  .sidebar nav, .metric-grid, .split, .task-grid, .link-grid { grid-template-columns: 1fr; }
}
