/**
 * ---------------------------------------------------------------------------
 *  Fedelta Media — Klantportaal
 *  fedelta.css — branding & design tokens bovenop Tabler (Bootstrap 5)
 *  Reproduceert de ontwerpschets (fedelta-portaal-schets.html) op Tabler.
 *  Tabgrootte 4.
 * ---------------------------------------------------------------------------
 */

:root {
	/* Brand */
	--brand:        #0088cc;
	--brand-700:    #006fa6;
	--brand-300:    #5cc0f0;
	--brand-50:     #eaf6fd;

	/* Canvas & card */
	--canvas:       #f4f7fb;
	--card:         #ffffff;

	/* Tekst */
	--ink:          #0f1d2b;
	--ink-2:        #33485c;
	--muted:        #6b7d90;

	/* Lijnen */
	--line:         #e7eef5;

	/* Status */
	--ok:           #15a34a;
	--ok-bg:        #e7f7ee;
	--amber:        #c77b06;
	--amber-bg:     #fdf2dd;
	--danger:       #d63d52;
	--danger-bg:    #fde8ec;

	/* Schaduw */
	--shadow-sm:    0 1px 2px rgba(16,29,43,.06);
	--shadow-md:    0 10px 30px -12px rgba(16,29,43,.18);

	/* Radii */
	--r-lg:         18px;
	--r-md:         13px;
	--r-sm:         9px;

	--font-stack:   system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
}

/* Tabler-variabelen op de brand mappen */
:root {
	--tblr-primary:         #0088cc;
	--tblr-primary-rgb:     0, 136, 204;
	--tblr-primary-fg:      #ffffff;
	--tblr-body-bg:         var(--canvas);
	--tblr-body-color:      var(--ink);
	--tblr-border-color:    var(--line);
	--tblr-link-color:      var(--brand-700);
	--tblr-link-hover-color:var(--brand);
	--tblr-font-sans-serif: var(--font-stack);
}

* { box-sizing: border-box; }

body {
	background: var(--canvas);
	color: var(--ink);
	font-family: var(--font-stack);
	font-size: 14px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.num,
.tabular { font-variant-numeric: tabular-nums; }

a { text-decoration: none; }
/* Tabler zet a:hover op underline — dat willen we nergens in de UI */
a:hover { text-decoration: none; }

/* ===========================================================================
   Shell — sidebar + main (zoals de schets)
   =========================================================================== */
.shell {
	display: flex;
	min-height: 100vh;
	max-width: 1180px;
	margin: 0 auto;
}

/* ---------- Sidebar ---------- */
.side {
	width: 236px;
	flex: 0 0 236px;
	background: var(--card);
	border-right: 1px solid var(--line);
	padding: 22px 16px;
	display: flex;
	flex-direction: column;
	gap: 26px;
	position: sticky;
	top: 0;
	height: 100vh;
}

.brand {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 4px 8px;
}
.brand img {
	max-width: 185px;
	height: auto;
	display: block;
}

.nav {
	display: flex;
	flex-direction: column;
	gap: 3px;
}
.nav-label {
	font-size: 11px;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--muted);
	padding: 10px 10px 2px;
}
.nav a {
	display: flex;
	align-items: center;
	gap: 11px;
	padding: 9px 11px;
	border-radius: 10px;
	color: var(--ink-2);
	font-weight: 500;
	font-size: 14px;
	transition: background .15s, color .15s;
}
.nav a .ti {
	font-size: 18px;
	width: 18px;
	flex: 0 0 18px;
	opacity: .85;
}
.nav a:hover {
	background: #f3f7fb;
	color: var(--ink);
}
.nav a.active {
	background: var(--brand);
	color: #fff;
	box-shadow: 0 6px 16px -8px rgba(0,136,204,.8);
}
.nav a.active .ti { opacity: 1; }

