/* =====================================================================
   Puddu Advocatuur CRM — Design System
   Font: Inter (Google Fonts)
   Palette: Deep Navy + Gold accent + Neutral greys
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --navy-900: #0d1b2a;
  --navy-800: #1a2d42;
  --navy-700: #1f3553;
  --navy-600: #254566;
  --gold:     #c9a84c;
  --gold-lt:  #e4c97a;
  --success:  #22c55e;
  --danger:   #ef4444;
  --warning:  #f59e0b;
  --info:     #3b82f6;
  --bg:       #f0f4f8;
  --surface:  #ffffff;
  --border:   #dde3ec;
  --text:     #1e293b;
  --muted:    #64748b;
  --sidebar-w:240px;
  --radius:   10px;
  --shadow:   0 2px 12px rgba(0,0,0,.08);
  --transition: .18s ease;
}

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

html { font-size: 15px; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--gold); }

/* ── Layout ─────────────────────────────────────────────── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w); height: 100vh; position: fixed; top: 0; left: 0;
  background: var(--navy-900); display: flex; flex-direction: column;
  z-index: 100; transition: var(--transition); overflow: hidden;
}
.sidebar__logo {
  padding: 28px 20px 22px; border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar__logo h1 {
  font-size: .95rem; font-weight: 700; color: #fff; letter-spacing: .5px;
}
.sidebar__logo span { color: var(--gold); }
.sidebar__logo small { display: block; color: rgba(255,255,255,.4); font-size: .72rem; margin-top: 2px; }

.sidebar__nav {
  flex: 1; padding: 14px 0; overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.12) transparent;
}
.sidebar__nav::-webkit-scrollbar { width: 4px; }
.sidebar__nav::-webkit-scrollbar-track { background: transparent; }
.sidebar__nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
}
.sidebar__nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,.25);
}
.nav-section { padding: 18px 20px 6px; font-size: .68rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,.3); }
.sidebar__nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px; font-size: .86rem; color: rgba(255,255,255,.7);
  transition: var(--transition); border-left: 3px solid transparent;
}
.sidebar__nav a:hover, .sidebar__nav a.active {
  color: #fff; background: rgba(255,255,255,.06); border-left-color: var(--gold);
}
.sidebar__nav a .nav-icon { font-size: 1.1rem; width: 20px; text-align: center; }
.sidebar__footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: .8rem; color: rgba(255,255,255,.4);
}
.sidebar__footer a { color: rgba(255,255,255,.5); }
.sidebar__footer a:hover { color: var(--gold); }

/* ── Main content ──────────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w); flex: 1;
  display: flex; flex-direction: column; min-height: 100vh;
}
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0 28px; height: 60px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.topbar__title { font-size: 1.05rem; font-weight: 600; color: var(--navy-900); }
.topbar__user { font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.topbar__user strong { color: var(--text); }

/* ── Globale zoekbalk ──────────────────────────────────── */
.global-search { position: relative; flex: 1; max-width: 380px; margin: 0 24px; }
.global-search input {
  width: 100%; height: 36px; padding: 0 14px 0 36px;
  border: 1.5px solid var(--border); border-radius: 20px;
  font-size: .85rem; background: #f8fafc; color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%2364748b' viewBox='0 0 16 16'%3E%3Cpath d='M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.099zm-5.242 1.156a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 12px center;
}
.global-search input:focus {
  outline: none; border-color: var(--navy-600);
  box-shadow: 0 0 0 3px rgba(31,53,83,.08); background: #fff;
}
.global-search__dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  max-height: 360px; overflow-y: auto; z-index: 300;
}
.gs-group {
  padding: 8px 14px 4px; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .8px; color: var(--muted);
  background: #f8fafc; border-bottom: 1px solid var(--border);
}
.gs-group:not(:first-child) { border-top: 1px solid var(--border); }
.gs-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 14px; color: var(--text);
  border-bottom: 1px solid var(--border); transition: background .1s;
  font-size: .875rem;
}
.gs-item:last-child { border-bottom: none; }
.gs-item:hover { background: #f0f4f8; color: var(--text); }
.gs-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.gs-body { display: flex; flex-direction: column; gap: 1px; }
.gs-body strong { font-weight: 600; color: var(--navy-900); }
.gs-body small { font-size: .75rem; color: var(--muted); }
.gs-badge { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: .65rem; font-weight: 600; }
.gs-badge--open   { background: #dcfce7; color: #166534; }
.gs-badge--closed { background: #f1f5f9; color: var(--muted); }
.gs-empty { padding: 18px 14px; text-align: center; color: var(--muted); font-size: .875rem; }

.page { padding: 28px; flex: 1; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 1.3rem; font-weight: 700; color: var(--navy-900); }

/* ── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card-header {
  padding: 16px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  background: #fafbfd;
}
.card-header h3 { font-size: .95rem; font-weight: 600; }
.card-body { padding: 22px; }

/* ── Stat cards ────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 26px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px;
  transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card__label { font-size: .78rem; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.stat-card__value { font-size: 1.9rem; font-weight: 700; color: var(--navy-900); }
.stat-card__sub   { font-size: .78rem; color: var(--muted); }
.stat-card--gold .stat-card__value { color: var(--gold); }
.stat-card--danger .stat-card__value { color: var(--danger); }

/* ── Tables ────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th { padding: 10px 14px; background: #f5f7fa; border-bottom: 2px solid var(--border);
     text-align: left; font-size: .75rem; font-weight: 600; text-transform: uppercase;
     letter-spacing: .5px; color: var(--muted); white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: #fafbfd; }
tr:last-child td { border-bottom: none; }

/* ── Badges ────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
}
.badge-success  { background: #dcfce7; color: #15803d; }
.badge-danger   { background: #fee2e2; color: #b91c1c; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-info     { background: #dbeafe; color: #1d4ed8; }
.badge-muted    { background: #f1f5f9; color: var(--muted); }
.badge-gold     { background: #fdf6e3; color: #92620a; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 7px; font-size: .85rem; font-weight: 500;
  border: none; cursor: pointer; transition: var(--transition); line-height: 1;
  text-decoration: none;
}
.btn:hover { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary  { background: var(--navy-800); color: #fff; }
.btn-gold     { background: var(--gold); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-danger   { background: var(--danger); color: #fff; }
.btn-outline  { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--navy-700); }
.btn-sm { padding: 5px 12px; font-size: .78rem; }

/* ── Forms ─────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: .82rem; font-weight: 500; color: var(--text); }
input, select, textarea {
  padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 7px;
  font-size: .88rem; font-family: inherit; color: var(--text);
  background: var(--surface); transition: border-color var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(37,69,102,.12);
}
textarea { resize: vertical; min-height: 90px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--border); }

/* ── Alerts / flash ────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 8px; font-size: .875rem;
  margin-bottom: 18px; display: flex; align-items: center; gap: 10px;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }

/* ── Empty state ───────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 52px 24px; color: var(--muted);
}
.empty-state .icon { font-size: 2.6rem; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: .9rem; }

/* ── Detail info grid ──────────────────────────────────── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.info-item label { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; display: block; margin-bottom: 3px; }
.info-item span  { font-size: .9rem; color: var(--text); font-weight: 500; }

/* ── Bare layout (login / onboarding) ──────────────────── */
.bare-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-900) 0%, var(--navy-700) 100%);
}
.bare-card {
  background: var(--surface); border-radius: 14px; padding: 40px 44px;
  width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.bare-card h1 { font-size: 1.4rem; font-weight: 700; color: var(--navy-900); margin-bottom: 6px; }
.bare-card .subtitle { font-size: .85rem; color: var(--muted); margin-bottom: 26px; }
.bare-card .logo-mark { font-size: .85rem; color: var(--muted); text-align: center; margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }

/* ── Tabs ──────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 22px; }
.tab-btn {
  padding: 9px 18px; font-size: .85rem; font-weight: 500; color: var(--muted);
  background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: var(--transition);
}
.tab-btn.active, .tab-btn:hover { color: var(--navy-800); border-bottom-color: var(--navy-800); }

/* ── Utility ───────────────────────────────────────────── */
.mt-2  { margin-top: 8px; }
.mt-4  { margin-top: 16px; }
.mt-6  { margin-top: 24px; }
.mb-4  { margin-bottom: 16px; }
.text-muted { color: var(--muted); }
.text-right { text-align: right; }
.font-bold  { font-weight: 700; }
.gap-2 { gap: 8px; }
.flex  { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ── Form grid (2 kolommen) ─────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.form-grid .form-group.full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ── select element ─────────────────────────────────────── */
select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 7px; font-size: .9rem; background: var(--surface);
  color: var(--text); transition: border-color var(--transition);
  appearance: auto;
}
select:focus { outline: none; border-color: var(--navy-600); }

/* ── checkbox ────────────────────────────────────────────── */
input[type="checkbox"] {
  width: 16px; height: 16px; accent-color: var(--navy-700); cursor: pointer;
}

/* ── code inline ─────────────────────────────────────────── */
code {
  font-family: 'Courier New', monospace; font-size: .83rem;
  background: #f1f5f9; padding: 2px 6px; border-radius: 4px; color: var(--navy-800);
}

/* ── Rapportage staafdiagram ─────────────────────────────── */
.bar-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 200px; padding: 0 4px;
}
.bar-chart__col {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; gap: 4px;
}
.bar-chart__val {
  font-size: .62rem; color: var(--muted); text-align: center;
  white-space: nowrap; min-height: 14px; writing-mode: vertical-lr;
  transform: rotate(180deg);
}
.bar-chart__bar {
  width: 100%; height: 150px; display: flex; align-items: flex-end;
  background: #f1f5f9; border-radius: 4px 4px 0 0;
}
.bar-chart__fill {
  width: 100%; border-radius: 4px 4px 0 0;
  background: #e2e8f0; min-height: 4px; transition: height .4s ease;
}
.bar-chart__fill.has-value { background: var(--gold); }
.bar-chart__label { font-size: .7rem; color: var(--muted); }

/* ── Twee-koloms layout kaarten ──────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }

/* ── Voortgangsbalk ──────────────────────────────────────── */
.progress-bar {
  height: 8px; background: var(--border); border-radius: 4px; overflow: hidden;
}
.progress-bar__fill {
  height: 100%; background: var(--gold); border-radius: 4px; transition: width .3s;
}
