/* ============================================================
   Dayporto - Main Stylesheet
   ============================================================ */

:root {
    --primary:        #0A2239;   /* Dayporto Deep Navy (v1084) */
    --primary-light:  #103353;
    --primary-lighter:#E9EEF4;
    --accent:         #FF5A1F;   /* Dayporto Orange */
    --success:        #22c55e;
    --sidebar-width: 260px;
    --sidebar-collapsed: 72px;
    --topbar-height: 60px;
    --border-radius: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
    /* ─── SEKUR design tokens ──────────────────────────── */
    --navy:           #0A2239;   /* Dayporto Deep Navy (v1084) */
    --amber:          #f59e0b;
    --green:          #22c55e;
    --red:            #ef4444;
    --blue:           #3b82f6;
    --text-primary:   #0f172a;
    --text-secondary: #374151;
    --text-muted:     #64748b;
    --body-bg:        #F6F5F2;   /* warm licht grijs (brandbook) */
    --card-bg:        #ffffff;
    --border-color:   #e2e8f0;   /* card/table borders */
    --border-subtle:  #f1f5f9;   /* row separators, section dividers */
    --input-bg:       #ffffff;
    /* ─── Status/keuring tokens ────────────────────────── */
    --status-ok:         #22c55e;
    --status-warning:    #f59e0b;
    --status-danger:     #ef4444;
    --status-info:       #3b82f6;
    --status-muted:      #6b7280;
    --focus-ring:        0 0 0 3px rgba(255,90,31,0.35);   /* Dayporto Orange (v1084) */
    /* ─── Sidebar tokens (overrideable in dark mode) ──────── */
    --sidebar-bg:         #ffffff;
    --sidebar-active-bg:  var(--accent);   /* v1084: oranje actieve pil */
    --sidebar-item-hover: rgba(0,0,0,0.05);
}

/* ─── Toegankelijkheid ─────────────────────────────────────── */
/* Skip-link (verschijnt bij Tab vanuit top van pagina). */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--primary);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0 0 4px 0;
    z-index: 2000;
    font-weight: 600;
}
.skip-link:focus {
    left: 0;
    outline: 3px solid var(--merk-koraal, #FF7A45);
}

/* Duidelijker focus-indicator voor toetsenbordgebruikers. */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-item:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Screen-reader-only utility (WCAG 1.3.1): tekst onzichtbaar voor ziende
   gebruikers maar wel uitgelezen door screenreaders. */
.sr-only,
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Respecteer prefers-reduced-motion (WCAG 2.3.3).
   Uitgevoerd op alle bestaande transitions zodat animaties niet
   doordraaien voor gebruikers met vestibulaire klachten. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif; background: var(--body-bg); color: var(--text-primary); }


/* ─── v1084: Bootstrap-primair op Dayporto ────────────────────
   Primaire actie = oranje (brandbook: oranje voor CTA's), outline
   en tekst-utility = merk-navy, links in donker oranje met
   voldoende contrast. Statuskleuren blijven Bootstrap. */