.side-foot {
	margin-top: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px;
	border-top: 1px solid var(--line);
	color: inherit;
	border-radius: 10px;
	transition: background .15s;
}
a.side-foot:hover { background: #f3f7fb; }
.side-foot .avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background-color: #fff;
	color: var(--brand-700);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
	flex: 0 0 34px;
	overflow: hidden;
}
.side-foot .avatar img { width: 34px; height: 34px; max-width: 34px; object-fit: cover; border-radius: 50%; }
.side-foot b { font-size: 13px; }
.side-foot small {
	display: block;
	color: var(--muted);
	font-size: 12px;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 140px;
}

/* ---------- Main ---------- */
.main {
	flex: 1;
	min-width: 0;
	padding: 26px 30px 40px;
}

.topbar {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 22px;
}
.topbar h1 {
	font-size: 22px;
	margin: 0 0 3px;
	letter-spacing: -.02em;
	font-weight: 700;
	color: var(--ink);
}
.topbar p {
	margin: 0;
	color: var(--muted);
}

/* Gebruikersmenu rechts in de topbar */
.userbox {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
}
.userbox .avatar {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background-color: #fff;
	color: var(--brand-700);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 14px;
}
.userbox .who { text-align: right; line-height: 1.2; }
.userbox .who b { font-size: 13px; }
.userbox .who small { display: block; color: var(--muted); font-size: 12px; }

/* ===========================================================================
   2FA-interstitial / nag-kaart (alleen op de loginflow)
   =========================================================================== */
.twofa {
	display: flex;
	align-items: center;
	gap: 12px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 10px 12px 10px 14px;
	box-shadow: var(--shadow-sm);
}
.twofa .dot {
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background: var(--amber);
	box-shadow: 0 0 0 4px var(--amber-bg);
	flex: 0 0 9px;
}
.twofa b { font-size: 13px; }
.twofa small { display: block; color: var(--muted); font-size: 12px; }

/* ===========================================================================
   Stat-kaarten
   =========================================================================== */
.stats {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin-bottom: 18px;
}
.stat {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	padding: 18px;
	box-shadow: var(--shadow-sm);
	position: relative;
	overflow: hidden;
	animation: rise .5s ease backwards;
}
.stat:nth-child(1) { animation-delay: .02s; }
.stat:nth-child(2) { animation-delay: .08s; }
.stat:nth-child(3) { animation-delay: .14s; }
.stat:nth-child(4) { animation-delay: .20s; }
.stat .icn {
	width: 38px;
	height: 38px;
	border-radius: 11px;
	background: var(--brand-50);
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
}
.stat .icn .ti { font-size: 20px; color: var(--brand-700); }
.stat .lbl {
	color: var(--muted);
	font-size: 12.5px;
	font-weight: 500;
}
.stat .val {
	font-size: 30px;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1.1;
	margin-top: 2px;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}
.stat .sub {
	font-size: 12.5px;
	color: var(--muted);
	margin-top: 4px;
}
.stat .sub.pos { color: var(--ok); }

/* Gauge-stat */
.gauge-wrap { display: flex; align-items: center; gap: 16px; }
.gauge {
	width: 84px;
	height: 84px;
	flex: 0 0 84px;
	position: relative;
}
.gauge svg { transform: rotate(-90deg); }
.gauge .track { fill: none; stroke: var(--line); stroke-width: 9; }
.gauge .fill {
	fill: none;
	stroke: var(--brand);
	stroke-width: 9;
	stroke-linecap: round;
	stroke-dasharray: 213.6;
	stroke-dashoffset: 213.6;
	animation: gauge 1.3s .3s cubic-bezier(.2,.8,.2,1) forwards;
}
/* eindstand van de gauge: --dash wordt per element gezet (213.6 = leeg, 0 = vol) */
.gauge .pct {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 16px;
}

/* ===========================================================================
   Panels (de schets) — ook .card krijgt deze look
   =========================================================================== */
