/* ─── Google Fonts ──────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

/* ─── ICTKanon brand kleuren ─────────────────────────────────────────────────── */
:root {
    --avh-dark: #32373C;
    --avh-orange: #ff6900;
    --avh-orange-hover: #e05a00;
    --avh-text: #333333;
    --avh-muted: #666666;
    --avh-border: #E2E2E2;
    --avh-bg: #f0f2f5;
}

/* ─── Algemeen ──────────────────────────────────────────────────────────────── */
body {
    background-color: var(--avh-bg);
    font-family: 'Open Sans', Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7em;
    color: var(--avh-text);
}

.kp-page-body {
    min-height: 100vh;
}

.kp-page-wrap {
    padding-top: .25rem;
    padding-bottom: .25rem;
}

.container {
    max-width: 1100px;
}

/* ─── Kaarten ───────────────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--avh-border);
    border-radius: .6rem;
}

.card-header {
    background: #f8f9fa;
    border-bottom: 1px solid var(--avh-border);
    padding: .75rem 1rem;
    font-size: .9rem;
    color: var(--avh-dark);
}

/* ─── Statistieken ──────────────────────────────────────────────────────────── */
.stat-card {
    transition: transform .15s, box-shadow .15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .08) !important;
}

.stat-icon {
    font-size: 1.8rem;
    line-height: 1;
    opacity: .8;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #212529;
}

.stat-label {
    font-size: .75rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* ─── Tabel ─────────────────────────────────────────────────────────────────── */
.table> :not(caption)>*>* {
    padding: .65rem 1rem;
}

.table-hover tbody tr:hover {
    background-color: #f0f7ff;
    cursor: pointer;
}

/* ─── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
    padding: .5rem 0;
    background-color: var(--avh-dark);
}

.kp-navbar {
    min-height: 60px;
}

.kp-page-body--nonprod {
    box-shadow: inset 0 4px 0 #ff8a00;
}

.kp-navbar-logo {
    width: auto;
    object-fit: contain;
}

.kp-env-badge {
    background: linear-gradient(135deg, #ff8a00 0%, #ffb347 100%);
    color: #1f2937;
    border: 1px solid rgba(255, 255, 255, .35);
    letter-spacing: .08em;
    font-size: .65rem;
    font-weight: 800;
    vertical-align: middle;
}

.kp-navbar-logo--app {
    height: 36px;
}

.kp-navbar-logo--admin {
    height: 30px;
}

.kp-navbar-logo--portaal {
    height: 34px;
}

.navbar-brand img {
    height: 36px;
    width: auto;
    filter: none;
}

.navbar-nav .nav-link {
    color: rgba(255, 255, 255, .85) !important;
    font-weight: 600;
    font-size: .875rem;
    transition: color .2s ease;
}

.navbar-nav .nav-link:hover {
    color: var(--avh-orange) !important;
}

/* ─── Badges ────────────────────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    font-size: .75rem;
    padding: .3em .6em;
}

/* ─── Knoppen ───────────────────────────────────────────────────────────────── */
.btn-primary {
    background-color: var(--avh-orange);
    border-color: var(--avh-orange);
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--avh-orange-hover);
    border-color: var(--avh-orange-hover);
}

.btn-outline-primary {
    color: var(--avh-orange);
    border-color: var(--avh-orange);
    font-weight: 600;
}

.btn-outline-primary:hover {
    background-color: var(--avh-orange);
    border-color: var(--avh-orange);
}

/* ─── Formulieren ───────────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 .2rem rgba(255, 105, 0, .25);
    border-color: var(--avh-orange);
}

.omschrijving-tekst {
    white-space: pre-wrap;
    line-height: 1.6;
    margin-bottom: 0;
}

/* ─── Navbar avatar ─────────────────────────────────────────────────────────── */
.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--avh-orange);
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.navbar-nav .nav-link.active {
    color: var(--avh-orange) !important;
    font-weight: 700;
}

