/* Base styles: colours (same as Bouwplan, light and dark), reset, shell layout and shared elements. */
:root {
  --bg: #e8ebee;
  --panel: #f5f6f8;
  --input-bg: #ffffff;
  --zebra: #eef0f3;
  --line: #d6dbe0;
  --line-strong: #b4bcc5;
  --fg: #101820;
  --fg-2: #333e49;
  --fg-3: #56626e;
  --accent: #23784a;
  --accent-strong: #1a5e39;
  --accent-soft: #e2f1e8;
  --on-accent: #ffffff;
  --tab-base: #dde2e7;
  --tab-hover: #1f2b38;
  --ok: #23703f;
  --ok-soft: #e3f1e8;
  --warn: #8a5600;
  --warn-soft: #fbf0db;
  --danger: #b3261e;
  --danger-soft: #fbe7e5;
  --muted-soft: #e9ecef;
  --btn-dark: #3b4c5e;
  --btn-dark-hover: #2e3d4d;
  --map-land: #e4e8e3;
  --map-road: #ffffff;
  --map-park: #cfe3cf;
  --map-water: #c9dbe8;
  --map-block: #d5dad6;
  --nav-bg: #1f2b38;
  --nav-line: #2c3a48;
  --nav-fg: #d5dde5;
  --nav-dim: #aab6c2;
  --nav-strong: #ffffff;
  --nav-hover: #283746;
  --nav-active: #2d3e4f;
  --nav-accent: #7fd3a2;
  --c-blue: #3f6fb0;
  --c-amber: #b07a0e;
  --c-green: #23784a;
  --c-plum: #9a4f86;
  --c-other: #9aa4ae;
  --font-ui: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --dur: 0.45s;
  --rail: 72px;
  --nav-w: 264px;
  --top-h: 56px;
  --radius: 6px;
}
/* Dark theme: app.applyTheme() always sets data-theme ("light" or "dark") in the <head>, so this is the only dark block. */
:root[data-theme="dark"] {
  --bg: #0f151b; --panel: #18212a; --input-bg: #121920; --zebra: #1b242d; --line: #2a3541; --line-strong: #3d4a58;
  --fg: #eef2f6; --fg-2: #c3ccd5; --fg-3: #9aa6b2; --accent: #5cc58a; --accent-strong: #7fd3a2; --accent-soft: #16301f;
  --on-accent: #08210f; --tab-base: #2a3541; --tab-hover: #9aa7b4; --ok: #6fca93; --ok-soft: #173020; --warn: #e6b05a;
  --warn-soft: #33281a; --danger: #ef6b62; --danger-soft: #3a1c1a; --muted-soft: #232d37; --btn-dark: #3a4a5b; --btn-dark-hover: #46586a;
  --map-land: #1c252d; --map-road: #2b3743; --map-park: #1d3326; --map-water: #1b2c3b; --map-block: #25303a;
  --nav-bg: #0b1117; --nav-line: #1c252e; --nav-fg: #d0d8e0; --nav-dim: #9aa7b4; --nav-strong: #ffffff; --nav-hover: #151e27; --nav-active: #1d2a37; --nav-accent: #7fd3a2; --c-blue: #5b8fd6; --c-amber: #b8812a; --c-green: #3faa6e; --c-plum: #b874a8; --c-other: #5d6b78;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--font-ui); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Shell: topbar on top, menu on the left, pages in #paging */
body { display: flex; flex-direction: column; overflow: hidden; }
.shell { flex: 1; min-height: 0; display: flex; }
#paging { flex: 1; min-width: 0; overflow-y: auto; }

/* Not logged in: no topbar and menu, the page (login) uses the whole screen */
body.logged-out x-topbar,
body.logged-out x-navigation { display: none; }

/* Pages */
.page { padding: 32px; animation: page-in 0.3s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
.page h1 { font-size: 26px; font-weight: 600; margin-bottom: 4px; }
.page .lead { color: var(--fg-3); margin-bottom: 24px; }

/* Pages with a sidebar (x-sidebar) on the left: <div class="page <name> with-sidebar"><x-sidebar></x-sidebar><section class="content">...</section></div> */
.page.with-sidebar { height: 100%; display: grid; grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); gap: 20px; padding: 20px 24px; }
.page.with-sidebar > .content { min-height: 0; overflow-y: auto; }

/* Icons from js/icons.js */
.ic { width: 20px; height: 20px; flex: none; }

/* Shared elements */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.button { height: 36px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--input-bg); font-weight: 600; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: background 0.25s var(--ease), border-color 0.25s var(--ease); }
.button:hover { background: var(--zebra); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.button.ghost { border-color: transparent; background: none; color: var(--fg-2); }
.button.ghost:hover { background: var(--zebra); color: var(--fg); }
.input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--input-bg); transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.invalid { border-color: var(--danger); }
.field label { display: block; font-size: 14px; font-weight: 500; color: var(--fg); margin-bottom: 6px; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 5px; }

@media (max-width: 1099px) {
  .page.with-sidebar { gap: 16px; padding: 16px; }
}

@media (max-width: 767px) {
  .page { padding: 20px 16px; }
  .page.with-sidebar { display: block; height: auto; padding: 0; }
  .page.with-sidebar > .content { padding: 20px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
