/* Palette sampled from the 2make logo: navy #003858, gold #E0AC33. */
:root {
  --navy: #003858; --gold: #E0AC33;
  --bg: #f1f4f6; --panel: #ffffff; --ink: #10222c; --muted: #5e747f;
  --line: #dae3e8; --accent: #00587f; --accent-soft: #e2eef4;
  --remote: #7a4fbf; --leave: #b8801a; --sick: #c0453c; --holiday: #2f7db0;
  --radius: 8px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #00212f; --panel: #012c3d; --ink: #e9f1f4; --muted: #8ba6b3;
    --line: #0d4257; --accent: #55aed9; --accent-soft: #0a3d55;
    --remote: #b493e8; --leave: var(--gold); --sick: #e8817a; --holiday: #7ab8e0;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 8px 16px; border-bottom: 1px solid var(--line); background: var(--navy);
  position: sticky; top: 0; z-index: 5; color: #fff;
}
/* The logo file is mostly navy padding; crop to the wordmark band. */
header img.logo { height: 34px; width: 118px; object-fit: cover; object-position: 50% 48%; border-radius: 3px; }
header .wordmark { font-weight: 700; letter-spacing: .14em; text-transform: lowercase; font-size: 17px; }
header .wordmark span { color: var(--gold); }
header button, header select { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.22); }
header button:hover { border-color: var(--gold); }
header .tabs button.on { background: var(--gold); color: var(--navy); border-color: var(--gold); font-weight: 600; }
[data-quick].on { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
.period { font-weight: 600; font-size: 16px; min-width: 9.5em; text-align: center; }
.spacer { flex: 1; }

/* Het huisje van Tik Tak. Het schaap heeft drie plaatsen — linkse deur, raam,
   rechtse deur — en schuift bij elke bewaarde dag een plaats op. */
.mascot { width: 68px; height: 41px; flex: none; overflow: visible; color: #fff; }
.mascot .ground { fill: currentColor; opacity: .22; }

.schaap {
  transform: translateX(var(--x, 0px));
  opacity: var(--o, 1);
  transition: transform .8s cubic-bezier(.35, 0, .25, 1), opacity .35s ease;
}
.schaap.direct { transition: none; }

/* De deuren zwaaien open en laten de donkere opening erachter zien. */
.deur { transform-box: fill-box; transform-origin: left center; transition: transform .3s ease; }
.deur.rechts { transform-origin: right center; }
.mascot.deur-open .deur { transform: scaleX(.14); }

.mascot.loopt .gang { animation: stap .3s ease-in-out infinite; }
.mascot.loopt .p1 { animation: poot-a .3s linear infinite; }
.mascot.loopt .p2 { animation: poot-b .3s linear infinite; }

@keyframes stap {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1.1px); }
}
@keyframes poot-a {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(1.6px); }
}
@keyframes poot-b {
  0%, 100% { transform: translateX(0); }
  50%      { transform: translateX(-1.6px); }
}
@media (prefers-reduced-motion: reduce) {
  .schaap, .deur { transition: none; }
  .mascot.loopt .gang, .mascot.loopt .p1, .mascot.loopt .p2 { animation: none; }
}

