/* Hinoki Easy Lead — rustig, bos-groen, werkt op telefoon en desktop */
:root {
  --bg: #F4F5EF;
  --surface: #FFFFFF;
  --surface-2: #EEF0E6;
  --ink: #1F261A;
  --muted: #5B6652;
  --faint: #8A9380;
  --line: #DCE0D2;
  --brand: #618B25;          /* groen uit het Hinoki-logo */
  --brand-ink: #3F5E17;
  --brand-soft: #E6EED8;
  --brand-mid: #C2D49C;
  --water: #DCE4E8;
  --land: #F0F1EA;
  --hot: #B3432F;   --hot-soft: #F6E1DC;
  --normal: #A8741F; --normal-soft: #F4E9D4;
  --cold: #52697A;  --cold-soft: #E1E8ED;
  --ok: #3E7D3C;    --warn: #A8741F;  --bad: #B3432F;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(31,38,26,.05), 0 4px 14px rgba(31,38,26,.05);
  color-scheme: light;
}
/* Donker: volgt het systeem, behalve als de gebruiker zelf koos (data-theme op <html>) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12160E; --surface: #1A2014; --surface-2: #20281A; --ink: #E9ECE3; --muted: #A9B39E; --faint: #768069;
    --line: #2C3524; --brand: #8DBB4E; --brand-ink: #A9D06F; --brand-soft: #25321A; --brand-mid: #46632A;
    --hot: #E58470; --hot-soft: #3A221C; --normal: #DDAA55; --normal-soft: #362A16; --cold: #93AEC1; --cold-soft: #1E2A33;
    --ok: #7FC07A; --warn: #DDAA55; --bad: #E58470; --water: #141C21; --land: #2A3222;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .logo { filter: brightness(1.35); }
  :root:not([data-theme="light"]) .btn.primary,
  :root:not([data-theme="light"]) button.primary { color: #12160E; }
}
:root[data-theme="dark"] {
    --bg: #12160E; --surface: #1A2014; --surface-2: #20281A; --ink: #E9ECE3; --muted: #A9B39E; --faint: #768069;
    --line: #2C3524; --brand: #8DBB4E; --brand-ink: #A9D06F; --brand-soft: #25321A; --brand-mid: #46632A;
    --hot: #E58470; --hot-soft: #3A221C; --normal: #DDAA55; --normal-soft: #362A16; --cold: #93AEC1; --cold-soft: #1E2A33;
    --ok: #7FC07A; --warn: #DDAA55; --bad: #E58470; --water: #141C21; --land: #2A3222;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.25);
    color-scheme: dark;
}
:root[data-theme="dark"] .logo { filter: brightness(1.35); }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] button.primary { color: #12160E; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand-ink); }
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

/* layout */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .inner { max-width: 1180px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.logo { height: 36px; width: auto; }
.brand span { font-family: Georgia, serif; font-size: 1.05rem; border-left: 1px solid var(--line); padding-left: 10px; }
nav.main { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav.main a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--muted); }
nav.main a:hover { background: var(--surface-2); color: var(--ink); }
nav.main a.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
main { max-width: 1180px; margin: 0 auto; padding: 22px 16px 60px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card > h2 { margin-bottom: 10px; }

/* knoppen & formulieren */
button, .btn { font: inherit; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  padding: 6px 12px; border-radius: 8px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: var(--surface-2); }
.btn.primary, button.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover, button.primary:hover { background: var(--brand-ink); }
button.danger { color: var(--bad); }
button.small, .btn.small { padding: 3px 9px; font-size: .85rem; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
input, select { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; }
form.inline { display: inline; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters input[type=search] { min-width: 200px; }
label.stacked { display: flex; flex-direction: column; gap: 4px; font-size: .9rem; color: var(--muted); }

/* meldingen */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid var(--line); }
.flash.ok { background: var(--brand-soft); }
.flash.fout { background: var(--hot-soft); }

/* niveaus & statussen */
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.pill.hot { background: var(--hot-soft); color: var(--hot); }
.pill.normal { background: var(--normal-soft); color: var(--normal); }
.pill.cold { background: var(--cold-soft); color: var(--cold); }
.pill.on { background: var(--brand-soft); color: var(--brand-ink); }
.pill.off { background: var(--surface-2); color: var(--faint); }
.pill.st-ok { background: var(--brand-soft); color: var(--ok); }
.pill.st-fout, .pill.st-geblokkeerd { background: var(--hot-soft); color: var(--bad); }
.pill.st-leeg, .pill.st-none { background: var(--surface-2); color: var(--faint); }
.tag { display: inline-block; padding: 0 7px; border-radius: 6px; font-size: .75rem; background: var(--surface-2); color: var(--muted); margin: 1px 2px 1px 0; }
.score { font-weight: 700; font-variant-numeric: tabular-nums; }
.score.hot { color: var(--hot); } .score.normal { color: var(--normal); } .score.cold { color: var(--cold); }

/* tegels */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { border-radius: var(--radius); padding: 12px 14px; }
.tile.hot { background: var(--hot-soft); } .tile.normal { background: var(--normal-soft); } .tile.cold { background: var(--cold-soft); }
.tile b { display: block; font-size: 1.8rem; font-family: Georgia, serif; line-height: 1.1; }
.tile.hot b { color: var(--hot); } .tile.normal b { color: var(--normal); } .tile.cold b { color: var(--cold); }
.tile span { font-size: .82rem; color: var(--muted); }
.period { display: grid; grid-template-columns: 80px 1fr 1fr 1fr; gap: 6px 10px; align-items: center; }
.period .h { font-size: .78rem; color: var(--faint); text-transform: uppercase; letter-spacing: .05em; }

/* tabellen */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 600;
  padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr.clickable:hover td { background: var(--surface-2); }
td a.rowlink { color: var(--ink); text-decoration: none; font-weight: 600; }
td a.rowlink:hover { text-decoration: underline; }
.icons { white-space: nowrap; color: var(--brand-ink); font-size: .85rem; }

/* bronnen */
.cat-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.src-row.off td { opacity: .62; }
.src-name { font-weight: 600; }
.src-id { font-family: ui-monospace, Menlo, monospace; font-size: .78rem; color: var(--faint); }

/* werkgebied */
.wave { border-left: 4px solid var(--line); padding: 8px 0 8px 14px; }
.wave.active { border-left-color: var(--brand); }
.wave h3 { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.chips { margin-top: 6px; }
.chip { display: inline-block; padding: 2px 8px; margin: 2px 3px 2px 0; border-radius: 999px; font-size: .8rem; background: var(--surface-2); }
.chip.tour { background: var(--brand-soft); color: var(--brand-ink); }

/* detail */
dl.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
@media (max-width: 560px) { dl.kv { grid-template-columns: 1fr; } dl.kv dt { margin-top: 6px; } .tiles { grid-template-columns: 1fr; } }

/* login */
.login-wrap { min-height: 90vh; display: grid; place-items: center; padding: 16px; }
.login { width: 100%; max-width: 360px; }
.login .logo { height: 54px; margin-bottom: 8px; }
.login form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; }
.tile-link { text-decoration: none; }
.mt { margin-top: 14px; }

/* telefoon: menu als scrollbare rij onder het logo */
.topbar form.inline { margin-left: auto; }
@media (max-width: 760px) {
  .topbar .inner { gap: 8px 12px; }
  nav.main { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  nav.main a { white-space: nowrap; }
  .brand span { display: none; }
  h1 { font-size: 1.45rem; }
}


/* ── voorkeuren in de balk: thema en taal ── */
.prefs { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
nav.main a { white-space: nowrap; }

/* thema-knop: zon/maan zoals in de andere Hinoki-apps (toont het thema waar je NAARTOE gaat) */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px;
  padding: 0; flex-shrink: 0; background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted); cursor: pointer; vertical-align: middle; transition: background 120ms, color 120ms; }
.theme-toggle:hover { background: var(--brand-soft); color: var(--brand-ink); }
.theme-toggle svg { width: 16px; height: 16px; display: block; }
.theme-toggle .theme-ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-ic-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-ic-sun { display: block; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg a, .seg button { border: 0; background: var(--surface); color: var(--muted); padding: 4px 9px;
  font: inherit; font-size: .85rem; cursor: pointer; text-decoration: none; }
.seg a.on, .seg button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

/* ── werkgebied: kaart + lijst per provincie ── */
.maprow { display: grid; gap: 18px; grid-template-columns: minmax(250px, 320px) 1fr; align-items: start; }
.mapwrap { background: var(--water); border-radius: var(--radius); padding: 8px; }
.mapwrap svg { width: 100%; height: auto; display: block; }
.mapwrap path { stroke: var(--surface); stroke-width: 1.2; }
.mapwrap path.clickable { cursor: pointer; }
.mapwrap path.clickable:hover { stroke: var(--ink); stroke-width: 1.6; }
.mapwrap text { font-size: 6.5px; fill: var(--ink); pointer-events: none; font-family: system-ui, sans-serif; }
.lvl0 { fill: var(--land); } .lvl1 { fill: var(--brand-mid); } .lvl2 { fill: var(--brand); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .83rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px;
  vertical-align: -1px; border: 1px solid var(--line); }
.legend i.lvl0 { background: var(--land); }
.legend i.lvl1 { background: var(--brand-mid); }
.legend i.lvl2 { background: var(--brand); }
.prov { border-top: 1px solid var(--line); padding: 11px 0; display: grid; gap: 8px 12px;
  grid-template-columns: 1fr auto; align-items: start; }
.prov:first-of-type { border-top: 0; }
.prov .names { grid-column: 1 / -1; }
.provname { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.steps { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.steps button { border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--muted);
  padding: 5px 10px; font: inherit; font-size: .84rem; cursor: pointer; white-space: nowrap; }
.steps button:first-child { border-left: 0; }
.steps button[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

/* ── zelf een lead toevoegen ── */
form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 14px; }
form.grid label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
form.grid .wide { grid-column: 1 / -1; }
form.grid input, form.grid select, form.grid textarea { font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; max-width: 100%; }
.pill.hand { background: var(--surface-2); color: var(--muted); }

@media (max-width: 860px) { .maprow { grid-template-columns: 1fr; } }
@media (max-width: 760px) { .prov { grid-template-columns: 1fr; } .steps { flex-wrap: wrap; } }