.btn-primary, .btn-primary:disabled {
    background-color: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-primary.active, .btn-check:checked + .btn-primary {
    background-color: #E64D15 !important;
    border-color: #E64D15 !important;
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover, .btn-outline-primary:focus,
.btn-outline-primary:active, .btn-outline-primary.active,
.btn-check:checked + .btn-outline-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}
.text-primary { color: var(--primary) !important; }
.link-primary, main a:not(.btn):not(.nav-item):not(.dropdown-item):not(.badge) {
    color: #C2410C;
}
.progress-bar { background-color: var(--accent); }

/* ─── Login ────────────────────────────────────────────────── */
.login-body { background: linear-gradient(135deg, #071A2C 0%, #0A2239 55%, #071A2C 100%); min-height: 100vh; }
.login-wrapper { display: flex; min-height: 100vh; }

.login-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: rgba(255,255,255,0.05);
}
.login-hero { color: white; text-align: center; }
/* v1083: echt Dayporto-logo i.p.v. schild-icoon; koraal als accent
 * op de donkere hero (was goud uit het oude palet). */
.hero-logo { margin-bottom: 1.5rem; }
.hero-logo img { height: 48px; width: auto; }
.hero-title { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; }
.hero-subtitle { font-size: 1.1rem; opacity: 0.8; margin-bottom: 2rem; }
.hero-badges { display: flex; flex-direction: column; gap: 0.75rem; align-items: center; }
.hero-badge { display: flex; align-items: center; gap: 0.75rem; background: rgba(255,255,255,0.1); border-radius: 2rem; padding: 0.5rem 1.25rem; font-size: 0.9rem; }
.hero-badge i { color: var(--merk-koraal, #FF7A45); font-size: 1.1rem; }

.login-right {
    width: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    padding: 2rem;
}
.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    background: white;
    border-radius: 16px;
}
.login-logo { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem; }
.login-logo img { height: 34px; width: auto; }
.login-title { font-size: 1.75rem; font-weight: 700; color: var(--primary); margin-bottom: 0.25rem; }
.login-subtitle { color: #666; margin-bottom: 1.5rem; }
/* v1083: inloggen is dé actie op deze pagina — Dayporto Orange
 * (brandbook: oranje uitsluitend voor CTA's). */
.btn-login { background: var(--merk-actie, #FF5A1F); border-color: var(--merk-actie, #FF5A1F); padding: 0.75rem; font-size: 1rem; font-weight: 600; border-radius: 8px; transition: all 0.2s; }
.btn-login:hover, .btn-login:focus { background: var(--merk-actie-donker, #E64D15); border-color: var(--merk-actie-donker, #E64D15); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255,90,31,0.35); }
.password-toggle { border: none; background: none; color: #999; z-index: 5; }
.login-footer { margin-top: 2rem; text-align: center; }

/* ─── Sidebar ───────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    min-height: var(--topbar-height);
    position: relative;
}
.sidebar-brand::after {
    content: '';
    position: absolute;
    bottom: 0; left: 1.25rem; right: 1.25rem;
    height: 1px;
    background: linear-gradient(90deg, var(--accent), transparent 70%);
    opacity: 0.4;
}
.brand-logo { display: flex; align-items: center; flex-shrink: 0; }
.brand-logo img { height: 30px; width: auto; }
.brand-name { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); line-height: 1; }
.brand-sub { font-size: 0.7rem; color: var(--text-muted); }

/* ─── Workspace selector row ────────────────────────────── */
.sidebar-workspace {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}
.sidebar-workspace:hover { background: var(--sidebar-item-hover); }
.sidebar-workspace--clickable { cursor: pointer; }
.workspace-chevron { transition: transform 0.2s; }
.sidebar-workspace--clickable.open .workspace-chevron { transform: rotate(90deg); }

/* Workspace picker dropdown */
.workspace-picker {
    display: none;
    background: var(--border-subtle);
    border-bottom: 1px solid var(--border-color);
    padding: 0.25rem 0;
}
.workspace-picker.show { display: block; }
.workspace-picker-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 1.25rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    transition: background 0.15s;
}
.workspace-picker-item:hover { background: var(--sidebar-item-hover); color: var(--text-primary); }
.workspace-picker-item.active { color: var(--text-primary); font-weight: 600; }
.workspace-picker-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-avatar-xs {
    width: 22px; height: 22px;
    background: var(--amber);
    border-radius: 4px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 800;
    color: #0f172a;
    flex-shrink: 0;
}
.workspace-avatar {
    width: 28px; height: 28px;
    background: var(--accent);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.workspace-info { flex: 1; min-width: 0; }
.workspace-name { font-size: 0.8125rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.workspace-plan { font-size: 0.68rem; color: var(--text-muted); }
.sidebar-workspace .bi-chevron-right { font-size: 0.7rem; color: var(--text-muted); flex-shrink: 0; }

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.1) transparent;
}

/* ─── Sidebar group (collapsible sections) ──────────────── */
.sidebar-group {}
.sidebar-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 0.75rem;
    margin: 0 0.625rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    width: calc(100% - 1.25rem);
    text-align: left;
    transition: all 0.15s;
    border-radius: 7px;
    position: relative;
}
.sidebar-group-toggle > i:first-child { font-size: 1.05rem; flex-shrink: 0; width: 20px; }
.sidebar-group-toggle:hover { background: var(--sidebar-item-hover); color: var(--text-primary); }
.sidebar-group-toggle .bi-chevron-down { font-size: 0.75rem; margin-left: auto; transition: transform 0.2s; flex-shrink: 0; }
.sidebar-group.collapsed .sidebar-group-toggle .bi-chevron-down { transform: rotate(-90deg); }
.sidebar-group-items { overflow: hidden; transition: max-height 0.28s ease; }
.sidebar-group.collapsed .sidebar-group-items { max-height: 0 !important; }
.sidebar-group-items .nav-item { padding-left: 2.5rem; }
.sidebar-group-toggle.active { color: var(--text-primary); font-weight: 600; }
.sidebar-group-toggle.active > i:first-child { color: var(--accent); }

.nav-section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    padding: 0.75rem 1.25rem 0.3rem;
    white-space: nowrap;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin: 0 0.625rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
    border-radius: 7px;
    transition: all 0.15s;
    white-space: nowrap;
    position: relative;
}
.nav-item i { font-size: 1rem; flex-shrink: 0; width: 20px; }
.nav-item:hover { background: var(--sidebar-item-hover); color: var(--text-primary); }
.nav-item.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    font-weight: 600;
}
.nav-item.active i { color: #fff; }

/* Top-level nav items (group headers as links) */
.nav-item-primary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 0.75rem;
    margin: 0 0.625rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 7px;
    white-space: nowrap;
    position: relative;
    transition: all 0.15s;
}
.nav-item-primary i { font-size: 1.05rem; flex-shrink: 0; width: 20px; }
.nav-item-primary:hover { background: var(--sidebar-item-hover); color: var(--text-primary); }
.nav-item-primary.active {
    background: var(--sidebar-active-bg);
    color: white;
    font-weight: 600;
}
.nav-item-primary.active i { color: var(--amber); }

/* Nav badge (counts / "nieuw" labels on right) */
.nav-badge {
    margin-left: auto;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    background: rgba(0,0,0,0.07);
    color: var(--text-muted);
    flex-shrink: 0;
}
.nav-badge.nav-badge-alert {
    background: rgba(245,158,11,0.18);
    color: var(--amber);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.user-info { flex: 1; min-width: 0; }
.user-avatar { width: 34px; height: 34px; background: var(--amber); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--navy); font-size: 0.9rem; flex-shrink: 0; }
.user-name { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }
.logout-btn { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; transition: color 0.2s; }
.logout-btn:hover { color: var(--red); }

/* ─── Main content ─────────────────────────────────────────── */
/* Desktop-only "collapsed" state: hamburger verbergt de sidebar en laat de
   main-content de volledige breedte innemen. Op mobiel negeren we dit en
   gebruikt de sidebar het .show/overlay-mechanisme. */
@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
    body.sidebar-collapsed .main-content { margin-left: 0; }
}

.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.topbar {
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.sidebar-toggle { background: none; border: none; font-size: 1.4rem; color: var(--text-muted); cursor: pointer; padding: 0.25rem; border-radius: 6px; }
.sidebar-toggle:hover { background: var(--body-bg); color: var(--text-primary); }
.topbar-title { font-weight: 700; color: var(--text-primary); font-size: 1.05rem; flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 0.75rem; }
.topbar-user .badge { font-size: 0.65rem; }

.content-area { padding: 1.5rem; flex: 1; }
.flash-container { margin-bottom: 1rem; }

/* ─── Card Panels ───────────────────────────────────────────── */
.card-panel {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--border-color);
}
.panel-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--card-bg);
}
.panel-title { font-size: 0.875rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.panel-body { padding: 1.25rem; }

/* ─── KPI Cards ─────────────────────────────────────────────── */
.kpi-card {
    border-radius: var(--border-radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
/* v1085: KPI-tegels in mockup-stijl — witte kaart, getint
   icoon-chipje in de betekeniskleur, donkere waarde. */
.kpi-card { background: var(--card-bg); border: 1px solid var(--border-color); }
.kpi-card .bi { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; font-size: 1.25rem !important; flex-shrink: 0; }
.kpi-blue .bi { background: #E9EEF4; color: var(--primary); }
.kpi-orange .bi { background: #FDEAD7; color: #B45309; }
.kpi-green .bi { background: #E4F9F2; color: #0E8A6A; }
.kpi-red .bi { background: #FDE4E1; color: #DC2626; }
.kpi-teal .bi { background: #E0ECFF; color: #2563EB; }
.kpi-icon { flex-shrink: 0; }
.kpi-value { font-size: 1.75rem; font-weight: 700; line-height: 1; color: var(--text-primary); }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }
/* v1095: op smalle schermen duwde de tekst de pijl-link buiten de
   tegelrand — flex-kinderen krimpen niet onder hun contentbreedte
   zonder min-width: 0. */
.kpi-card .flex-grow-1 { min-width: 0; }
.kpi-card .btn-link { flex-shrink: 0; padding: 0.25rem; }
.kpi-card { overflow: hidden; }

/* ─── SEKUR Dashboard KPI Cards (new design) ───────────────── */
.sekur-kpi {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}
.sekur-kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.sekur-kpi .kpi-number { font-size: 2.25rem; font-weight: 800; line-height: 1; color: var(--text-primary); }
.sekur-kpi .kpi-unit { font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.sekur-kpi .kpi-title { font-size: 0.8125rem; color: var(--text-muted); margin-top: 0.5rem; font-weight: 500; }
.sekur-kpi .kpi-icon-wrap {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.sekur-kpi .kpi-icon-wrap.bg-red { background: rgba(239,68,68,0.1); color: var(--red); }
.sekur-kpi .kpi-icon-wrap.bg-green { background: rgba(34,197,94,0.1); color: var(--green); }
.sekur-kpi .kpi-icon-wrap.bg-blue { background: rgba(59,130,246,0.1); color: var(--blue); }
.sekur-kpi .kpi-icon-wrap.bg-amber { background: rgba(245,158,11,0.1); color: var(--amber); }

/* ─── SEKUR Status Badges ──────────────────────────────────── */
.badge-sekur {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.badge-sekur.voltooid { background: rgba(34,197,94,0.12); color: #16a34a; }
.badge-sekur.onderweg { background: rgba(245,158,11,0.12); color: #d97706; }
.badge-sekur.gepland, .badge-sekur.ingepland { background: rgba(59,130,246,0.12); color: #2563eb; }
.badge-sekur.in-uitvoering { background: rgba(139,92,246,0.12); color: #7c3aed; }
.badge-sekur.concept { background: rgba(107,114,128,0.12); color: #4b5563; }
.badge-sekur.open { background: rgba(239,68,68,0.12); color: #dc2626; }
.badge-sekur.gesloten { background: rgba(107,114,128,0.12); color: #4b5563; }

/* ─── SEKUR Mijn Dag Timeline ──────────────────────────────── */
.dag-timeline {}
.dag-timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.875rem 0;
    border-bottom: 1px solid var(--border-subtle);
}
.dag-timeline-item:last-child { border-bottom: none; }
.dag-timeline-time {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 50px;
    flex-shrink: 0;
    padding-top: 2px;
}
.dag-timeline-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--blue);
    margin-top: 5px;
    flex-shrink: 0;
}
.dag-timeline-dot.voltooid { background: var(--green); }
.dag-timeline-dot.onderweg { background: var(--amber); }
.dag-timeline-dot.gepland, .dag-timeline-dot.ingepland { background: var(--blue); }
.dag-timeline-dot.in-uitvoering { background: #7c3aed; }
.dag-timeline-content { flex: 1; min-width: 0; }
.dag-timeline-klant { font-size: 0.875rem; font-weight: 600; color: var(--text-primary); }
.dag-timeline-detail { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ─── SEKUR Compliance Circle ──────────────────────────────── */
.compliance-circle-wrap { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.compliance-circle-text {
    position: absolute;
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--text-primary);
    line-height: 1;
}
.compliance-circle-text small { display: block; font-size: 0.625rem; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

/* ─── SEKUR Section Headers ────────────────────────────────── */
.sekur-section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}
.sekur-page-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0;
}
.sekur-page-date {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ─── Detail items ──────────────────────────────────────────── */
.detail-item { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.4rem 0; border-bottom: 1px solid var(--border-subtle); gap: 1rem; }
.detail-item:last-child { border-bottom: none; }
.detail-label { font-size: 0.75rem; font-weight: 600; color: #999; text-transform: uppercase; letter-spacing: 0.03em; white-space: nowrap; }

/* ─── Stat list ─────────────────────────────────────────────── */
.stat-list { display: flex; flex-direction: column; gap: 0.75rem; }
.stat-item { display: flex; justify-content: space-between; align-items: center; }
.stat-label { font-size: 0.875rem; color: #555; }

/* ─── List items ────────────────────────────────────────────── */
.list-item-compact { display: flex; justify-content: space-between; align-items: center; padding: 0.625rem 1.25rem; border-bottom: 1px solid var(--border-subtle); }
.list-item-compact:last-child { border-bottom: none; }

/* ─── Empty states ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}
.empty-state i {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.25;
    color: var(--text-primary);
}
.empty-state p { font-size: 0.9rem; margin: 0 0 1.25rem; }
.empty-state .empty-cta { margin-top: 1.25rem; }

/* ─── Installatie cards ─────────────────────────────────────── */
.installatie-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    transition: box-shadow 0.2s;
}
.installatie-card:hover { box-shadow: var(--shadow); }
.installatie-icon { width: 36px; height: 36px; background: var(--primary-lighter); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1.1rem; flex-shrink: 0; }
.installatie-body { flex: 1; min-width: 0; }
.installatie-type { font-size: 0.8rem; font-weight: 600; }
.installatie-info { font-size: 0.72rem; }

/* ─── Avatar ────────────────────────────────────────────────── */
.avatar-sm { width: 30px; height: 30px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; color: white; flex-shrink: 0; }

/* ─── Status badges helper ──────────────────────────────────── */
.badge.bg-orange { background-color: var(--accent) !important; }

/* ─── Tables ────────────────────────────────────────────────── */
.table { font-size: 0.875rem; }
.table th {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    padding: 0.625rem 0.75rem;
    white-space: nowrap;
}
.table td { vertical-align: middle; padding: 0.625rem 0.75rem; }
.table tbody tr { transition: background 0.1s; }
.table tbody tr:hover { background: var(--border-subtle) !important; }
.table tbody tr:hover td:last-child { background: var(--border-subtle); }
/* Subtle row separator */
.table-sekur tbody tr + tr { border-top: 1px solid var(--border-subtle); }
.table-sekur thead th { background: var(--body-bg); }

/* ─── Accordion ─────────────────────────────────────────────── */
.accordion-button:not(.collapsed) { background: var(--primary-lighter); color: var(--primary); box-shadow: none; }
.accordion-button:focus:not(:focus-visible) { box-shadow: none; }

/* ─── Responsive sidebar ────────────────────────────────────── */
@media (max-width: 992px) {
    .sidebar {
        width: 0;
        overflow: hidden;
        transform: translateX(-100%);
        transition: transform 0.3s ease, width 0.3s ease;
        box-shadow: none;
    }
    .sidebar.show {
        width: var(--sidebar-width);
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.25);
    }
    .main-content { margin-left: 0; }
}

/* ─── Sidebar overlay (mobile) ──────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 999;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}
/* Overlay alleen zichtbaar op mobiele viewports; op desktop is de sidebar
   altijd zichtbaar en mag de overlay nooit over de content heen liggen,
   zelfs niet als de .show-class per ongeluk gezet is. */
@media (max-width: 991.98px) {
    .sidebar-overlay.show { display: block; }
}

/* ─── Mobile content area ───────────────────────────────────── */
@media (max-width: 576px) {
    .content-area { padding: 0.75rem; }
    .topbar { padding: 0 0.75rem; }
    .topbar-title { font-size: 0.9rem; }

    /* Stack topbar actions vertically, hide label */
    .topbar-user { display: none !important; }

    /* Larger touch targets */
    .btn { min-height: 38px; }
    .btn-sm { min-height: 32px; }
    .nav-item { padding: 0.75rem 1.25rem; }

    /* KPI cards smaller on mobile */
    .kpi-card { padding: 0.875rem; gap: 0.6rem; }
    .kpi-value { font-size: 1.35rem; }
    .kpi-icon { font-size: 1.5rem; }
    /* v1095: compactere icoon-chip zodat waarde + pijl passen */
    .kpi-card .bi { width: 34px; height: 34px; font-size: 1rem !important; border-radius: 8px; }
    .kpi-card .d-flex { gap: 0.6rem !important; }

    /* Card headers wrap */
    .card-header { flex-wrap: wrap; gap: 0.5rem; }
    .card-header .btn { font-size: 0.75rem; padding: 0.25rem 0.5rem; }

    /* Detail items stack */
    .detail-item { flex-direction: column; gap: 0.15rem; align-items: flex-start; }
    .detail-label { margin-bottom: 0; }

    /* Tables: horizontal scroll */
    .table-responsive { -webkit-overflow-scrolling: touch; }
    .table { font-size: 0.8rem; }
    .table th { font-size: 0.7rem; }
}

@media (max-width: 768px) {
    .content-area { padding: 1rem; }
    .topbar { padding: 0 1rem; gap: 0.5rem; }

    /* Cards with smaller body padding */
    .card-body { padding: 0.875rem; }

    /* Reduce form label size */
    .form-label { font-size: 0.875rem; }
}

/* ─── Login responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .login-wrapper { flex-direction: column; }
    .login-left { display: none; }
    .login-right {
        width: 100%;
        min-height: 100vh;
        padding: 1.5rem;
        align-items: flex-start;
        padding-top: 3rem;
    }
    .login-card { padding: 1.5rem; }
}

/* ─── Portal styles ─────────────────────────────────────────── */
.portal-body { background: #F6F5F2; }
.portal-navbar {
    background: var(--primary);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
}
.portal-navbar .navbar-brand { color: white !important; font-size: 1.1rem; }
.portal-navbar .nav-link { color: rgba(255,255,255,0.75) !important; font-size: 0.875rem; padding: 0.4rem 0.75rem; border-radius: 6px; transition: all 0.2s; }
.portal-navbar .nav-link:hover { color: white !important; background: rgba(255,255,255,0.1); }
.portal-navbar .nav-link.active { color: white !important; background: var(--accent); }
/* v1085: het "Portaal"-label in merkstijl i.p.v. Bootstrap-geel */
.portal-badge { background: var(--accent); color: #fff; border-radius: 999px; padding: 0.2rem 0.6rem; font-size: 0.7rem; font-weight: 700; }
.portal-avatar { width: 32px; height: 32px; background: rgba(255,255,255,0.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: white; font-size: 0.875rem; }
.portal-content { min-height: calc(100vh - 130px); }
.portal-footer { background: var(--card-bg); border-top: 1px solid var(--border-color); padding: 1rem 0; }

/* ─── Mobile bottom navigation bar ─────────────────────────── */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    z-index: 1001;
    padding: 0;
}
.mobile-bottom-nav .bottom-nav-inner {
    display: flex;
    height: 100%;
}
.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: #888;
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 500;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.mobile-nav-item i { font-size: 1.3rem; }
.mobile-nav-item.active { color: var(--primary); }
.mobile-nav-item.active i { font-weight: 900; }
.mobile-nav-item.btn-menu { color: var(--primary); }

@media (max-width: 992px) {
    .mobile-bottom-nav { display: flex; }
    /* Make room for bottom nav */
    .main-content { padding-bottom: 60px; }
    .portal-footer { margin-bottom: 60px; }
}

/* ─── Responsive tables with card-like mobile display ───────── */
@media (max-width: 640px) {
    /* Allow tables to scroll horizontally */
    .table-responsive { border: 0; }

    /* Hide less important columns on very small screens */
    .table .d-none-xs { display: none !important; }

    /* Row actions always visible */
    .table td:last-child, .table th:last-child { position: sticky; right: 0; background: var(--card-bg); }
    .table tbody tr:hover td:last-child { background: var(--border-subtle); }
}

/* ─── Improved form layout on mobile ────────────────────────── */
@media (max-width: 576px) {
    /* Full-width selects and inputs */
    .input-group .btn { padding: 0.375rem 0.625rem; }

    /* Stacked button groups */
    .d-flex.gap-2 { flex-wrap: wrap; }
    .d-flex.gap-2 .btn { flex: 1 1 auto; min-width: 120px; }

    /* Reduce modal padding */
    .modal-body { padding: 1rem; }
    .modal-header { padding: 0.875rem 1rem; }
    .modal-footer { padding: 0.75rem 1rem; }

    /* Alert padding */
    .alert { padding: 0.625rem 0.875rem; font-size: 0.85rem; }

    /* Page header spacing */
    .row.g-3.mb-4 { margin-bottom: 0.75rem !important; }
    .row.g-3.mb-3 { margin-bottom: 0.5rem !important; }
}

/* ─── Portal mobile improvements ────────────────────────────── */
@media (max-width: 576px) {
    .portal-navbar .navbar-brand { font-size: 0.95rem; }
    .portal-content { padding-top: 0.75rem; }

    /* Portal cards stack better */
    .portal-card-grid { grid-template-columns: 1fr !important; }
}

/* ─── Print styles ──────────────────────────────────────────── */
@media print {
    .sidebar, .topbar, .btn, .flash-container, .mobile-bottom-nav, .sidebar-overlay { display: none !important; }
    .main-content { margin-left: 0 !important; padding-bottom: 0 !important; }
}

/* ─── Custom scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c5cdd8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a0adb8; }

/* ─── Font monospace ────────────────────────────────────────── */
.font-monospace { font-family: 'Consolas', 'Courier New', monospace; letter-spacing: 0.02em; }

/* ─── Alpine.js: voorkom flash-of-uncloaked-content ─────────── */
[x-cloak] { display: none !important; }

/* ─── HTMX: subtiele loading-indicator ──────────────────────── */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

/* ─── Page Card (modern card-panel replacement) ─────────────── */
.page-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
}
.page-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}
.page-card-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}
.page-card-body { padding: 1.25rem; }
.page-card-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--body-bg);
}

/* ─── Semantic badge color overrides ────────────────────────── */
/* Map Bootstrap utility classes to our status tokens so all
   existing templates get consistent color without markup changes. */
.badge.bg-success  { background-color: var(--status-ok)      !important; }
.badge.bg-danger   { background-color: var(--status-danger)   !important; }
.badge.bg-warning  { background-color: var(--status-warning)  !important; color: #fff !important; }
.badge.bg-info     { background-color: var(--status-info)     !important; }
.badge.bg-primary  { background-color: var(--navy)            !important; }
.badge.bg-secondary{ background-color: var(--status-muted)    !important; }

/* ─── Flash toasts ──────────────────────────────────────────── */
.flash-toast-container {
    position: fixed;
    top: calc(var(--topbar-height) + 12px);
    right: 1rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 380px;
    width: calc(100vw - 2rem);
    pointer-events: none;
}
.flash-toast {
    pointer-events: all;
    background: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.08);
    border-left: 4px solid var(--navy);
    padding: 0.875rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: toast-slide-in 0.25s cubic-bezier(0.34,1.56,0.64,1) both;
    font-size: 0.875rem;
    line-height: 1.4;
}
.flash-toast.toast-success  { border-left-color: var(--status-ok); }
.flash-toast.toast-danger   { border-left-color: var(--status-danger); }
.flash-toast.toast-warning  { border-left-color: var(--status-warning); }
.flash-toast.toast-info     { border-left-color: var(--status-info); }
.flash-toast .toast-icon    { font-size: 1.125rem; flex-shrink: 0; margin-top: 1px; }
.flash-toast.toast-success  .toast-icon { color: var(--status-ok); }
.flash-toast.toast-danger   .toast-icon { color: var(--status-danger); }
.flash-toast.toast-warning  .toast-icon { color: var(--status-warning); }
.flash-toast.toast-info     .toast-icon { color: var(--status-info); }
.flash-toast .toast-body    { flex: 1; color: var(--text-primary); }
.flash-toast .toast-close {
    background: none; border: none; padding: 0; cursor: pointer;
    color: var(--text-muted); font-size: 1rem; line-height: 1; flex-shrink: 0;
    opacity: 0.6; transition: opacity 0.15s;
}
.flash-toast .toast-close:hover { opacity: 1; }
.flash-toast.toast-hiding {
    animation: toast-slide-out 0.2s ease-in forwards;
}
@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(120%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-slide-out {
    from { opacity: 1; transform: translateX(0); max-height: 120px; margin-bottom: 0; }
    to   { opacity: 0; transform: translateX(120%); max-height: 0; padding: 0; margin: 0; }
}

/* ── v34: menu-zoekveld, domein-tinten en compacte menubalk ─────────── */
.sidebar-zoek {
    position: relative;
    margin: 0.35rem 0.75rem 0.6rem;
}
.sidebar-zoek input {
    width: 100%;
    background: var(--input-bg, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    color: var(--text-primary, #0f172a);
    padding: 0.42rem 2rem 0.42rem 2rem;
    font-size: 0.82rem;
    outline: none;
}
.sidebar-zoek input::placeholder { color: var(--text-muted, #64748b); }
.sidebar-zoek input:focus { border-color: var(--accent, #f59e0b); }
.sidebar-zoek > .bi-search {
    position: absolute; left: 0.65rem; top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem; color: var(--text-muted, #64748b);
}
.sidebar-zoek kbd {
    position: absolute; right: 0.5rem; top: 50%;
    transform: translateY(-50%);
    font-size: 0.62rem; padding: 0 0.3rem;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 4px; color: var(--text-muted, #64748b);
    background: none;
}

.sg-ico {
    width: 26px; height: 26px; border-radius: 7px;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.sg-ico i { font-size: 0.85rem !important; width: auto !important; }
.k-blauw  { background: rgba(59, 130, 246, 0.14);  color: #3b6cc7; }
.k-oranje { background: rgba(232, 117, 10, 0.14);  color: #c96508; }
.k-groen  { background: rgba(34, 197, 94, 0.14);   color: #1f8a52; }
.k-paars  { background: rgba(139, 92, 246, 0.14);  color: #7050c8; }
.k-teal   { background: rgba(20, 184, 166, 0.14);  color: #148a80; }
.k-geel   { background: rgba(214, 168, 40, 0.16);  color: #96700f; }
.k-rood   { background: rgba(239, 68, 68, 0.13);   color: #c24444; }
.k-grijs  { background: rgba(100, 116, 139, 0.13); color: #64748b; }
.sidebar-group-toggle, .nav-item-primary { gap: 0.55rem; }

.nav-verborgen { display: none !important; }

.sidebar-compact-knop {
    display: flex; align-items: center; gap: 0.55rem;
    width: calc(100% - 1rem);
    margin: 0.8rem 0.5rem 0.4rem;
    padding: 0.45rem 0.75rem;
    background: none;
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    cursor: pointer;
}
.sidebar-compact-knop:hover {
    color: var(--text-primary, #0f172a);
    background: var(--border-subtle, #f1f5f9);
}

/* Compacte stand: smalle iconenstrook met flyouts */
body.sidebar-compact { --sidebar-width: 68px; }
body.sidebar-compact .sidebar { width: 68px; overflow: visible; }
body.sidebar-compact .sidebar-nav { overflow: visible; }
body.sidebar-compact .sidebar .brand-text,
body.sidebar-compact .workspace-info,
body.sidebar-compact .workspace-chevron,
body.sidebar-compact .sidebar-zoek,
body.sidebar-compact .sidebar-group-toggle > span:not(.sg-ico),
body.sidebar-compact .sidebar-group-toggle .bi-chevron-down,
body.sidebar-compact .sidebar-group-toggle .nav-badge,
body.sidebar-compact .nav-item-primary > span:not(.sg-ico),
body.sidebar-compact .nav-item-primary .nav-badge,
body.sidebar-compact .sidebar-compact-knop span,
body.sidebar-compact .sidebar-footer .user-details { display: none; }
body.sidebar-compact .sidebar-group-toggle,
body.sidebar-compact .nav-item-primary,
body.sidebar-compact .sidebar-compact-knop { justify-content: center; }
body.sidebar-compact .sidebar-group { position: relative; }
body.sidebar-compact .sidebar-group-items {
    display: none;
    position: absolute; left: 62px; top: -4px;
    min-width: 230px; max-height: none !important;
    background: var(--sidebar-bg, #ffffff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 0.4rem;
    z-index: 1050;
    overflow: visible;
}
body.sidebar-compact .sidebar-group:hover .sidebar-group-items,
body.sidebar-compact .sidebar-group:focus-within .sidebar-group-items {
    display: block;
}
body.sidebar-compact .sidebar-group-items .nav-item { padding-left: 0.9rem; }
@media (max-width: 991px) {
    /* Op mobiel geldt de bestaande off-canvas; compacte stand uit. */
    body.sidebar-compact .sidebar { width: var(--sidebar-width, 260px); }
    body.sidebar-compact .sidebar-zoek { display: block; }
}

/* ── v35: workspace-blok is het merk (SEKUR-blok weg bij tenant) ────── */
.sidebar-workspace { padding-top: 0.9rem; padding-bottom: 0.9rem; }
.workspace-name { font-size: 0.95rem; font-weight: 700; }
.workspace-avatar { width: 38px; height: 38px; font-size: 0.9rem; }
