/* Paper time card on a pale sage desk: ledger-blue ruling, time-clock red for overtime. */
:root {
  --page: #eef1ec;
  --card: #ffffff;
  --ink: #18202e;
  --muted: #586273;
  --rule: #c9d4e4;
  --rule-strong: #8fa6c6;
  --accent: #23466f;
  --accent-ink: #ffffff;
  --stamp: #b42318;
  --stamp-bg: #fdecea;
  --focus: #2f6fd1;
  --radius-card: 6px;
  --radius-ctl: 4px;
  --font: "Barlow", system-ui, sans-serif;
  --font-head: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #11151b;
    --card: #1a2029;
    --ink: #e6e9ef;
    --muted: #9aa4b4;
    --rule: #2b3545;
    --rule-strong: #4a5d7a;
    --accent: #8fb3e6;
    --accent-ink: #0f1620;
    --stamp: #f2695e;
    --stamp-bg: #3a1d1b;
    --focus: #8fb3e6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #11151b; --card: #1a2029; --ink: #e6e9ef; --muted: #9aa4b4; --rule: #2b3545; --rule-strong: #4a5d7a;
  --accent: #8fb3e6; --accent-ink: #0f1620; --stamp: #f2695e; --stamp-bg: #3a1d1b; --focus: #8fb3e6; color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
main, .site-head, .site-foot { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.1; margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.site-head { padding-top: 20px; }
.brand { font: 700 22px/1 var(--font-head); color: var(--ink); text-decoration: none; }

.intro { padding: 28px 0 20px; max-width: 46rem; }
.intro h1 { font-size: clamp(30px, 5vw, 44px); }
.intro p { color: var(--muted); margin: 10px 0 0; font-size: 18px; }

/* Controls */
button, input, select { font: inherit; color: inherit; }
.btn {
  background: var(--accent); color: var(--accent-ink); border: 0; border-radius: var(--radius-ctl);
  padding: 8px 14px; font-weight: 600; cursor: pointer;
}
.text-btn {
  background: none; border: 0; padding: 6px 4px; color: var(--accent); font-weight: 600; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.text-btn.danger { color: var(--stamp); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--rule-strong); background: var(--card);
  font-size: 22px; line-height: 1; cursor: pointer;
}
input, select {
  background: var(--card); border: 1px solid var(--rule-strong); border-radius: var(--radius-ctl);
  padding: 6px 8px; min-height: 38px; width: 100%;
}

.toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; padding: 8px 0 12px; }
.period { display: flex; align-items: center; gap: 10px; }
.period h2 { font-size: 26px; min-width: 15ch; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

.settings { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 10px 0; margin-bottom: 20px; }
.settings summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px 20px; margin-top: 14px; }
.settings label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.note { color: var(--muted); font-size: 14px; max-width: 60rem; }

/* Roster + card */
.workspace { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.roster-panel h2 { font-size: 20px; margin-bottom: 8px; }
.roster { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; }
.roster-item {
  width: 100%; display: flex; justify-content: space-between; gap: 8px; text-align: left;
  border: 1px solid transparent; background: none; padding: 8px 10px; border-radius: var(--radius-ctl); cursor: pointer;
}
.roster-item:hover { border-color: var(--rule-strong); }
.roster-item[aria-pressed="true"] { background: var(--card); border-color: var(--rule-strong); font-weight: 600; }
.roster-item.has-error .r-name::after { content: " !"; color: var(--stamp); font-weight: 700; }
.r-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-hours { color: var(--muted); }

/* The time card itself is the one loud element. */
.timecard {
  background: var(--card); border-radius: var(--radius-card); padding: 18px 20px 14px;
  border-left: 6px solid var(--rule-strong);
  box-shadow: 0 1px 0 var(--rule), 0 10px 24px -18px rgba(24, 32, 46, 0.45);
}
.card-head { display: grid; grid-template-columns: 1fr 160px; gap: 12px; margin-bottom: 10px; }
.card-head label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.name-field input { font: 700 22px var(--font-head); color: var(--ink); }

.card-table { width: 100%; border-collapse: collapse; }
.card-table thead th {
  font-size: 13px; font-weight: 600; color: var(--muted); text-align: left; padding: 6px 6px 8px;
  border-bottom: 2px solid var(--rule-strong);
}
.card-table td, .card-table tbody th { padding: 4px 6px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.card-table tbody th { font-weight: 500; white-space: nowrap; text-align: left; }
.dow { font-weight: 700; display: inline-block; width: 2.4em; }
.date { color: var(--muted); }
.card-table input { border-color: transparent; background: transparent; min-height: 36px; }
.card-table input:hover { border-color: var(--rule); }
.card-table input:focus { border-color: var(--rule-strong); background: var(--page); }
.card-table td:nth-child(2), .card-table td:nth-child(3) { width: 18%; }
.card-table td:nth-child(4) { width: 14%; }
.unit { font-weight: 400; }
.hrs { min-width: 9.5em; }
.hrs strong { font-size: 18px; margin-right: 8px; }
.hrs .span { color: var(--muted); font-size: 13px; }
.ot-stamp {
  display: inline-block; margin-left: 8px; padding: 0 6px; border: 1.5px solid var(--stamp); color: var(--stamp);
  border-radius: 3px; font: 700 13px/1.5 var(--font-head); transform: rotate(-3deg);
}
.row-error td, .row-error th { background: var(--stamp-bg); }
.err { color: var(--stamp); font-size: 14px; font-weight: 600; }
.week-break td { font: 700 15px var(--font-head); color: var(--muted); padding-top: 14px; border-bottom: 2px solid var(--rule-strong); }
.hint { color: var(--muted); font-size: 14px; margin: 10px 0; }
kbd { font: inherit; font-weight: 600; border: 1px solid var(--rule-strong); border-radius: 3px; padding: 0 4px; }

.totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 12px 0 0; border-top: 2px solid var(--rule-strong); }
.totals div { padding: 10px 6px 4px; }
.totals dt { font-size: 13px; color: var(--muted); }
.totals dd { margin: 0; font: 700 26px/1.2 var(--font-head); }
.totals small { font: 500 14px var(--font); color: var(--muted); }
.totals .is-ot dd { color: var(--stamp); }
.card-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 8px; }

/* Summary */
.summary { margin: 36px 0 12px; }
.summary h2 { font-size: 26px; margin-bottom: 10px; }
.table-scroll { overflow-x: auto; }
.sum-table { width: 100%; border-collapse: collapse; min-width: 560px; }
.sum-table th, .sum-table td { padding: 8px 10px; border-bottom: 1px solid var(--rule); text-align: right; }
.sum-table th:first-child { text-align: left; }
.sum-table thead th { font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2px solid var(--rule-strong); }
.sum-table tbody th { font-weight: 600; }
.sum-table tfoot th, .sum-table tfoot td { font-weight: 700; border-top: 2px solid var(--rule-strong); border-bottom: 0; }
.sum-table .is-ot { color: var(--stamp); font-weight: 600; }
.err-dot { color: var(--stamp); font-weight: 700; }

.privacy { color: var(--muted); font-size: 14px; margin: 28px 0; }
.site-foot { color: var(--muted); font-size: 13px; padding-bottom: 40px; border-top: 1px solid var(--rule); padding-top: 14px; }

.status {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  background: var(--ink); color: var(--page); padding: 6px 12px; border-radius: 4px; font-size: 14px;
}
.status:empty { display: none; }
.print-only { display: none; }

@media (max-width: 760px) {
  .workspace { grid-template-columns: 1fr; }
  .roster { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
  .timecard { padding: 14px 10px; border-left-width: 4px; }
  .card-head { grid-template-columns: 1fr 120px; }
  .card-table thead th:nth-child(4) .unit { display: none; }
  .card-table tbody th .date { display: block; font-size: 12px; }
  .card-table td, .card-table tbody th { padding: 4px 3px; }
  .hrs { min-width: 0; }
  .hrs .span { display: block; }
  .totals { grid-template-columns: repeat(2, 1fr); }
  .period h2 { font-size: 21px; min-width: 0; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-head, .intro, .toolbar, .settings, .workspace, .privacy, .status, .site-foot { display: none !important; }
  .print-only { display: block; }
  .summary { margin-top: 0; }
  .print-card { break-inside: avoid; margin-top: 24px; }
  .print-card table { width: 100%; border-collapse: collapse; }
  .print-card th, .print-card td { border-bottom: 1px solid #999; padding: 4px; text-align: left; }
  .print-card .totals dd { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* FAQ and secondary pages */
.faq { max-width: 46rem; margin: 40px 0 20px; border-top: 2px solid var(--rule-strong); padding-top: 20px; }
.faq h2 { font-size: 28px; margin-bottom: 8px; }
.faq h3, .page h2 { font-size: 21px; margin: 24px 0 6px; }
.faq p, .page p, .page li { line-height: 1.65; }
.mini { border-collapse: collapse; margin: 8px 0; }
.mini th, .mini td { border-bottom: 1px solid var(--rule); padding: 4px 18px 4px 0; text-align: left; }
.foot-links { display: flex; gap: 20px; margin-top: 6px; }
.foot-links a, .page a { color: var(--accent); }
.page { padding-top: 28px; padding-bottom: 40px; }
.page > * { max-width: 46rem; }
.page h1 { font-size: clamp(30px, 5vw, 40px); margin-bottom: 12px; }
