:root {
  --bg: #ece8df;
  --bg-accent: #e3ddd1;
  --paper: #fffcf6;
  --ink: #1c1914;
  --muted: #5c564c;
  --line: #d6d0c4;
  --forest: #1e3a34;
  --forest-hover: #152924;
  --moss: #2d6a4f;
  --amber: #9a5b12;
  --amber-bg: #f8ead4;
  --moss-bg: #e3f0e8;
  --rose: #8b2e2e;
  --rose-bg: #f8e4e2;
  --terracotta: #c45c26;
  --shadow: 0 1px 2px rgba(28, 25, 20, 0.06), 0 8px 24px rgba(28, 25, 20, 0.06);
  --radius: 16px;
  --font: "Segoe UI", "Source Sans 3", system-ui, -apple-system, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #f6f1e6, transparent 55%),
    var(--bg);
  line-height: 1.5;
}

a { color: var(--forest); }
a:hover { color: var(--terracotta); }

h1, h2 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 0.35em;
}

h1 { font-size: clamp(1.7rem, 3vw, 2.2rem); }
h2 { font-size: 1.2rem; }

.site-header {
  background: var(--forest);
  color: #f4efe6;
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}

.brand {
  font-family: var(--display);
  font-size: 1.35rem;
  color: #fff;
  text-decoration: none;
  margin-right: 0.5rem;
}

.brand:hover { color: #f3d3bc; }

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.15rem;
  flex: 1;
}

.site-nav a {
  color: #e8e2d6;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.badge {
  display: inline-block;
  min-width: 1.25rem;
  padding: 0 0.35rem;
  margin-left: 0.2rem;
  border-radius: 999px;
  background: var(--terracotta);
  color: #fff;
  font-size: 0.75rem;
  line-height: 1.25rem;
  text-align: center;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
  font-size: 0.9rem;
}

.user-label { opacity: 0.9; }

.link-button {
  background: none;
  border: 0;
  color: #f3d3bc;
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  padding: 0;
}

.link-button:hover { color: #fff; }

.nav-toggle {
  display: none;
  margin-left: auto;
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: inherit;
  cursor: pointer;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.site-main.is-auth {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  max-width: 440px;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 1rem 1.5rem;
}

.auth-card, .panel, .stat-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card, .form-panel {
  padding: 1.75rem 1.5rem;
  width: 100%;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--terracotta);
  margin: 0 0 0.35rem;
}

.lede, .hint, .empty, .entry-meta, .entry-comment {
  color: var(--muted);
}

.lede { margin: 0 0 1.25rem; }

.stack-form {
  display: grid;
  gap: 0.95rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="time"],
input[type="number"],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfc8bb;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--forest);
  outline-offset: 1px;
  border-color: var(--forest);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--forest);
  color: #fff;
}

.button.primary:hover { background: var(--forest-hover); color: #fff; }

.button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.button.ghost:hover { background: var(--bg-accent); color: var(--ink); }

.button.danger {
  background: var(--rose);
  color: #fff;
}

.button.danger:hover { filter: brightness(0.92); color: #fff; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-head .lede { margin-bottom: 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.25rem;
}

.stat-card { padding: 1rem 1.1rem; }

.stat-label {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.stat-value {
  margin: 0.2rem 0 0;
  font-family: var(--display);
  font-size: 1.85rem;
}

.stat-value span {
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--muted);
}

.stat-card.is-approved { border-top: 4px solid var(--moss); }
.stat-card.is-pending { border-top: 4px solid var(--amber); }
.stat-card.is-rejected { border-top: 4px solid var(--rose); }

.panel { padding: 1.15rem 1.2rem; margin-bottom: 1.15rem; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th, td {
  text-align: left;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

.num { text-align: right; font-variant-numeric: tabular-nums; }

tfoot th { border-bottom: 0; border-top: 1px solid var(--ink); }

.entry-list, .review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.entry-item, .review-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.entry-item {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.entry-item:last-child { border-bottom: 0; padding-bottom: 0; }

.entry-date, .entry-name { margin: 0; font-weight: 650; }
.entry-desc { margin: 0.15rem 0; }
.entry-meta, .entry-comment { margin: 0.15rem 0 0; font-size: 0.9rem; }
.entry-side { text-align: right; flex: 0 0 auto; }
.hours { display: block; font-variant-numeric: tabular-nums; font-weight: 650; }

.status {
  display: inline-block;
  margin-top: 0.25rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 650;
}

.status-ingediend { background: var(--amber-bg); color: var(--amber); }
.status-goedgekeurd { background: var(--moss-bg); color: var(--moss); }
.status-afgekeurd { background: var(--rose-bg); color: var(--rose); }

.flash-list { display: grid; gap: 0.5rem; margin-bottom: 1rem; width: 100%; }

.flash {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.flash-success { background: var(--moss-bg); border-color: #b7d4c3; }
.flash-error { background: var(--rose-bg); border-color: #e3b6b2; }

.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.filter-tabs a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.92rem;
}

.filter-tabs a[aria-current="page"] {
  background: var(--forest);
  border-color: var(--forest);
  color: #fff;
}

.period-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.period-nav {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.period-label { font-weight: 650; }

.person-filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.person-filter select { width: auto; min-width: 12rem; }

.mode-toggle {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.45rem;
}

.mode-toggle legend { padding: 0 0.3rem; font-weight: 650; }

.choice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.field-group .hint { grid-column: 1 / -1; margin: 0; font-size: 0.88rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
  gap: 1.15rem;
  align-items: start;
}

.review-form { margin-top: 0.85rem; display: grid; gap: 0.7rem; }

.hint { font-weight: 400; font-size: 0.88rem; margin: 0; }
.empty { margin: 0; }
code { font-size: 0.9em; }

@media (max-width: 800px) {
  .stat-grid,
  .split,
  .field-group { grid-template-columns: 1fr; }

  .nav-toggle { display: inline-flex; }
  .site-nav, .header-user { display: none; width: 100%; }
  .site-header.is-open .site-nav,
  .site-header.is-open .header-user {
    display: flex;
  }
  .header-user { margin-left: 0; padding-top: 0.25rem; }
  .entry-item, .review-top { flex-direction: column; }
  .entry-side { text-align: left; }
  .period-nav { width: 100%; justify-content: space-between; }
}

.stat-sub {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.stat-card.is-saldo { border-top: 4px solid var(--forest); }

.kind {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  vertical-align: middle;
}

.kind-overuren { background: #e8efe9; color: var(--forest); }
.kind-vakantie { background: #f3e6d8; color: #8a4b1f; }
.kind-verlof { background: #e4e8f2; color: #2a3d6e; }

.date-input {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  max-width: 14rem;
}

.badge-inline {
  background: var(--terracotta);
  color: #fff;
}

.filter-tabs .badge-inline {
  margin-left: 0.15rem;
}

.lede.tight { margin: 0 0 0.8rem; font-weight: 650; }

.allowance-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.allowance-form input[type="text"] {
  width: 4.5rem;
  padding: 0.4rem 0.5rem;
}

.remaining-cell {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 4.5rem;
}

.password-reset-form input[type="password"] {
  width: 9rem;
  padding: 0.4rem 0.5rem;
}