.grid-2 {
	display: grid;
	grid-template-columns: 1.55fr 1fr;
	gap: 18px;
	margin-top: 18px;
	align-items: start; /* panelen niet uitrekken naar gelijke hoogte */
}

.panel,
.card {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-sm);
}
.panel-h {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px 8px;
}
.panel-h h2 {
	margin: 0;
	font-size: 15px;
	letter-spacing: -.01em;
	font-weight: 600;
	color: var(--ink);
}
.panel-h .meta { color: var(--muted); font-size: 12.5px; }
.panel-h a {
	color: var(--brand-700);
	font-size: 12.5px;
	font-weight: 600;
}

/* Tabler-card koppen netjes in dezelfde stijl */
.card-header {
	border-bottom: 1px solid var(--line);
	background: transparent;
	border-top-left-radius: var(--r-lg);
	border-top-right-radius: var(--r-lg);
}
.card-title { color: var(--ink); font-weight: 600; font-size: 15px; }

/* ===========================================================================
   Chart-kaart
   =========================================================================== */
.chart-card { padding-bottom: 6px; }
.chart-head {
	display: flex;
	align-items: flex-end;
	gap: 14px;
	padding: 0 20px 6px;
}
.chart-big {
	font-size: 34px;
	font-weight: 700;
	letter-spacing: -.02em;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}
.chart-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var(--ok-bg);
	color: var(--ok);
	font-weight: 600;
	font-size: 12.5px;
	padding: 3px 8px;
	border-radius: 7px;
	margin-bottom: 5px;
}
.chart-cap { color: var(--muted); font-size: 12.5px; margin-bottom: 6px; }
.chart-body { padding: 4px 12px 8px; }

/* ===========================================================================
   Rijen — facturen & domeinen-snellijst
   =========================================================================== */
