/* SIA Revision — light theme, mobile-first. Colours are variables so they're easy to tweak. */
:root {
  --bg: #f4f5fa;
  --card: #ffffff;
  --text: #19202e;
  --muted: #6a7385;
  --line: #e6e9f1;
  --brand: #3b4cca;        /* indigo: progress in motion */
  --brand-soft: #e8ebff;
  --good: #16a35a;         /* green: target reached */
  --good-soft: #e3f6ec;
  --bad: #c8372d;
  --bad-soft: #fdebe9;
  --warn: #9a7410;
  --warn-soft: #fbf3dc;
  --navy: #161c3a;
  --gold: #f6e7b8;
  --shadow: 0 1px 2px rgba(25, 32, 46, .05), 0 6px 20px rgba(25, 32, 46, .06);
  --shadow-hover: 0 2px 4px rgba(25, 32, 46, .06), 0 12px 28px rgba(25, 32, 46, .10);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
main { padding-bottom: 56px; }

/* Header band */
.hero { background: var(--navy); color: #fff; padding: 26px 0 64px; }
.hero-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.02em; }
.sub { margin: 2px 0 0; color: #aab2d6; font-size: .95rem; }

.today { margin: 10px 0 0; font-size: .9rem; font-weight: 600; color: #fff; }

/* Week A / Week B switch (compact) */
.switch { display: inline-flex; background: rgba(255,255,255,.1); border-radius: 10px; padding: 3px; }
.switch button {
  font: inherit; font-size: .88rem; font-weight: 600; padding: 6px 16px; border: 0; border-radius: 8px;
  background: transparent; color: #c9cfee; cursor: pointer; transition: background .2s, color .2s;
}
.switch button:hover { color: #fff; }
.switch button.on { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* Overview: sits over the header band */
.overview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: -42px; }
.stat { background: var(--card); border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.stat .value { font-size: 1.4rem; font-weight: 700; margin-top: 2px; letter-spacing: -.01em; }
.stat .hint { font-size: .78rem; color: var(--muted); }

/* Section headings */
.heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 34px 0 12px; }
h2 { font-size: 1.15rem; margin: 0; letter-spacing: -.01em; }
.dates { color: var(--muted); font-size: .9rem; }

/* Member cards: full width, stacked */
.cards { display: flex; flex-direction: column; gap: 14px; }
.card { background: var(--card); border-radius: 16px; padding: 20px; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.name { font-size: 1.3rem; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { font-size: .7rem; padding: 3px 9px; border-radius: 99px; background: var(--gold); color: #6b5410; font-weight: 700; letter-spacing: .02em; }
.pill { font-size: .8rem; font-weight: 700; padding: 4px 12px; border-radius: 99px; }
.pill.hit { background: var(--good-soft); color: var(--good); }
.pill.missed { background: var(--bad-soft); color: var(--bad); }
.pill.undefined { background: var(--warn-soft); color: var(--warn); }
.pill.nodata { background: var(--brand-soft); color: var(--brand); }

.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 8px; gap: 10px; flex-wrap: wrap; }
.hours { color: var(--muted); }
.hours b { font-size: 1.7rem; color: var(--text); letter-spacing: -.02em; }
.pct { font-weight: 700; font-size: 1.05rem; color: var(--brand); }
.pct.hit { color: var(--good); }
.bar { height: 16px; background: #e9ecf5; border-radius: 99px; overflow: hidden; }
.bar > i {
  display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand);
  transition: width .9s cubic-bezier(.22, .8, .3, 1), background-color .4s;
}
.bar.hit > i { background: var(--good); }   /* whole bar goes green at target */

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.fact span { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.fact b { font-size: 1.05rem; }
.good { color: var(--good); } .bad { color: var(--bad); } .muted { color: var(--muted); }

/* Panels + tables */
.panel { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.panel.pad { padding: 16px 20px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: #fafbfd; }
tr:last-child td { border-bottom: 0; }
tr.chief td { background: #fdf8e6; }
.num { text-align: right; }
.pick { font-size: .9rem; color: var(--muted); }
select { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); max-width: 100%; }
.note { font-size: .82rem; color: var(--muted); margin: 10px 4px 0; }
.rules ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: .93rem; }
.rules li { margin: 6px 0; }
.rules b { color: var(--text); }

/* Phones: tables become stacked rows so nothing scrolls sideways */
@media (max-width: 699px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: 10px 16px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: flex; justify-content: space-between; gap: 16px; padding: 4px 0; border: 0; text-align: right; background: transparent !important; }
  table.stack td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; text-align: left; flex-shrink: 0; padding-top: 2px; }
  table.stack tr.chief { background: #fdf8e6; }
}
@media (min-width: 700px) {
  .overview { grid-template-columns: repeat(5, 1fr); }
  .facts { grid-template-columns: repeat(4, 1fr); }
  .card { padding: 24px 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .bar > i, .card, .switch button { transition: none; }
}
