/* BOSDESK — diep bosgroen met goudgeel accent, geïnspireerd op de Surinaamse vlag */
:root {
  --groen-900: #0d2e22;
  --groen-800: #123c2d;
  --groen-700: #1a4f3b;
  --groen-100: #e4efe9;
  --goud: #e3b341;
  --goud-donker: #b8860b;
  --rood: #b3372f;
  --inkt: #1d2420;
  --grijs: #5f6a64;
  --lijn: #d7ded9;
  --papier: #f7f8f6;
  --wit: #ffffff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--inkt);
  background: var(--papier);
  display: flex;
  min-height: 100vh;
}

/* ---------- Zijbalk ---------- */
.sidebar {
  width: 230px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--groen-900), var(--groen-800));
  color: var(--groen-100);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 0;
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  padding: 0 1.25rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--wit);
}
.brand-mark {
  width: 14px; height: 14px;
  background: var(--goud);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
  display: inline-block;
}
.brand-area {
  flex-basis: 100%;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--goud);
}
.sidebar nav { display: flex; flex-direction: column; margin-top: 0.5rem; }
.sidebar nav a {
  color: var(--groen-100);
  text-decoration: none;
  padding: 0.65rem 1.25rem;
  border-left: 3px solid transparent;
  font-size: 0.95rem;
}
.sidebar nav a:hover { background: rgba(255,255,255,0.06); }
.sidebar nav a.active {
  border-left-color: var(--goud);
  background: rgba(255,255,255,0.08);
  color: var(--wit);
  font-weight: 600;
}
.sidebar-foot {
  margin-top: auto;
  padding: 1rem 1.25rem 0;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border-top: 1px solid rgba(255,255,255,0.12);
}
.sidebar-foot a { color: var(--goud); text-decoration: none; }

/* ---------- Inhoud ---------- */
.content { flex: 1; padding: 2rem 2.5rem; max-width: 1100px; }
.page-title { margin: 0 0 1.25rem; font-size: 1.5rem; }
h2 { font-size: 1.1rem; margin: 1.75rem 0 0.75rem; }
.muted { color: var(--grijs); font-size: 0.9rem; }

/* ---------- Kaarten en statistieken ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.stat {
  background: var(--wit);
  border: 1px solid var(--lijn);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}
.stat .stat-value { font-size: 1.6rem; font-weight: 700; color: var(--groen-800); }
.stat .stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--grijs); }

.card {
  background: var(--wit);
  border: 1px solid var(--lijn);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* ---------- Tabellen ---------- */
.table { width: 100%; border-collapse: collapse; background: var(--wit); border: 1px solid var(--lijn); border-radius: 10px; overflow: hidden; }
.table th, .table td { text-align: left; padding: 0.6rem 0.85rem; border-bottom: 1px solid var(--lijn); font-size: 0.92rem; vertical-align: middle; }
.table thead th { background: var(--groen-100); color: var(--groen-900); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tbody tr:hover { background: #fbfcfa; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .actions { white-space: nowrap; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.badge-active, .badge-paid { background: #e0f0e6; color: #14532d; }
.badge-pending { background: #fdf3d7; color: var(--goud-donker); }
.badge-suspended, .badge-unpaid { background: #fbe4e2; color: var(--rood); }
.badge-terminated, .badge-cancelled { background: #e7e9e7; color: var(--grijs); }

/* ---------- Formulieren ---------- */
form.stack { display: grid; gap: 0.85rem; max-width: 520px; }
label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--lijn);
  border-radius: 8px;
  font: inherit;
  background: var(--wit);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--goud); outline-offset: 1px; border-color: var(--goud-donker); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; }

.btn {
  display: inline-block;
  background: var(--groen-800);
  color: var(--wit);
  border: none;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--groen-700); }
.btn-gold { background: var(--goud); color: var(--groen-900); }
.btn-gold:hover { background: #d4a432; }
.btn-danger { background: var(--rood); }
.btn-danger:hover { background: #9c2d26; }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-link { background: none; color: var(--groen-800); text-decoration: underline; padding: 0; }
.inline-form { display: inline; }

/* ---------- Meldingen ---------- */
.flash { border-radius: 8px; padding: 0.7rem 1rem; margin-bottom: 1rem; font-size: 0.92rem; }
.flash-success { background: #e0f0e6; color: #14532d; border: 1px solid #bcdcc8; }
.flash-error { background: #fbe4e2; color: var(--rood); border: 1px solid #f1c4c0; }
.flash-info { background: #fdf3d7; color: var(--goud-donker); border: 1px solid #f0dfae; }

/* ---------- Kale pagina's (login / installer) ---------- */
body.bare { display: block; background: var(--groen-900); }
.bare-card {
  max-width: 420px;
  margin: 8vh auto;
  background: var(--wit);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.bare-card .brand { color: var(--groen-900); padding: 0 0 1rem; }
.bare-card .brand-area { color: var(--goud-donker); }

/* ---------- Factuur ---------- */
.invoice-sheet { background: var(--wit); border: 1px solid var(--lijn); border-radius: 10px; padding: 2rem; max-width: 760px; }
.invoice-head { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.invoice-brand { font-size: 1.3rem; font-weight: 700; color: var(--groen-900); letter-spacing: 0.04em; }
.invoice-meta h1 { margin: 0 0 0.4rem; font-size: 1.2rem; }
.invoice-client h2, .invoice-bank h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--grijs); }
.invoice-items { margin-top: 1.25rem; }
.invoice-items tfoot th { background: var(--groen-100); font-size: 1rem; }
.invoice-bank { margin-top: 1.25rem; border-top: 2px solid var(--goud); padding-top: 0.75rem; }

@media print {
  .sidebar, .page-title, .flash, .no-print { display: none !important; }
  body { background: var(--wit); display: block; }
  .content { padding: 0; max-width: none; }
  .invoice-sheet { border: none; padding: 0; }
}

/* ---------- Mobiel ---------- */
@media (max-width: 760px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 0.75rem 1rem; gap: 0.5rem; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; margin: 0; }
  .sidebar nav a { padding: 0.4rem 0.6rem; border-left: none; border-bottom: 2px solid transparent; }
  .sidebar nav a.active { border-bottom-color: var(--goud); background: none; }
  .sidebar-foot { margin: 0 0 0 auto; border: none; padding: 0; flex-direction: row; gap: 0.75rem; }
  .content { padding: 1.25rem 1rem; }
  .form-row { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; }
}
