/* CAH Dashboard — neutral placeholder look until Lauren's reference image arrives. Tokens first; dark mode follows the OS. */
:root {
  --bg: #f6f7f9; --surface: #ffffff; --text: #1d232b; --muted: #5f6b7a; --line: #dfe3e8;
  --accent: #2f6f6a; --accent-text: #ffffff; --danger: #b3261e; --warn-bg: #fff4e5; --warn-text: #7a4b00;
  --radius: 10px; --gutter: 16px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12161b; --surface: #1b2128; --text: #e6e9ed; --muted: #9aa5b1; --line: #2c343d;
    --accent: #5fb3ac; --accent-text: #0d1a19; --danger: #ff8a80; --warn-bg: #3a2c12; --warn-text: #ffd59a;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.topbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between;
  padding: 12px var(--gutter); background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { font-weight: 650; }
.brand-sub { color: var(--muted); font-weight: 400; margin-left: 4px; }
.who { display: flex; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); min-width: 0; }
.who #who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.role { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; text-transform: capitalize; }
main { max-width: 1200px; margin: 0 auto; padding: var(--gutter); }
.card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px var(--gutter); }
.signin { max-width: 440px; margin: 48px auto; text-align: center; }
h1 { font-size: 24px; margin: 0 0 8px; } h2 { font-size: 20px; margin: 0 0 8px; } h3 { font-size: 16px; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.notice { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: 10px 12px; }
.button { display: inline-block; background: var(--accent); color: var(--accent-text); border: 0; border-radius: 8px;
  padding: 10px 16px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.link.danger { color: var(--danger); }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; }
.tabs button { background: none; border: 1px solid transparent; border-radius: 8px; padding: 8px 14px; font: inherit; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button.active { background: var(--surface); border-color: var(--line); color: var(--text); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.grow { flex: 1 1 240px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
input, select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; min-width: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
@media (max-width: 600px) { .signin { margin: 24px auto; } .who #who-email { max-width: 40vw; } }
/* slice 2 — plan + report tables */
.small { font-size: 13px; }
.num { text-align: right; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.red { background: #fde7e6; color: #9b1c14; } .pill.alert { background: #b3261e; color: #fff; }
.pill.grey { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.pill.ok { background: #e3f3ec; color: #19623f; } .pill.warn { background: var(--warn-bg); color: var(--warn-text); }
@media (prefers-color-scheme: dark) { .pill.red { background: #4a1c19; color: #ffb4ab; } .pill.ok { background: #16372a; color: #9ee0bf; } }
td.red-date { color: var(--danger); font-weight: 650; }
tr.flagged td { background: color-mix(in srgb, var(--warn-bg) 55%, transparent); }
.case { white-space: nowrap; } .case + .case { margin-top: 4px; }
.override label { flex-direction: row; align-items: center; gap: 4px; color: var(--text); white-space: nowrap; }
.override { display: flex; flex-wrap: wrap; gap: 10px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; padding: var(--gutter); z-index: 10; }
.modal[hidden] { display: none; }
.modal-card { background: var(--surface); color: var(--text); border-radius: var(--radius); padding: 20px; max-width: 520px; width: 100%; max-height: 80vh; overflow: auto; border-top: 6px solid var(--danger); }
.modal-card ul { padding-left: 18px; }
/* slice 3 — agreements */
.caution { border: 2px solid var(--danger); border-radius: var(--radius); padding: 4px 12px 8px; margin: 12px 0 16px; }
.caution h3 { margin: 8px 0; color: var(--danger); }
/* to-do */
.todos { list-style: none; padding: 0; margin: 12px 0; }
.todo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.todo input[type=checkbox] { width: 20px; height: 20px; flex: none; }
.todo-text { flex: 1 1 220px; }
.todo.done .todo-text { text-decoration: line-through; color: var(--muted); }
.todo-tools { display: flex; gap: 12px; margin-left: auto; }
.done-list summary { cursor: pointer; color: var(--muted); margin-top: 8px; }
/* billables */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 12px 0; }
.tile { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--bg); }
.tile-label { color: var(--muted); font-size: 13px; } .tile-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--muted); font-size: 13px; }
