/* R2E Consulting palette: dark brown #463E31 + sand #EACDA3 (from the brand logo package and r2e.consulting theme colour). Dark theme by default, like the website. */
:root {
  --brown-900: #2b2620;
  --brown-800: #363027;
  --brown-700: #463e31;
  --brown-600: #574d3e;
  --brown-500: #6b5f4d;
  --sand-100: #f6ebd9;
  --sand-200: #f0dbbd;
  --sand-300: #eacda3;
  --sand-400: #d9b688;
  --sand-500: #bf9a66;

  --brand: var(--sand-300);
  --brand-contrast: var(--brown-900);
  --brand-bg: rgba(234, 205, 163, 0.16);
  --brand-text: var(--sand-200);
  --bg: var(--brown-900);
  --surface: var(--brown-800);
  --surface-2: var(--brown-700);
  --text: var(--sand-100);
  --text-2: #cdbfa8;
  --muted: #9a8d78;
  --border: #5a5040;
  --border-soft: #4a4136;
  --success-bg: #2f4a2a; --success-text: #c8e2b3;
  --warning-bg: #5a4415; --warning-text: #f2d59a;
  --danger-bg: #5a2a26; --danger-text: #f5c4bd; --danger: #f09a90;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --brand: var(--brown-700);
    --brand-contrast: var(--sand-100);
    --brand-bg: rgba(70, 62, 49, 0.10);
    --brand-text: var(--brown-700);
    --bg: #f7f1e6;
    --surface: #fffdf8;
    --surface-2: #f1e6d3;
    --text: var(--brown-900);
    --text-2: var(--brown-500);
    --muted: #8c7f6b;
    --border: #d6c7ad;
    --border-soft: #e6dac6;
    --success-bg: #e8f1dc; --success-text: #2f4a2a;
    --warning-bg: #f7e6c2; --warning-text: #5a4415;
    --danger-bg: #f8e1de; --danger-text: #6e2a25; --danger: #a33a32;
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); }
a { color: var(--brand); text-decoration: none; }
h1 { font-size: 20px; font-weight: 500; margin: 0 0 1rem; }
h2 { font-size: 16px; font-weight: 500; margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  height: 34px; padding: 0 10px; width: 100%; min-width: 0;
}
input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
textarea { height: auto; padding: 8px 10px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-bg); }
button {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  height: 34px; padding: 0 12px; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
button:hover { background: var(--surface-2); }
button:active { transform: scale(0.98); }
button.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); font-weight: 500; }
button.primary:hover { filter: brightness(1.05); }
button.danger { color: var(--danger); }
button.small, .small { height: 28px; padding: 0 8px; font-size: 13px; }
button.icon { width: 34px; padding: 0; justify-content: center; }
button:disabled { opacity: .5; cursor: default; }
label.lbl, .lbl { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.muted { color: var(--muted); }
.text-2 { color: var(--text-2); }
.right, .num { text-align: right; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.card { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1rem; }
.metric { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; }
.metric .v { font-size: 22px; font-weight: 500; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 12px; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.badge.accent { background: var(--brand-bg); color: var(--brand-text); }
.badge.success { background: var(--success-bg); color: var(--success-text); }
.badge.warning { background: var(--warning-bg); color: var(--warning-text); }
.badge.danger { background: var(--danger-bg); color: var(--danger-text); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 999px;
  padding: 3px 10px; font-size: 13px; margin: 0 6px 6px 0; background: var(--surface); cursor: pointer; height: auto;
}
.chip:hover { border-color: var(--brand); }
.chip .muted { font-size: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { font-weight: 500; color: var(--text-2); text-align: left; padding: 6px 6px; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
td { padding: 6px 6px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
tr.total td { font-weight: 500; border-bottom: none; }
tr:hover td.hover { background: var(--surface-2); }
.cell { width: 100%; height: 28px; text-align: right; padding: 0 6px; font-size: 13px; }
.cell.today { border-color: var(--brand); }
.cell.locked { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.cell.dirty { border-color: #EF9F27; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; flex: 1; }
.progress > span { display: block; height: 100%; background: var(--brand); }
.error { color: var(--danger); font-size: 13px; }
.form-grid { display: grid; gap: 10px; }
.g5 { grid-template-columns: 120px repeat(4, minmax(0, 1fr)); }
.g4 { grid-template-columns: 120px minmax(0, 1fr) 110px 160px; }
@media (max-width: 760px) { .g5, .g4 { grid-template-columns: 1fr 1fr; } }

/* header */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border-soft); background: var(--surface); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 500; font-size: 16px; display: flex; align-items: center; gap: 10px; letter-spacing: .01em; }
.brand img { height: 28px; width: auto; display: block; }
.brand .sub { color: var(--text-2); font-weight: 400; }
.brand .logo-light { display: none; }
@media (prefers-color-scheme: light) { .brand .logo-dark { display: none; } .brand .logo-light { display: block; } }
.login .brand { justify-content: center; flex-direction: column; gap: 8px; margin-bottom: 1.25rem; }
.login .brand img { height: 56px; }
nav { display: flex; gap: 16px; margin-left: 12px; }
nav a { color: var(--text-2); padding: 4px 0; border-bottom: 2px solid transparent; }
nav a.active { color: var(--text); border-bottom-color: var(--brand); }
.timerbox { display: flex; align-items: center; gap: 8px; }
.timerbox .running { font-variant-numeric: tabular-nums; }
main { max-width: 1080px; margin: 0 auto; padding: 20px; }
.login { max-width: 360px; margin: 10vh auto; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--sand-300); color: var(--brown-900); padding: 8px 14px; border-radius: var(--radius); font-size: 13px; z-index: 20; }
.toast.err { background: var(--danger); color: #fff; }
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heat .d { border-radius: 4px; padding: 6px; min-height: 56px; background: var(--surface-2); font-size: 12px; cursor: pointer; border: 1px solid transparent; }
.heat .d:hover { border-color: var(--brand); }
.heat .d.other { opacity: .35; }
.heat .d.l1 { background: rgba(234,205,163,.22); } .heat .d.l2 { background: rgba(234,205,163,.42); } .heat .d.l3 { background: var(--sand-400); color: var(--brown-900); } .heat .d.l4 { background: var(--sand-300); color: var(--brown-900); }
.heat .d .n { font-weight: 500; font-size: 13px; }
.tree .client { padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.tree .project { margin-left: 24px; padding: 6px 0; }
.tree .component { margin-left: 48px; padding: 3px 0; font-size: 13px; color: var(--text-2); }
.inactive { opacity: .5; }
dialog { border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; background: var(--surface); color: var(--text); width: min(560px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.35); }
.sr-only { position: absolute; left: -9999px; }
.hint { font-size: 12px; color: var(--muted); }
datalist { display: none; }

/* telefoon: menu als vaste balk onderaan */
@media (max-width: 760px) {
  .topbar { padding: 8px 12px; }
  .topbar .row { min-width: 0; }
  .brand .sub { display: none; }
  .brand img { height: 24px; }
  .timerbox .badge { max-width: 42vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; gap: 0; z-index: 10; background: var(--surface); border-top: 1px solid var(--border-soft); padding-bottom: env(safe-area-inset-bottom); }
  nav a { flex: 1; text-align: center; font-size: 12px; padding: 12px 2px; border-bottom: none; border-top: 2px solid transparent; }
  nav a.active { border-top-color: var(--brand); }
  main { padding: 14px 12px calc(76px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(76px + env(safe-area-inset-bottom)); max-width: 92vw; }
  table { font-size: 12px; }
}
