/* ============================================================
   Kantyra — designsysteem
   Fris, premium: petrol & teal, mint-accenten, veel witruimte.
   ============================================================ */

:root {
  --ink: #10282c;
  --ink-soft: #41585c;
  --ink-faint: #7b8f92;
  --brand: #0d9488;
  --brand-strong: #0f766e;
  --brand-deep: #0b3b3c;
  --brand-deeper: #082c2e;
  --mint: #99f6e4;
  --mint-soft: #ecfdf8;
  --bg: #f4f8f7;
  --card: #ffffff;
  --line: #e3ecea;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warn: #d97706;
  --warn-soft: #fffbeb;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --info: #0284c7;
  --info-soft: #f0f9ff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 40, 44, .04), 0 4px 16px rgba(16, 40, 44, .06);
  --shadow-lg: 0 4px 12px rgba(16, 40, 44, .08), 0 16px 48px rgba(16, 40, 44, .12);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 15px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { margin: 0 0 .4rem; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; line-height: 1.55; }

/* ---------- App-shell ---------- */

.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-deep), var(--brand-deeper));
  color: #d8ece9;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.25rem 1.25rem 1rem;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.02em;
}
.sidebar .logo svg { flex-shrink: 0; }
.sidebar .logo:hover { text-decoration: none; }

.sidebar .tenant-name {
  padding: 0 1.25rem .9rem;
  font-size: .78rem;
  color: #8fc8c1;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.nav-section {
  padding: .8rem 1.25rem .3rem;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #6fa8a1;
}

