/* Employee Hours — one restrained system: cool graphite neutrals, pen-ink accent, three status colors. */
:root {
  --ink: oklch(0.42 0.11 258);
  --ink-hover: oklch(0.36 0.11 258);
  --ink-soft: oklch(0.95 0.02 258);
  --text: oklch(0.22 0.01 258);
  --muted: oklch(0.48 0.012 258);
  --line: oklch(0.88 0.008 258);
  --surface: oklch(0.995 0.002 258);
  --panel: oklch(0.97 0.004 258);
  --danger: oklch(0.52 0.18 27);
  --danger-soft: oklch(0.96 0.025 27);
  --ok: oklch(0.5 0.12 150);
  --ok-soft: oklch(0.955 0.035 150);
  --wait: oklch(0.55 0.12 70);
  --wait-soft: oklch(0.965 0.045 85);
  --focus: 0 0 0 3px oklch(0.7 0.13 258 / 0.55);
  --radius: 6px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--panel);
  line-height: 1.45;
}
* { box-sizing: border-box; }
/* Components set display; the hidden attribute must still win. */
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: 1.5rem; font-weight: 650; }
h2 { font-size: 1.2rem; font-weight: 620; }
h3 { font-size: 1rem; font-weight: 620; }
p { margin: 0; }
a { color: var(--ink); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.gap-top { margin-top: var(--s4); }
.gap-bottom { margin-bottom: var(--s4); }
.small { font-size: 0.875rem; }
.skip { position: absolute; left: -999px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { left: var(--s3); top: var(--s3); z-index: 10; background: var(--surface); padding: var(--s2) var(--s3); }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* Top bar */
.bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 1040px; margin: 0 auto; padding: 0 var(--s4); display: flex; align-items: center; gap: var(--s5); min-height: 56px; }
.brand { font-weight: 650; white-space: nowrap; }
.brand small { display: block; font-weight: 400; color: var(--muted); font-size: 0.75rem; }
.nav { display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav a { padding: var(--s2) var(--s3); border-radius: var(--radius); text-decoration: none; color: var(--muted); white-space: nowrap; min-height: 44px; display: flex; align-items: center; }
.nav a:hover { color: var(--text); background: var(--panel); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--ink-soft); font-weight: 600; }
@media (max-width: 640px) {
  .bar-inner { flex-wrap: wrap; gap: 0; padding-top: var(--s2); }
  .nav { order: 3; flex-basis: 100%; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s3); }
}

/* Page */
main { max-width: 1040px; margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
main:focus { box-shadow: none; }
.loading { color: var(--muted); padding: var(--s6) 0; }
.page-head { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.page-head p { margin-top: var(--s1); }
.section { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); margin-bottom: var(--s5); }
.section > h2 { margin-bottom: var(--s4); }
@media (max-width: 640px) { .section { padding: var(--s4); border-left: 0; border-right: 0; border-radius: 0; margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); } }

/* Auth pages */
.auth { max-width: 400px; margin: 8vh auto 0; }
.auth h1 { margin-bottom: var(--s2); }
.app-name { font-size: 0.85rem; font-weight: 600; color: var(--ink); margin-bottom: var(--s3); }
.auth > p { margin-bottom: var(--s5); color: var(--muted); }
.auth .section { padding: var(--s5); }
.auth-alt { margin-top: var(--s4); text-align: center; font-size: 0.9rem; }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--muted); font-size: 0.85rem; margin: var(--s4) 0; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Forms */
.field { display: flex; flex-direction: column; gap: var(--s1); margin-bottom: var(--s4); min-width: 0; }
label { font-size: 0.875rem; font-weight: 560; }
.hint { font-size: 0.8rem; color: var(--muted); }
input, select, textarea {
  font: inherit; color: inherit; background: var(--surface);
  border: 1px solid oklch(0.8 0.01 258); border-radius: var(--radius);
  padding: 10px var(--s3); min-height: 44px; width: 100%;
}
textarea { min-height: 72px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: oklch(0.7 0.01 258); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--ink); }
[aria-invalid="true"] { border-color: var(--danger); }
.error { color: var(--danger); font-size: 0.85rem; }
.error:empty { display: none; }
.form-error { background: var(--danger-soft); color: var(--danger); padding: var(--s3); border-radius: var(--radius); margin-bottom: var(--s4); font-size: 0.9rem; }
.form-error:empty { display: none; }
.notice { background: var(--ink-soft); padding: var(--s3) var(--s4); border-radius: var(--radius); margin-bottom: var(--s4); }
.row { display: grid; gap: 0 var(--s4); grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); }
legend { font-size: 0.875rem; font-weight: 560; margin-bottom: var(--s2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); padding: 2px; background: var(--panel); }
.seg label { white-space: nowrap; font-weight: 500; padding: 6px var(--s3); border-radius: 4px; cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg input:checked + span { color: var(--ink); font-weight: 620; }
.seg label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 2px oklch(0.2 0.01 258 / 0.12); }
.seg label:has(input:focus-visible) { box-shadow: var(--focus); }