/* De vier kleuren van het testbeeld. */
.colourbar { height: 4px; display: flex; }
.colourbar::before, .colourbar::after { content: ""; flex: 1; }
.colourbar::before { background: linear-gradient(90deg, #e23b2e 0 50%, var(--gold) 50%); }
.colourbar::after { background: linear-gradient(90deg, #2f7db0 0 50%, #3f9e58 50%); }

.shapes { display: flex; gap: 6px; align-items: center; }
.shapes i { width: 14px; height: 14px; display: block; }
.shapes .c-red { background: #e23b2e; border-radius: 50%; }
.shapes .c-yellow { background: var(--gold); }
.shapes .c-blue { background: #2f7db0; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.shapes .c-green { background: #3f9e58; border-radius: 50% 50% 50% 0; }

/* Wie er werkt, staat nu vast bij het aanmelden; de knop meldt je weer af. */
#afmelden { max-width: 12em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

h1 { font-size: 15px; margin: 0; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
h3 { font-size: 13px; margin: 18px 0 6px; }
button, select, input {
  font: inherit; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px;
}
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.danger { color: var(--sick); }
.tabs, .schakel { display: flex; gap: 4px; }
.schakel button.on { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
main { padding: 16px; max-width: 1200px; margin: 0 auto; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(290px, 1fr); gap: 16px; align-items: start; }
/* Settings has two equally heavy columns rather than a main + sidebar. */
#view-setup .cols { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }

/* calendar */
table.cal { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
table.cal th { font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 600; padding-bottom: 4px; }
table.cal th.wk, td.wk { width: 32px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; }
td.cell {
  border: 1px solid var(--line); border-radius: 6px; height: 72px; vertical-align: top;
  padding: 3px 5px; cursor: pointer; background: var(--panel); overflow: hidden;
}
td.cell.weekend { background: transparent; }
td.cell.sel { outline: 2px solid var(--gold); outline-offset: 1px; }
/* Dagen die nog moeten komen: wel in te vullen, maar nog niet gewerkt. */
td.cell.future { border-style: dashed; }
td.cell.future .hrs, td.cell.future .flags { opacity: .45; }
td.cell.empty { border: none; cursor: default; background: transparent; }
.dnum { font-size: 11px; color: var(--muted); }
.dnum.today { color: var(--accent); font-weight: 700; }
.hrs { font-size: 18px; font-weight: 600; line-height: 1.1; }
.flags { font-size: 10px; letter-spacing: .04em; }
.f-T { color: var(--remote); font-weight: 700; } .f-half { color: var(--muted); }
.cell.k-leave { background: color-mix(in srgb, var(--leave) 18%, var(--panel)); }
.cell.k-sick { background: color-mix(in srgb, var(--sick) 18%, var(--panel)); }
.cell.k-holiday { background: color-mix(in srgb, var(--holiday) 15%, var(--panel)); }
.hol { font-size: 9px; color: var(--holiday); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note { font-size: 10px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Op welk project er die dag gewerkt is. */
.proj {
  display: block; font-size: 9px; line-height: 1.4; font-weight: 600;
  color: var(--c); border-left: 3px solid var(--c); padding-left: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  background: var(--c); margin-right: 6px; vertical-align: -1px; flex: none;
}
.projrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dotted var(--line); }
.projrow .naam { display: flex; align-items: center; min-width: 0; }
.projrow .naam span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.projrow .cijfers { font-variant-numeric: tabular-nums; white-space: nowrap; }
.projrow .cijfers b { margin-left: 8px; }

/* de regels van een dag: één per project */
.regels { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.regel {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px;
  border: 1px solid transparent; border-radius: 6px;
}
.regel.actief { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.regel .balk { width: 4px; align-self: stretch; border-radius: 2px; background: var(--c); flex: none; }
.regel select { flex: 1; min-width: 0; max-width: 16em; }
.regel input.uren {
  font-variant-numeric: tabular-nums; font-weight: 600; width: 5em; text-align: right;
}
.regel .eenheid { color: var(--muted); font-size: 12px; }
.regel button.weg { color: var(--sick); border-color: transparent; background: transparent; padding: 2px 6px; }
.regels .hint { padding-left: 8px; }

/* day editor */
.editor { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.editor .date { font-weight: 600; min-width: 9em; }
.chip { padding: 4px 10px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); font-weight: 600; }
kbd {
  font: 11px ui-monospace, monospace; background: var(--bg); border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; color: var(--muted);
}
pre.report {
  background: var(--bg); border: 1px solid var(--line); border-radius: 6px;
  padding: 10px; font: 13px/1.55 ui-monospace, monospace; white-space: pre-wrap; margin: 0;
}
.stat { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-bottom: 1px dotted var(--line); }
.stat b { font-variant-numeric: tabular-nums; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 4px 6px; }
table.list td { padding: 4px 6px; border-top: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 12px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; align-items: center; }
.bar { height: 6px; background: var(--gold); border-radius: 3px; min-width: 2px; }
footer { text-align: center; color: var(--muted); font-size: 11px; padding: 18px; line-height: 1.7; }
#toast {
  position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: var(--gold); padding: 7px 16px; border-radius: 20px;
  font-weight: 600; letter-spacing: .08em; opacity: 0; transition: opacity .18s;
  pointer-events: none; z-index: 10;
}
#toast.show { opacity: 1; }
.hidden { display: none !important; }

@media (max-width: 820px) {
  .cols { grid-template-columns: 1fr; }
  td.cell { height: 66px; }
  main { padding: 10px; }
  .period { min-width: 7em; font-size: 14px; }
}


/* ---------- statistiek: vergelijking en grafiek ---------- */

/* Reekskleuren uit de gevalideerde standaardpalet-instantie; de donkere kolom
   is dezelfde drie tinten, opnieuw gestapt voor het donkere vlak. */
.viz-root {
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --as: color-mix(in srgb, var(--ink) 22%, transparent);
  --raster: color-mix(in srgb, var(--ink) 9%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .viz-root {
    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;
  }
}

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 10px; }
.tegel { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.tegel .kop { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.tegel .waarde { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.25; }
.tegel .delta { font-size: 12px; color: var(--muted); }
.tegel .delta .op { color: var(--accent); font-weight: 600; }
.tegel .delta .neer { color: var(--leave); font-weight: 600; }

.legende { display: flex; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px; font-size: 12px; color: var(--muted); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.legende i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); display: block; }

.grafiekhouder { position: relative; }
#grafiek { width: 100%; display: block; overflow: visible; }
#grafiek .raster { stroke: var(--raster); stroke-width: 1; }
#grafiek .as { stroke: var(--as); stroke-width: 1; }
#grafiek text { fill: var(--muted); font-size: 11px; font-family: inherit; }
/* Tekst draagt inkt, geen reekskleur: het gekleurde punt ernaast doet de
   identiteit. */
#grafiek text.eindlabel { font-weight: 700; font-size: 11px; fill: var(--ink); }
#grafiek .lijn { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
#grafiek .punt { stroke: var(--panel); stroke-width: 2; }
#grafiek .vizier { stroke: var(--as); stroke-width: 1; stroke-dasharray: 3 3; }

.grafiektip {
  position: absolute; pointer-events: none; z-index: 3;
  background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 7px 9px; font-size: 12px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
  min-width: 8em;
}
.grafiektip .maand { font-weight: 700; margin-bottom: 4px; }
.grafiektip .rij { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.grafiektip .rij i { width: 10px; height: 3px; border-radius: 2px; background: var(--c); flex: none; }
.grafiektip .rij b { font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  #grafiek { height: 230px; }
}
