:root {
  --navy: #0f1d33;
  --navy-2: #172a47;
  --navy-3: #22385c;
  --cream: #f6f2ea;
  --paper: #fbf9f5;
  --line: #e6dfd2;
  --ink: #1a2333;
  --muted: #6b7385;
  --gold: #c39a52;
  --gold-soft: #f1e6d0;
  --ok: #2f7d5b;
  --ok-soft: #e3f1ea;
  --err: #b23a3a;
  --err-soft: #f8e6e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 29, 51, .05), 0 8px 24px rgba(15, 29, 51, .06);
  --serif: 'Fraunces', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--sans); color: var(--ink); background: var(--cream); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; line-height: 1.2; }
h1 { font-size: clamp(26px, 3vw, 34px); }
h2 { font-size: 19px; margin-bottom: 12px; }
h3 { font-size: 16px; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.block { display: block; }
.center { text-align: center; }
.right { text-align: right; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); font-weight: 600; margin-bottom: 6px; }
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.hint { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; }
.logo-mark { width: 34px; height: 34px; color: var(--gold); flex: none; display: inline-flex; }
.logo-mark svg { width: 100%; height: 100%; }
.brand-name { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.1; }
.brand-sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; margin-top: 2px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 10px; padding: 10px 18px; font: 500 14px var(--sans); cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-3); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--navy-3); }
.btn.danger { background: #fff; border-color: #e7c2bf; color: var(--err); }
.btn.danger:hover { background: var(--err); color: #fff; border-color: var(--err); }
.btn.sm { padding: 6px 12px; font-size: 13px; }
.btn.full { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; opacity: .8; }
.link-btn:hover { opacity: 1; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Forms */
label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 14px; }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; font: 400 15px var(--sans); color: var(--ink); background: #fff; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(34, 56, 92, .12); }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.span-2 { grid-column: span 2; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.narrow-form { max-width: 480px; }

/* Cards & flashes */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card.narrow { width: 100%; max-width: 420px; margin: 0; }
.card.soon { background: var(--paper); border-style: dashed; box-shadow: none; }
.card.danger-zone h2 { color: var(--err); }
.flash { padding: 12px 14px; border-radius: 10px; margin-bottom: 18px; font-size: 14px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.err { background: var(--err-soft); color: var(--err); }
.empty { color: var(--muted); margin: 0; }
.empty.pad { padding: 28px 24px; }

/* Pills & avatars */
.pill { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.off { background: #eee; color: #777; }
.pill.soft { background: var(--gold-soft); color: #8a6a2f; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--navy-2); color: var(--gold-soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex: none; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.lg { width: 60px; height: 60px; font-size: 20px; font-family: var(--serif); }

/* ---------- Login ---------- */
body.auth { background: var(--cream); }
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-wrap.single { grid-template-columns: 1fr; }
.auth-visual { background: radial-gradient(1200px 600px at 20% 110%, rgba(195, 154, 82, .28), transparent 60%), linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 48px; display: flex; position: relative; overflow: hidden; }
.auth-visual::after { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 80px); pointer-events: none; }
.auth-visual-inner { display: flex; flex-direction: column; justify-content: space-between; width: 100%; position: relative; z-index: 1; }
.auth-quote { font-family: var(--serif); font-size: clamp(34px, 4vw, 52px); line-height: 1.1; margin: auto 0 18px; }
.auth-quote em { color: var(--gold); font-style: italic; }
.auth-caption { max-width: 380px; opacity: .75; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form .card { padding: 36px; }
.auth-form .card .brand { margin-bottom: 22px; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form .muted { margin-bottom: 22px; }
.auth-form .small { margin: 18px 0 0; }
.mobile-brand { display: none; }

/* ---------- Admin ---------- */
body.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { background: var(--navy); color: #fff; padding: 26px 18px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { padding: 0 8px 26px; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: rgba(255, 255, 255, .72); font-weight: 500; }
.sidebar nav a svg { width: 18px; height: 18px; fill: currentColor; opacity: .8; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: var(--navy-3); color: #fff; }
.sidebar nav a.active svg { color: var(--gold); opacity: 1; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding: 16px 8px 0; font-size: 13px; }
.me { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.me .avatar { background: var(--gold); color: var(--navy); }
.me-name { font-weight: 600; }
.me-mail { opacity: .6; font-size: 12px; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.sidebar .link-btn { color: rgba(255, 255, 255, .8); }
.main { padding: 36px 44px 60px; max-width: 1180px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head .muted { margin: 4px 0 0; }
.user-head { display: flex; align-items: center; gap: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-num { font-family: var(--serif); font-size: 34px; font-weight: 600; color: var(--navy); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }
.stat-label em { font-style: normal; color: var(--gold); }
.stat.placeholder { background: var(--paper); border-style: dashed; box-shadow: none; }
.stat.placeholder .stat-num { color: #c8c0b0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-2 .card { margin-bottom: 20px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li a { display: flex; align-items: center; gap: 12px; padding: 10px 8px; margin: 0 -8px; border-radius: 10px; text-decoration: none; }
.list li a:hover { background: var(--cream); }
.list li + li { border-top: 1px solid #f0ebe1; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.tabs a { padding: 7px 16px; border-radius: 8px; text-decoration: none; font-weight: 500; font-size: 14px; color: var(--muted); }
.tabs a.active { background: var(--navy); color: #fff; }
.search input { margin: 0; width: 300px; max-width: 100%; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; padding: 14px 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.table td { padding: 14px 20px; border-bottom: 1px solid #f0ebe1; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fdfcf9; }
.user-cell { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.grid-detail { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.section-title { font-size: 15px; font-family: var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.side-stack .card { padding: 20px; }
.side-stack h2 { font-size: 16px; }
.meta { margin: 0; }
.meta div { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #f0ebe1; font-size: 14px; }
.meta div:last-child { border: 0; }
.meta dt { color: var(--muted); }
.meta dd { margin: 0; text-align: right; }
.creds { border-color: var(--gold); background: linear-gradient(180deg, #fffdf8, #fff); }
.creds-list { margin: 12px 0 18px; display: grid; gap: 8px; }
.creds-list div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; font-size: 14px; }
.creds-list dt { color: var(--muted); }
.creds-list dd { margin: 0; word-break: break-all; }
.creds code { font-size: 15px; background: var(--gold-soft); padding: 3px 8px; border-radius: 6px; letter-spacing: .03em; }

/* ---------- Klantomgeving ---------- */
body.client { background: var(--cream); }
.preview-bar { background: var(--gold); color: var(--navy); text-align: center; padding: 10px 16px; font-size: 14px; }
.preview-bar a { font-weight: 600; margin-left: 10px; }
.topbar { background: var(--navy); color: #fff; padding: 18px clamp(20px, 5vw, 56px); display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.topnav { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.topnav a { text-decoration: none; opacity: .8; }
.topnav a:hover { opacity: 1; }
.client-main { max-width: 1120px; margin: 0 auto; padding: 44px clamp(20px, 5vw, 56px) 70px; }
.hero { padding: 10px 0 34px; max-width: 680px; }
.hero h1 { font-size: clamp(32px, 4.5vw, 46px); margin-bottom: 12px; }
.lead { font-size: 17px; color: var(--muted); }
.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-head h2 { margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 30px; }
.media-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.media-thumb { aspect-ratio: 16 / 9; background: linear-gradient(135deg, var(--navy-2), var(--navy-3)); position: relative; display: flex; align-items: center; justify-content: center; }
.media-card.is-placeholder .media-thumb { background: repeating-linear-gradient(135deg, #ece5d8 0 12px, #f3eee5 12px 24px); }
.media-thumb .play .logo-mark { width: 52px; height: 52px; color: #c9bda7; }
.media-thumb .tag { position: absolute; top: 12px; left: 12px; background: rgba(255, 255, 255, .9); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 99px; }
.media-body { padding: 16px 18px; }
.media-body h3 { margin-bottom: 4px; }
.card.help { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.card.help h2 { margin-bottom: 4px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-detail { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .mobile-brand { display: block; }
  body.app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 16px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .sidebar .brand { padding: 0; margin-right: auto; }
  .sidebar nav { flex-direction: row; order: 3; width: 100%; overflow-x: auto; }
  .sidebar nav a { padding: 8px 10px; font-size: 14px; white-space: nowrap; }
  .sidebar-foot { margin: 0; border: 0; padding: 0; }
  .me { display: none; }
  .main { padding: 24px 18px 50px; }
  .hide-sm { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .search input { width: 100%; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .topbar .brand-sub { display: none; }
}