:root {
  --bg: #0e1116;
  --bg-raised: #151a21;
  --bg-hover: #1b222b;
  --line: #242c37;
  --text: #e7ebf1;
  --text-dim: #8a94a6;
  --text-faint: #5b6577;
  --accent: #ff4d4d;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }

button, input, select, textarea { font: inherit; color: inherit; }
button {
  background: var(--bg-hover); border: 1px solid var(--line); border-radius: 8px; padding: 7px 14px; cursor: pointer;
}
button:hover { border-color: #34404f; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.ok { background: #12392c; border-color: #1f6a50; color: var(--ok); font-weight: 600; }
button.danger { color: var(--bad); }
button.small { padding: 4px 10px; font-size: 12.5px; }

input, select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #4d5b70; }
label { display: grid; gap: 5px; font-size: 12.5px; color: var(--text-dim); }
label small { color: var(--text-faint); }
code { font-family: var(--mono); font-size: 12.5px; }

.brand { font-size: 16px; display: flex; align-items: center; gap: 9px; letter-spacing: .2px; }
.brand b { font-weight: 700; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

/* Inloggen */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(360px, 100%); display: grid; gap: 16px; background: var(--bg-raised); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.error { color: var(--bad); margin: 0; font-size: 13px; }

/* Kop */
.top { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 24px; background: rgba(14, 17, 22, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.banner { margin: 16px 24px 0; padding: 10px 14px; border: 1px solid #5b4a17; background: #2a2310; color: var(--warn); border-radius: 10px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.content { padding: 8px 24px 40px; max-width: 1400px; margin: 0 auto; }
h2 { font-size: 15px; margin: 26px 0 4px; display: flex; align-items: center; gap: 8px; }
.count { background: var(--accent); color: #fff; border-radius: 99px; font-size: 12px; padding: 0 8px; }
.count:empty { display: none; }
.hint { margin: 0 0 12px; color: var(--text-dim); font-size: 13px; }

/* Aanvragen */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.card { background: var(--bg-raised); border: 1px solid var(--line); border-left: 3px solid var(--warn); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; }
.card .who { font-size: 15px; font-weight: 600; }
.card .meta { color: var(--text-dim); font-size: 12.5px; display: grid; gap: 2px; }
.card .code { font-family: var(--mono); font-size: 15px; letter-spacing: .5px; }
.card .buttons { display: flex; gap: 8px; }
.card .buttons button:first-child { flex: 1; }
.empty { color: var(--text-faint); font-size: 13px; padding: 14px 0; }

/* Licenties */
.filters { display: flex; gap: 12px; align-items: center; margin: 8px 0 12px; flex-wrap: wrap; }
.filters input[type=search] { max-width: 360px; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.check input { width: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-raised); }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-dim); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: var(--bg-hover); }
td.code { font-family: var(--mono); font-size: 12.5px; white-space: nowrap; }
td .sub { color: var(--text-faint); font-size: 12px; }
td.actions { white-space: nowrap; text-align: right; }
td.actions button + button { margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chip { font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: var(--bg); border: 1px solid var(--line); color: var(--text-dim); white-space: nowrap; }
.status { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.status.approved { color: var(--ok); background: #0f2e24; }
.status.blocked { color: var(--bad); background: #351a1a; }
.status.pending { color: var(--warn); background: #2a2310; }
.status.expired { color: var(--text-dim); background: var(--bg); }
.stale { color: var(--warn); }

/* Dialogen */
dialog { background: var(--bg-raised); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog form { display: grid; gap: 14px; padding: 22px; }
dialog h3 { margin: 0; font-size: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2a37; border: 1px solid #34404f; padding: 10px 16px; border-radius: 10px; z-index: 10; }
.toast.bad { border-color: #7f2a2a; color: var(--bad); }

@media (max-width: 640px) {
  .top { padding: 12px 16px; }
  .content { padding: 8px 16px 32px; }
  .banner { margin: 12px 16px 0; }
  .row { grid-template-columns: 1fr; }
}
