/* ====== Full Plan — data tables, filters, timeline ====== */
:root {
  --bg-0: #0f172a;
  --bg-1: #111c33;
  --bg-2: #1a2540;
  --bg-3: #243150;
  --line: #25324c;
  --text: #f8fafc;
  --muted: #94a3b8;
  --amber: #f59e0b;
  --amber-2: #fbbf24;
  --amber-soft: rgba(245, 158, 11, 0.12);
  --green: #22c55e;
  --red: #ef4444;
  --blue: #38bdf8;
  --slate: #64748b;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0); color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px; line-height: 1.55;
}
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-2); }
code {
  font-family: 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 13px; background: var(--bg-2); padding: 2px 6px; border-radius: 4px;
  color: var(--amber-2);
}

/* ====== Top bar ====== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 24px;
}
.brand {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 17px;
  color: var(--text);
}
.brand-logo {
  width: 28px; height: 28px;
  background: linear-gradient(135deg, var(--amber), #b45309);
  border-radius: 7px;
  display: grid; place-items: center;
  color: var(--bg-0); font-weight: 800;
  font-size: 13px;
}
.crumbs {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: 13px; color: var(--muted);
  margin-left: 8px;
}
.crumbs span.sep { opacity: 0.4; }
.nav-r { margin-left: auto; display: flex; gap: 6px; }
.nav-r a {
  color: var(--muted); padding: 7px 12px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
}
.nav-r a:hover { background: var(--bg-2); color: var(--text); }

/* ====== Layout ====== */
.shell { max-width: 1400px; margin: 0 auto; padding: 28px 24px 60px; }

/* ====== Page head ====== */
.head {
  background:
    radial-gradient(ellipse at top, rgba(245, 158, 11, 0.12), transparent 60%),
    var(--bg-0);
  border-bottom: 1px solid var(--line);
  padding: 30px 0;
  margin: -28px -24px 28px;
}
.head-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.head h1 {
  font-size: 32px; font-weight: 800; margin: 0 0 8px; letter-spacing: -0.5px;
}
.head p { color: var(--muted); font-size: 16px; margin: 0; max-width: 760px; }
.head .counts {
  display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap;
}
.head .pillc {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; color: var(--muted);
}
.head .pillc strong { color: var(--amber); font-weight: 700; }

/* ====== Tab nav (sheets) ====== */
.tabs-wrap {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0;
}
.tab {
  background: transparent; border: 0;
  color: var(--muted);
  padding: 12px 16px;
  cursor: pointer; font-size: 14px; font-weight: 600;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  font-family: inherit;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--amber); border-bottom-color: var(--amber); }
.tab .badge {
  display: inline-block; margin-left: 6px;
  background: var(--bg-2); color: var(--muted);
  padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 700;
}
.tab.active .badge { background: var(--amber-soft); color: var(--amber); }

.panel { display: none; }
.panel.active { display: block; }

/* ====== Toolbar (search + filter row) ====== */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.toolbar input.search,
.toolbar select.filter {
  background: var(--bg-1); border: 1px solid var(--line);
  color: var(--text); padding: 9px 14px; border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
.toolbar input.search { flex: 1; min-width: 200px; }
.toolbar input.search:focus,
.toolbar select.filter:focus {
  outline: none; border-color: var(--amber);
}
.toolbar .meta { color: var(--muted); font-size: 13px; }

/* ====== Tables ====== */
.table-wrap {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: auto;
  max-height: 70vh;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table th {
  position: sticky; top: 0;
  background: var(--bg-2); color: var(--amber);
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--text);
}
table tr:hover td { background: rgba(245, 158, 11, 0.04); }
table td.muted { color: var(--muted); }
table td.wrap-text { white-space: normal; max-width: 480px; }
td.empty { color: var(--muted); font-style: italic; }

.pill-mini {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600;
  background: var(--bg-3); color: var(--muted);
  border: 1px solid var(--line);
}
.pill-mini.amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(245, 158, 11, 0.3); }
.pill-mini.green { background: rgba(34, 197, 94, 0.15); color: #4ade80; border-color: rgba(34, 197, 94, 0.3); }
.pill-mini.red { background: rgba(239, 68, 68, 0.15); color: #f87171; border-color: rgba(239, 68, 68, 0.3); }
.pill-mini.blue { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border-color: rgba(56, 189, 248, 0.3); }

/* ====== Score / risk heatmap ====== */
.score-bar {
  display: inline-block;
  min-width: 30px; text-align: center;
  padding: 2px 6px; border-radius: 6px;
  font-weight: 700; font-size: 12px;
}
.score-bar.s-h { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }
.score-bar.s-m { background: rgba(245, 158, 11, 0.25); color: var(--amber-2); }
.score-bar.s-l { background: rgba(34, 197, 94, 0.2); color: #86efac; }

/* ====== Timeline ====== */
.timeline { padding: 10px 0; }
.t-group { margin-bottom: 28px; }
.t-group-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 10px; padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}
.t-phase-id {
  font-size: 28px; font-weight: 800; color: var(--amber);
  font-family: 'JetBrains Mono', monospace;
}
.t-phase-name { font-size: 18px; font-weight: 700; }
.t-phase-dates { margin-left: auto; color: var(--muted); font-size: 13px; }
.t-row {
  display: grid;
  grid-template-columns: 60px 1fr 90px 150px;
  gap: 14px; align-items: start;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  margin-bottom: 6px;
}
.t-row .act-id { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--muted); }
.t-row .act-what { font-weight: 600; font-size: 14px; }
.t-row .act-why { color: var(--muted); font-size: 13px; margin-top: 4px; }
.t-row .act-dates { font-size: 13px; color: var(--muted); }
.t-row .act-owner { font-size: 13px; text-align: right; color: var(--text); }

/* ====== README view ====== */
.readme {
  background: var(--bg-1); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px 32px;
  font-size: 15px; line-height: 1.7;
}
.readme p { color: var(--text); margin: 0 0 14px; }
.readme h3 { color: var(--amber); margin: 24px 0 6px; font-size: 17px; }

/* ====== Loading ====== */
.loading { padding: 60px 20px; text-align: center; color: var(--muted); }

/* ====== Empty state ====== */
.empty-state {
  padding: 60px 20px; text-align: center;
  color: var(--muted);
}
.empty-state .num { font-size: 36px; font-weight: 800; color: var(--amber); }

/* ====== Responsive ====== */
@media (max-width: 720px) {
  .topbar-inner { padding: 10px 16px; }
  .shell { padding: 20px 14px 50px; }
  .head { padding: 20px 0; margin: -20px -14px 20px; }
  .head h1 { font-size: 24px; }
  .t-row { grid-template-columns: 1fr; gap: 6px; }
  .t-row .act-owner { text-align: left; }
  .nav-r { display: none; }
}

/* ====== Footer ====== */
.foot {
  max-width: 1400px; margin: 30px auto 0;
  padding: 20px 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.foot a { color: var(--amber); }