.nav a {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .56rem 1.25rem;
  color: #cde5e1;
  font-weight: 500;
  font-size: .92rem;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.active {
  background: rgba(153, 246, 228, .1);
  border-left-color: var(--mint);
  color: #fff;
}
.nav a .ico { width: 19px; height: 19px; opacity: .85; flex-shrink: 0; }

.sidebar .foot {
  margin-top: auto;
  padding: 1rem 1.25rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: .8rem;
}
.sidebar .foot .user { color: #fff; font-weight: 600; }
.sidebar .foot .role { color: #8fc8c1; font-size: .74rem; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 2rem;
  background: transparent;
}
.topbar .crumb { color: var(--ink-faint); font-size: .85rem; }

.content { padding: 0 2rem 3rem; max-width: 1240px; width: 100%; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}
.page-head .sub { color: var(--ink-soft); font-size: .92rem; margin: 0; }

/* ---------- Kaarten & grids ---------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.35rem 1.5rem;
}
.card + .card { margin-top: 1.25rem; }
.card h2 { margin-bottom: 1rem; }
.card .card-sub { color: var(--ink-soft); font-size: .88rem; margin-top: -0.6rem; margin-bottom: 1rem; }

.grid { display: grid; gap: 1.25rem; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } .grid.cols-3 { grid-template-columns: 1fr; } .grid.cols-2 { grid-template-columns: 1fr; } }

.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.35rem;
}
.stat .label { font-size: .8rem; font-weight: 600; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.stat .value { font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin-top: .15rem; }
.stat .hint { font-size: .8rem; color: var(--ink-soft); margin-top: .2rem; }
.stat.accent { background: linear-gradient(135deg, var(--brand-strong), var(--brand-deep)); border: none; color: #fff; }
.stat.accent .label { color: #a7dcd5; }
.stat.accent .hint { color: #cde5e1; }

/* ---------- Tabellen ---------- */

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
table.data th {
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-faint);
  padding: .55rem .75rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: .7rem .75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr:hover td { background: var(--mint-soft); }
table.data .actions { text-align: right; white-space: nowrap; }

/* ---------- Badges & chips ---------- */

.badge {
  display: inline-block;
  padding: .18rem .6rem;
  border-radius: 999px;
  font-size: .74rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge.gray { background: #f1f5f4; color: var(--ink-soft); }
.badge.green { background: var(--ok-soft); color: var(--ok); }
.badge.amber { background: var(--warn-soft); color: var(--warn); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
.badge.blue { background: var(--info-soft); color: var(--info); }
.badge.mint { background: var(--mint-soft); color: var(--brand-strong); }
.badge.dark { background: var(--brand-deep); color: var(--mint); }

.ref { font-family: var(--mono); font-size: .8rem; color: var(--ink-soft); }

/* ---------- Knoppen ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.05rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--brand-strong);
  color: #fff;
  font-family: var(--font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, box-shadow .12s;
}
.btn:hover { background: var(--brand-deep); text-decoration: none; box-shadow: var(--shadow); }
.btn.secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--mint-soft); border-color: var(--brand); }
.btn.danger { background: #fff; color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { padding: .32rem .7rem; font-size: .8rem; }
.btn.ghost { background: transparent; color: var(--brand-strong); }
.btn.ghost:hover { background: var(--mint-soft); box-shadow: none; }

/* ---------- Formulieren ---------- */

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1.5rem; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 900px) { .form-grid { grid-template-columns: 1fr; } }

label.field { display: block; }
label.field .lbl, .lbl {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: .3rem;
}

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], input[type="datetime-local"], input[type="url"], select, textarea {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: .92rem;
  color: var(--ink);
  background: #fff;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .14);
}
textarea { resize: vertical; min-height: 90px; }

.check { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.check input { width: auto; accent-color: var(--brand-strong); }

.error-text { color: var(--danger); font-size: .82rem; margin-top: .25rem; }

/* ---------- Flash & alerts ---------- */

.alert {
  padding: .8rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  margin-bottom: 1.2rem;
  border: 1px solid;
}
.alert.success { background: var(--ok-soft); color: #065f46; border-color: #a7f3d0; }
.alert.error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.alert.warning { background: var(--warn-soft); color: #92400e; border-color: #fde68a; }
.alert.info { background: var(--info-soft); color: #075985; border-color: #bae6fd; }

/* ---------- Login ---------- */

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(153, 246, 228, .35), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(13, 148, 136, .18), transparent 55%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 2.4rem 2.4rem 2rem;
}
.auth-card .brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--brand-deep);
  margin-bottom: .4rem;
}
.auth-card .tagline { text-align: center; color: var(--ink-soft); font-size: .9rem; margin-bottom: 1.8rem; }
.auth-card form > * + * { margin-top: 1rem; }
.auth-card .btn { width: 100%; justify-content: center; padding: .7rem; font-size: .95rem; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin: 1.5rem 0 1.2rem;
  color: var(--ink-faint);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Risicomatrix ---------- */

.risk-matrix { border-collapse: collapse; width: 100%; }
.risk-matrix th { font-size: .68rem; color: var(--ink-faint); font-weight: 600; padding: .3rem; }
.risk-matrix td {
  width: 18%;
  height: 52px;
  text-align: center;
  font-weight: 800;
  font-size: 1.05rem;
  border: 2px solid #fff;
  border-radius: 8px;
  color: rgba(16, 40, 44, .75);
}
.rm-1 { background: #d3f4e7; }
.rm-2 { background: #fdf0c9; }
.rm-3 { background: #fcd9a8; }
.rm-4 { background: #f8b4ab; }
.rm-empty { color: rgba(16, 40, 44, .25) !important; font-weight: 500; }

/* ---------- Voortgang ---------- */

.progress { height: 9px; border-radius: 999px; background: #e6efed; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), #34d399); }

/* ---------- SoA ---------- */

details.soa-theme { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); margin-bottom: 1rem; overflow: hidden; }
details.soa-theme > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  font-weight: 700;
}
details.soa-theme > summary::-webkit-details-marker { display: none; }
details.soa-theme[open] > summary { border-bottom: 1px solid var(--line); }

details.soa-row { border-top: 1px solid var(--line); }
details.soa-row > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .65rem 1.5rem;
  font-size: .9rem;
}
details.soa-row > summary::-webkit-details-marker { display: none; }
details.soa-row > summary:hover { background: var(--mint-soft); }
details.soa-row .soa-form { padding: 1rem 1.5rem 1.3rem; background: #fafcfb; border-top: 1px dashed var(--line); }
.soa-code { font-family: var(--mono); font-size: .78rem; color: var(--brand-strong); font-weight: 700; min-width: 52px; }
.soa-title { flex: 1; }

/* ---------- Notificaties ---------- */

.notif { display: flex; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); align-items: flex-start; }
.notif:last-child { border-bottom: none; }
.notif.unread { background: var(--mint-soft); }
.notif .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); margin-top: .45rem; flex-shrink: 0; }
.notif.read .dot { background: var(--line); }
.notif .title { font-weight: 700; }
.notif .body { color: var(--ink-soft); font-size: .88rem; margin-top: .15rem; }
.notif .when { color: var(--ink-faint); font-size: .78rem; margin-top: .3rem; }

.notif-bell { position: relative; display: inline-flex; }
.notif-bell .count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--danger);
  color: #fff;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 800;
  padding: .1rem .35rem;
  min-width: 17px;
  text-align: center;
}

/* ---------- Overig ---------- */

.muted { color: var(--ink-faint); font-size: .85rem; }
.mono { font-family: var(--mono); }
.mt { margin-top: 1.25rem; }
.mb-0 { margin-bottom: 0; }
.flex { display: flex; align-items: center; gap: .75rem; }
.flex.between { justify-content: space-between; }
.flex.wrap { flex-wrap: wrap; }
.right { text-align: right; }
.center { text-align: center; }

.pagination { display: flex; gap: .35rem; margin-top: 1.25rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: .35rem .7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: #fff;
  font-size: .85rem;
}
.pagination .current { background: var(--brand-strong); color: #fff; border-color: var(--brand-strong); }
.pagination a:hover { background: var(--mint-soft); text-decoration: none; }

.recovery-codes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
  font-family: var(--mono);
  font-size: .95rem;
  background: var(--brand-deeper);
  color: var(--mint);
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius);
  letter-spacing: .04em;
}

.qr-box { display: flex; justify-content: center; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }

.empty {
  text-align: center;
  color: var(--ink-faint);
  padding: 2.5rem 1rem;
  font-size: .92rem;
}

.filter-bar { display: flex; gap: .6rem; align-items: center; margin-bottom: 1.1rem; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { width: auto; }

.license-meter { font-size: .82rem; color: var(--ink-soft); }