/* ─── Mobiel optimalisaties ─────────────────────────────────────────────────── */
@media (max-width: 576px) {
    .container {
        padding-left: .75rem;
        padding-right: .75rem;
    }

    .stat-number {
        font-size: 1.2rem;
    }

    .table-responsive {
        font-size: .85rem;
    }

    h1.h3 {
        font-size: 1.1rem;
    }

    .kp-page-wrap {
        padding-top: 0;
        padding-bottom: 0;
    }

    .kp-navbar .navbar-collapse {
        margin-top: .5rem;
        padding-bottom: .25rem;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════════ */
/* ═══════════════ DARK MODE (v1.4.0) ═══════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════════ */

/* Dark mode theme variables */
:root.dark-mode {
    --avh-dark: #e0e0e0;
    --avh-orange: #ff7f1f;
    --avh-orange-hover: #ff8d33;
    --avh-text: #e0e0e0;
    --avh-muted: #b0b0b0;
    --avh-border: #404040;
    --avh-bg: #1a1a1a;
    --bs-body-bg: #1e1e1e;
    --bs-body-color: #e0e0e0;
    --bs-secondary-bg: #2d2d2d;
    --bs-tertiary-bg: #353535;
    --bs-card-bg: #2a2a2a;
    --bs-card-border: #404040;
}

/* Core dark mode styles */
:root.dark-mode body {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

:root.dark-mode .navbar,
:root.dark-mode .navbar-dark {
    border-bottom: 1px solid #404040;
}

:root.dark-mode .card {
    background-color: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

:root.dark-mode .card-header {
    background-color: #262626;
    border-bottom-color: #404040;
    color: #e0e0e0;
}

:root.dark-mode .card-body {
    background-color: #2a2a2a;
}

:root.dark-mode .list-group-item {
    background-color: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

:root.dark-mode .list-group-item a {
    color: #64b5f6;
}

:root.dark-mode .list-group-item a:hover {
    color: #90caf9;
}

:root.dark-mode .form-control,
:root.dark-mode .form-select,
:root.dark-mode .form-control-plaintext {
    background-color: #262626;
    border-color: #404040;
    color: #e0e0e0;
}

:root.dark-mode .form-control:focus,
:root.dark-mode .form-select:focus {
    background-color: #2d2d2d;
    border-color: #ff7f1f;
    color: #e0e0e0;
    box-shadow: 0 0 0 0.25rem rgba(255, 127, 31, 0.25);
}

:root.dark-mode .form-control::placeholder {
    color: #909090;
}

:root.dark-mode textarea.form-control {
    background-color: #262626;
    color: #e0e0e0;
}

:root.dark-mode table {
    color: #e0e0e0;
}

:root.dark-mode .table {
    --bs-table-color: #e0e0e0;
    --bs-table-bg: #2a2a2a;
    --bs-table-border-color: #404040;
    --bs-table-hover-bg: #323232;
    --bs-table-striped-bg: #262626;
}

:root.dark-mode .table-bordered {
    border-color: #404040;
}

:root.dark-mode thead {
    background-color: #1f1f1f;
    color: #e0e0e0;
}

:root.dark-mode .badge {
    --bs-badge-bg: #404040;
    --bs-badge-color: #e0e0e0;
}

:root.dark-mode .btn-outline-secondary {
    --bs-btn-color: #e0e0e0;
    --bs-btn-border-color: #404040;
}

:root.dark-mode .btn-outline-secondary:hover {
    --bs-btn-bg: #404040;
}

:root.dark-mode .alert {
    background-color: #2a2a2a;
    border-color: #404040;
    color: #e0e0e0;
}

:root.dark-mode .alert-light {
    background-color: #262626;
    border-color: #404040;
    color: #e0e0e0;
}

:root.dark-mode .modal-content {
    background-color: #2a2a2a;
    border-color: #404040;
}

:root.dark-mode .modal-header {
    background-color: #262626;
    border-bottom-color: #404040;
    color: #e0e0e0;
}

:root.dark-mode .modal-body {
    background-color: #2a2a2a;
    color: #e0e0e0;
}

:root.dark-mode .modal-footer {
    background-color: #262626;
    border-top-color: #404040;
}

:root.dark-mode .close,
:root.dark-mode .btn-close {
    filter: invert(1);
    color: #e0e0e0;
}

:root.dark-mode .nav-tabs {
    border-bottom-color: #404040;
}

:root.dark-mode .nav-tabs .nav-link {
    color: #b0b0b0;
}

:root.dark-mode .nav-tabs .nav-link.active {
    background-color: #2a2a2a;
    border-color: #404040 #404040 #2a2a2a;
    color: #e0e0e0;
}

:root.dark-mode .dropdown-menu {
    background-color: #2a2a2a;
    border-color: #404040;
}

:root.dark-mode .dropdown-item {
    color: #e0e0e0;
}

:root.dark-mode .dropdown-item:hover,
:root.dark-mode .dropdown-item:focus {
    background-color: #353535;
    color: #e0e0e0;
}

:root.dark-mode .dropdown-divider {
    border-color: #404040;
}

:root.dark-mode .pagination {
    --bs-pagination-bg: #2a2a2a;
    --bs-pagination-border-color: #404040;
}

:root.dark-mode .page-link {
    background-color: #2a2a2a;
    border-color: #404040;
    color: #64b5f6;
}

:root.dark-mode .page-link:hover {
    background-color: #353535;
    border-color: #404040;
    color: #90caf9;
}

:root.dark-mode .page-link.active {
    background-color: #ff7f1f;
    border-color: #ff7f1f;
}

/* Dark mode toggle button styling */
.dark-mode-toggle {
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.35rem;
    transition: background-color 0.2s ease;
}

.dark-mode-toggle:hover {
    background-color: rgba(255, 127, 31, 0.1);
}

/* Dark mode code blocks */
:root.dark-mode code {
    color: #64b5f6;
    background-color: #262626;
    border-radius: 0.25rem;
    padding: 0.2rem 0.4rem;
}

:root.dark-mode pre {
    background-color: #262626;
    border-color: #404040;
    color: #e0e0e0;
}

/* ─── Feature-kaarten (instellingen) ────────────────────────────────────────── */
.feat-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: .5rem;
    padding: .9rem 1rem;
    display: flex !important;
    align-items: center;
    gap: .85rem;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    height: 100%;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.feat-card:hover {
    border-color: #adb5bd;
    color: inherit;
    text-decoration: none;
}

.feat-card:has(input:checked) {
    border-color: #0d6efd;
    background: #f0f6ff;
}

.feat-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    border-radius: .4rem;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: background .15s, color .15s;
}

.feat-card:has(input:checked) .feat-icon {
    background: #0d6efd;
    color: #fff;
}

.feat-card .form-check-input {
    width: 2.25em;
    height: 1.2em;
    cursor: pointer;
}

.inst-save-bar {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(6px);
    border-top: 1px solid #dee2e6;
    padding: .7rem 1.5rem;
    z-index: 1020;
}

/* ─── Functies sidebar-nav ────────────────────────────────────────────────── */
.ft-sidebar-nav {
    border-right: 1px solid #e9ecef;
    padding: 1.25rem .85rem 1.25rem 1rem;
    background: #fbfcfd;
    min-height: 380px;
}

.ft-nav-pill {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem .8rem;
    border-radius: .5rem;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    cursor: pointer;
    transition: background .12s;
    color: #344;
}

.ft-nav-pill:hover {
    background: #f1f3f5;
}

.ft-nav-pill.active {
    background: #eef3fc;
    color: #0d6efd;
}

.ft-nav-dot {
    width: 38px;
    min-width: 38px;
    height: 38px;
    border-radius: .45rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.ft-content {
    padding: 1.5rem 1.75rem;
}

.ft-pane-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f0f1f3;
    margin-bottom: 1.4rem;
}

.ft-pane-icon {
    width: 46px;
    min-width: 46px;
    height: 46px;
    border-radius: .55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    flex-shrink: 0;
}

.ft-label {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #8a9bb0;
    margin-bottom: .5rem;
    margin-top: 1.25rem;
}

.ft-label:first-child {
    margin-top: 0;
}

/* ─── Afdrukken ─────────────────────────────────────────────────────────────── */
/* @page als top-level regel (niet in @media) — anders negeert Firefox het */
@page {
    margin: 0;
}

@media print {
    body {
        margin: 12mm 14mm;
        background: #fff !important;
        color: #000 !important;
    }

    .navbar,
    .footer,
    .btn,
    .no-print {
        display: none !important;
    }
}