/* Buttons */
.btn {
  font: inherit; font-weight: 560; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4); border-radius: var(--radius); cursor: pointer; text-decoration: none;
  border: 1px solid oklch(0.8 0.01 258); background: var(--surface); color: var(--text);
  transition: background-color 150ms ease-out, border-color 150ms ease-out;
}
.btn:hover { background: var(--panel); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: oklch(0.99 0.005 258); }
.btn.primary:hover { background: var(--ink-hover); }
.btn.danger { color: var(--danger); border-color: oklch(0.8 0.06 27); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--ink); padding: 0 var(--s2); }
.btn.quiet:hover { background: var(--ink-soft); }
.btn.small { min-height: 36px; padding: 0 var(--s3); font-size: 0.875rem; }
.btn[disabled], .btn[aria-busy="true"] { opacity: 0.6; cursor: progress; }
.btn.block { width: 100%; }
.btn[aria-disabled="true"] { opacity: 0.5; pointer-events: none; }
.actions { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.google { gap: var(--s3); }

/* Week navigation and totals */
.week { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.week strong { min-width: 11ch; text-align: center; }
.total { display: flex; flex-direction: column; align-items: flex-end; }
@media (max-width: 640px) { .total { align-items: flex-start; } }
.total .big { font-size: 1.75rem; font-weight: 650; display: block; line-height: 1.1; }

/* Entry list: a real list grouped by day */
.day { border-top: 1px solid var(--line); padding: var(--s3) 0; }
.day:first-child { border-top: 0; padding-top: 0; }
.day-head { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); margin-bottom: var(--s2); }
.entry { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: var(--s1) var(--s4); align-items: start; padding: var(--s2) 0; }
.entry + .entry { border-top: 1px dashed var(--line); }
.entry .time { font-weight: 600; }
.entry .what { min-width: 0; overflow-wrap: anywhere; }
.entry .review-note { font-size: 0.875rem; margin-top: var(--s1); }
.entry-actions { display: flex; gap: var(--s1); justify-content: end; align-items: center; flex-wrap: wrap; }
@media (max-width: 560px) {
  .entry { grid-template-columns: 1fr auto; }
  .entry .what { grid-column: 1 / -1; grid-row: 2; }
  .entry-actions { grid-column: 1 / -1; justify-content: start; }
}
.empty { padding: var(--s5) 0; color: var(--muted); }
.empty strong { color: var(--text); display: block; margin-bottom: var(--s1); }

/* Status badge: text + color, never color alone */
.badge { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.submitted { background: var(--wait-soft); color: oklch(0.42 0.1 65); }
.badge.approved { background: var(--ok-soft); color: oklch(0.4 0.1 150); }
.badge.rejected { background: var(--danger-soft); color: var(--danger); }
.badge.role { background: var(--panel); color: var(--muted); border: 1px solid var(--line); }

/* Tables (review, team, sessions) */
.table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.table th { text-align: left; font-size: 0.8rem; font-weight: 600; color: var(--muted); padding: var(--s2); border-bottom: 1px solid var(--line); }
.table td { padding: var(--s3) var(--s2); border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table tr:last-child td { border-bottom: 0; }
.table .right { text-align: right; }
@media (max-width: 720px) {
  .table thead { position: absolute; left: -9999px; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { border-bottom: 1px solid var(--line); padding: var(--s2) 0; }
  .table td { border: 0; padding: var(--s1) 0; }
  .table td[data-label]::before { content: attr(data-label); display: block; font-size: 0.75rem; color: var(--muted); }
  .table .right { text-align: left; }
}
.reject-box { margin-top: var(--s2); display: grid; gap: var(--s2); }

.filters { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: end; margin-bottom: var(--s4); }
.filters .field { margin: 0; flex: 1 1 160px; }

/* Toast and dialog */
.toast { position: fixed; left: 50%; bottom: var(--s5); transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--surface); padding: var(--s3) var(--s4); border-radius: var(--radius); max-width: calc(100vw - 32px);
  transition: opacity 200ms ease-out, transform 200ms ease-out; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s5); max-width: 420px; width: calc(100vw - 32px); color: var(--text); }
dialog::backdrop { background: oklch(0.2 0.01 258 / 0.35); }
dialog h2 { margin-bottom: var(--s2); }
dialog p { margin-bottom: var(--s5); color: var(--muted); }
dialog .actions { justify-content: end; }

.outbox-item { border-top: 1px solid var(--line); padding: var(--s3) 0; }
.outbox-item pre { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 0.85rem; margin: var(--s2) 0 0; }

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