.rows { padding: 6px 8px 12px; }
.row-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 12px;
	border-radius: 11px;
	transition: background .15s;
	color: inherit;
}
.row-item:hover { background: #f5f8fb; }
.row-item .rn { font-weight: 600; font-size: 13.5px; color: var(--ink); }
.row-item .rd { color: var(--muted); font-size: 12.5px; }
.row-item .ra {
	margin-left: auto;
	font-weight: 600;
	font-size: 13.5px;
	color: var(--ink);
	font-variant-numeric: tabular-nums;
}
.row-item .dl { margin-left: 14px; color: var(--brand-700); display: flex; }
.row-item .dl .ti { font-size: 17px; }

/* Domein-snellijst */
.dom {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 11px 12px;
	border-radius: 11px;
	transition: background .15s;
	color: inherit;
}
.dom:hover { background: #f5f8fb; }
.dom .fav {
	width: 26px;
	height: 26px;
	border-radius: 7px;
	background: var(--brand-50);
	color: var(--brand-700);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 12px;
	flex: 0 0 26px;
}
.dom .dn { font-weight: 500; font-size: 13.5px; color: var(--ink); }

/* Favicon-avatar: echte favicon i.p.v. tekst-letter (fallback blijft .fav/.avatar) */
.fav-img, .avatar-img { background: #fff; padding: 2px; overflow: hidden; }
.fav-img img, .avatar-img img {
	width: auto;
	object-fit: cover;
	background-color: #fff;
	display: block;
}
.fav-img img { height: 20px; max-width: 20px; }
.avatar-img img { height: 37px; max-width: 37px; object-fit: cover; border-radius: 50%; }
.dom .chev { margin-left: auto; color: var(--muted); display: flex; }
.dom .chev .ti { font-size: 16px; }

/* ===========================================================================
   Pills / badges — status
   =========================================================================== */
.pill,
.badge {
	font-size: 11.5px;
	font-weight: 600;
	padding: 3px 9px;
	border-radius: 20px;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
}
.pill.ok,
.badge.bg-success,
.badge.bg-green {
	background: var(--ok-bg) !important;
	color: var(--ok) !important;
}
.pill.open,
.badge.bg-warning,
.badge.bg-orange {
	background: var(--amber-bg) !important;
	color: var(--amber) !important;
}
.pill.late,
.badge.bg-danger,
.badge.bg-red {
	background: var(--danger-bg) !important;
	color: var(--danger) !important;
}
.pill.muted {
	background: var(--line);
	color: var(--muted);
}
.pill.redirect {
	background: #ede9fe;
	color: #6d28d9;
}

/* ===========================================================================
   Knoppen — afgeronde blauwe hoeken
   =========================================================================== */
.btn {
	border-radius: var(--r-sm);
	font-weight: 600;
	font-size: 13.5px;
}
.btn-primary,
.btn.btn-primary {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
	box-shadow: 0 6px 16px -8px rgba(0,136,204,.8);
	padding: 5px 7px 5px 7px;
}
.btn-outline,
.btn-outline-primary {
	padding: 5px 7px 5px 7px;
}
.btn-primary:hover,
.btn-primary:focus {
	background: var(--brand-700);
	border-color: var(--brand-700);
	color: #fff;
}
.btn-outline,
.btn-outline-primary {
	color: var(--brand-700);
	border: 1px solid var(--line);
	background: #fff;
}
.btn-outline:hover,
.btn-outline-primary:hover {
	background: var(--brand-50);
	border-color: var(--brand-300);
	color: var(--brand);
}
.btn-ghost {
	background: transparent;
	border: 0;
	color: var(--muted);
}
.btn-ghost:hover { color: var(--ink); }
.btn-danger-outline {
	color: var(--danger);
	border: 1px solid var(--danger-bg);
	background: #fff;
}
.btn-danger-outline:hover {
	background: var(--danger-bg);
	border-color: var(--danger);
	color: var(--danger);
}
.btn-danger-outline.btn-sm { padding: 6px; }

/* ===========================================================================
   Tabellen
   =========================================================================== */
.table { color: var(--ink-2); margin-bottom: 0; }
.table th {
	color: var(--muted);
	font-weight: 600;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .03em;
	border-bottom: 1px solid var(--line);
}
.table td {
	color: var(--ink-2);
	border-color: var(--line);
	vertical-align: middle;
}
.table tbody tr:hover { background: #f5f8fb; }
/* Klikbare hoofdcel in tabellen — behoudt de bestaande tekststijl */
.cell-link { color: inherit; text-decoration: none; }
.cell-link:hover { color: inherit; text-decoration: none; }

/* ===========================================================================
   Formulieren
   =========================================================================== */
.form-label { font-weight: 600; color: var(--ink-2); font-size: 13px; }
.form-control,
.form-select {
	border-color: var(--line);
	border-radius: var(--r-md);
	color: var(--ink);
}
.form-control:focus,
.form-select:focus {
	border-color: var(--brand-300);
	box-shadow: 0 0 0 .2rem rgba(0,136,204,.15);
}

/* ===========================================================================
   Alerts
   =========================================================================== */
.alert { border-radius: var(--r-md); border: 1px solid var(--line); }
.alert-success { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.alert-danger  { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
.alert-warning { background: var(--amber-bg); color: var(--amber); border-color: transparent; }

/* ===========================================================================
   Koppel-pickers (admin klantformulier)
   =========================================================================== */
.fp-picker { position: relative; margin-bottom: 8px; }
.fp-results {
	position: absolute;
	left: 0;
	right: 0;
	z-index: 30;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	box-shadow: var(--shadow-md);
	margin-top: 4px;
	max-height: 240px;
	overflow-y: auto;
}
.fp-results:empty { display: none; }
.fp-result {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	padding: 8px 12px;
	cursor: pointer;
}
.fp-result:hover { background: var(--brand-50); }
.fp-rl { display: block; font-weight: 600; font-size: 13px; color: var(--ink); }
.fp-rs { display: block; font-size: 12px; color: var(--muted); }
.fp-hint { padding: 8px 12px; color: var(--muted); font-size: 12.5px; }

/* Avatar/favicon-dropdown */
.avatar-picker { position: relative; margin-bottom: 8px; }
.ap-current { cursor: pointer; display: flex; align-items: center; gap: 8px; }
.ap-current img { width: 20px; height: 20px; object-fit: contain; }
.ap-options {
	position: absolute;
	left: 0; right: 0;
	z-index: 30;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	box-shadow: var(--shadow-md);
	margin-top: 4px;
	max-height: 260px;
	overflow-y: auto;
}
.ap-opt {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	text-align: left;
	border: 0;
	background: transparent;
	padding: 8px 12px;
	cursor: pointer;
	font-size: 13.5px;
	color: var(--ink);
}
.ap-opt:hover { background: var(--brand-50); }
.ap-opt img { width: 22px; height: 22px; object-fit: contain; }
.ap-letter {
	width: 22px; height: 22px; flex: 0 0 22px;
	border-radius: 6px;
	background: var(--brand-50);
	color: var(--brand-700);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 11px;
}
.fp-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--brand-50);
	color: var(--brand-700);
	border: 1px solid var(--brand-300);
	border-radius: var(--r-pill, 20px);
	padding: 3px 6px 3px 11px;
	font-size: 12.5px;
	font-weight: 600;
	margin: 0 6px 6px 0;
}
.fp-x {
	border: 0;
	background: transparent;
	color: var(--brand-700);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}
.fp-x:hover { color: var(--danger); }

/* ===========================================================================
   Impersonatie-banner
   =========================================================================== */
.impersonation-banner {
	background: var(--amber-bg);
	color: var(--amber);
	padding: 9px 16px;
	text-align: center;
	font-weight: 600;
	font-size: 13px;
	border-bottom: 1px solid var(--amber);
}
.impersonation-banner a { color: var(--amber); font-weight: 700; }

/* ===========================================================================
   Login
   =========================================================================== */
.login-wrap {
	min-height: 100vh;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--canvas);
	padding: 24px;
}
.login-card {
	width: 100%;
	max-width: 420px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow-md);
	padding: 30px;
}
.login-logo {
	max-width: 200px;
	height: auto;
	display: block;
	margin: 0 auto 22px;
}
.totp-code-input {
	font-size: 1.5rem;
	letter-spacing: .5rem;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

/* 2FA QR-code — bron is 1.5× (420px), getoond op 280px voor scherpte */
.qr-2fa {
	width: 280px;
	height: 280px;
	max-width: 100%;
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: 12px;
	background: #fff;
}
.twofa-secret {
	font-size: 14px;
	letter-spacing: 1px;
	user-select: all;
	word-break: break-all;
}

/* ===========================================================================
   Animaties
   =========================================================================== */
@keyframes rise  { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes gauge { to { stroke-dashoffset: var(--dash, 113.2); } }

/* ===========================================================================
   Responsive — sidebar klapt op mobiel
   =========================================================================== */
@media (max-width: 880px) {
	.shell { flex-direction: column; }
	.side {
		width: 100%;
		flex: none;
		height: auto;
		position: static;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
		gap: 14px;
	}
	.nav { flex-direction: row; flex-wrap: wrap; }
	.nav-label, .side-foot { display: none; }
	.main { padding: 20px; }
	.stats { grid-template-columns: repeat(2, 1fr); }
	.grid-2 { grid-template-columns: 1fr; }
	.topbar { flex-direction: column; }
}

@media (max-width: 520px) {
	.stats { grid-template-columns: 1fr; }
}

/* ===========================================================================
   Toegankelijkheid
   =========================================================================== */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation: none !important;
		transition: none !important;
	}
	.gauge .fill { stroke-dashoffset: var(--dash, 113.2); }
}
