/* ============================================================
   Portal — Hoofdstijlblad
   ============================================================ */

:root {
    --sidebar-w: 248px;
    --sidebar-bg: #0f172a;
    --sidebar-hover: rgba(255,255,255,.06);
    --sidebar-active-bg: rgba(99,102,241,.18);
    --sidebar-active-border: #6366f1;
    --accent: #6366f1;
    --accent-dark: #4f46e5;
    --body-bg: #f1f5f9;
    --card-radius: 10px;
    --text-primary: #0f172a;
    --text-muted: #64748b;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--body-bg);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 14px;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--sidebar-w); height: 100vh;
    background: var(--sidebar-bg);
    display: flex; flex-direction: column;
    overflow-y: auto; z-index: 1000;
    border-right: 1px solid rgba(255,255,255,.04);
}

.main-content { margin-left: var(--sidebar-w); min-height: 100vh; }
.page-wrapper  { padding: 24px 28px; max-width: 100%; }

@media (max-width: 991px) {
    #sidebar      { display: none !important; }
    .main-content { margin-left: 0; }
    .page-wrapper { padding: 16px; }
}

/* Brand */
.sidebar-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 18px 16px;
    color: #fff; font-weight: 700; font-size: .95rem;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
    letter-spacing: .2px;
    flex-shrink: 0;
}
.sidebar-brand .brand-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-size: .9rem; flex-shrink: 0;
}

/* User pill */
.sidebar-user {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-user-name { color: rgba(255,255,255,.9); font-weight: 600; font-size: .82rem; }
.sidebar-user-role { margin-top: 3px; }

/* Nav */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0 16px; }

.nav-section {
    padding: 16px 16px 4px;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: rgba(255,255,255,.28);
    font-weight: 700;
    user-select: none;
}

.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 16px;
    color: rgba(255,255,255,.55);
    text-decoration: none;
    font-size: .83rem;
    transition: background .12s, color .12s;
    border-left: 2px solid transparent;
    margin: 1px 0;
}
.sidebar-link:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,.9);
}
.sidebar-link.active {
    background: var(--sidebar-active-bg);
    color: #fff;
    border-left-color: var(--sidebar-active-border);
    font-weight: 600;
}
.sidebar-link i {
    width: 16px; text-align: center;
    font-size: .78rem; opacity: .7;
    flex-shrink: 0;
}
.sidebar-link.active i { opacity: 1; }

.sidebar-divider {
    height: 1px; background: rgba(255,255,255,.06);
    margin: 8px 16px;
}

/* ============================================================
   MOBILE TOPBAR
   ============================================================ */
.mobile-topbar {
    display: none;
    background: var(--sidebar-bg);
    padding: 11px 16px;
    align-items: center; justify-content: space-between;
    position: sticky; top: 0; z-index: 999;
    border-bottom: 1px solid rgba(255,255,255,.06);
}
.mobile-topbar-brand { color: #fff; font-weight: 700; font-size: .9rem; }

@media (max-width: 991px) {
    .mobile-topbar { display: flex; }
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.page-header h1 {
    font-size: 1.3rem; font-weight: 700; margin: 0;
    color: var(--text-primary);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: #fff;
    border: 1px solid #e2e8f0 !important;
    border-radius: var(--card-radius) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.04) !important;
}
.card-header {
    background: #fff !important;
    border-bottom: 1px solid #e2e8f0 !important;
    border-radius: var(--card-radius) var(--card-radius) 0 0 !important;
    padding: 12px 18px;
    font-weight: 600; font-size: .85rem;
    color: var(--text-primary);
}
.card-body { padding: 18px; }
.table-card .card-body { padding: 0; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-card {
    border-radius: var(--card-radius);
    padding: 20px;
    color: #fff;
    position: relative; overflow: hidden;
    border: none !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.12) !important;
}
.stat-card h2 { font-size: 1.9rem; font-weight: 700; margin: 0 0 2px; line-height: 1; }
.stat-card p  { margin: 0; opacity: .85; font-size: .8rem; }
.stat-icon {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-50%);
    font-size: 2rem; opacity: .12;
}

.stat-blue   { background: linear-gradient(135deg,#6366f1,#818cf8); }
.stat-green  { background: linear-gradient(135deg,#059669,#34d399); }
.stat-orange { background: linear-gradient(135deg,#d97706,#fbbf24); }
.stat-red    { background: linear-gradient(135deg,#dc2626,#f87171); }
.stat-teal   { background: linear-gradient(135deg,#0891b2,#38bdf8); }

/* ============================================================
   TABLES
   ============================================================ */
.table { margin: 0; font-size: .84rem; }
.table th {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .6px;
    color: var(--text-muted); font-weight: 600;
    padding: 9px 14px; background: #f8fafc;
    border-bottom: 1px solid #e2e8f0 !important;
    white-space: nowrap;
}
.table td {
    padding: 10px 14px; vertical-align: middle;
    border-bottom: 1px solid #f1f5f9 !important;
    color: var(--text-primary);
}
.table tbody tr:last-child td { border-bottom: none !important; }
.table tbody tr:hover { background: #f8faff; }
.table-card .table th:first-child,
.table-card .table td:first-child { padding-left: 18px; }
.table-card .table th:last-child,
.table-card .table td:last-child  { padding-right: 18px; }

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-size: .68rem; padding: 3px 8px;
    border-radius: 20px; font-weight: 600;
    letter-spacing: .2px;
}
/* Bootstrap 4 compat */
.badge-primary   { background:#6366f1;  color:#fff; }
.badge-success   { background:#059669;  color:#fff; }
.badge-warning   { background:#d97706;  color:#fff; }
.badge-danger    { background:#dc2626;  color:#fff; }
.badge-secondary { background:#64748b;  color:#fff; }
.badge-info      { background:#0891b2;  color:#fff; }
.badge-dark      { background:#1e293b;  color:#fff; }
.badge-light     { background:#f1f5f9;  color:#374151; }

/* ============================================================
   FORMS
   ============================================================ */
.form-label {
    font-weight: 600; font-size: .8rem;
    color: var(--text-primary); margin-bottom: 4px;
}
.form-control, .form-select {
    border-radius: 7px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 12px !important;
    font-size: .875rem;
    color: var(--text-primary);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15) !important;
    outline: none;
}
.input-group-text {
    background: #f8fafc;
    border-color: #cbd5e1 !important;
    color: var(--text-muted);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    border-radius: 7px;
    font-weight: 600; font-size: .83rem;
    padding: 7px 14px;
    transition: all .15s;
    border-width: 1px;
}
.btn-primary { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.btn-primary:hover { background: var(--accent-dark) !important; border-color: var(--accent-dark) !important; }
.btn-success { background: #059669 !important; border-color: #059669 !important; color: #fff !important; }
.btn-success:hover { background: #047857 !important; }
.btn-danger  { background: #dc2626 !important; border-color: #dc2626 !important; color: #fff !important; }
.btn-warning { background: #d97706 !important; border-color: #d97706 !important; color: #fff !important; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border-radius: 8px; border: none; font-size: .85rem; padding: 12px 16px; }
.alert-success { background: #dcfce7; color: #14532d; }
.alert-danger  { background: #fee2e2; color: #7f1d1d; }
.alert-warning { background: #fef9c3; color: #713f12; }
.alert-info    { background: #dbeafe; color: #1e3a5f; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-content {
    border-radius: 12px !important;
    border: none !important;
    box-shadow: 0 16px 48px rgba(0,0,0,.18) !important;
}
.modal-header { border-bottom: 1px solid #e2e8f0; padding: 14px 18px; }
.modal-body   { padding: 18px; }
.modal-footer { border-top: 1px solid #e2e8f0; padding: 12px 18px; }
.modal-title  { font-weight: 700; font-size: .95rem; }

/* ============================================================
   LOGIN PAGINA
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    background: #0f172a;
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(139,92,246,.12) 0%, transparent 50%);
}
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 40px 36px;
    width: 100%; max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,.4);
}
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo .logo-icon {
    width: 56px; height: 56px; border-radius: 14px;
    background: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 12px;
    font-size: 1.4rem; color: #fff;
    box-shadow: 0 4px 14px rgba(99,102,241,.4);
}
.login-logo h2 { font-size: 1.25rem; font-weight: 700; margin: 0 0 4px; }
.login-logo p  { color: var(--text-muted); font-size: .82rem; margin: 0; }

.social-login { display: flex; gap: 8px; margin: 0 0 16px; }
.social-btn {
    flex: 1; padding: 9px 8px;
    border: 1px solid #e2e8f0; border-radius: 7px;
    background: #fff; text-decoration: none;
    color: var(--text-primary); text-align: center;
    font-size: .82rem; font-weight: 600;
    transition: all .15s;
}
.social-btn:hover { border-color: var(--accent); color: var(--accent); background: #f5f5ff; }

.or-divider {
    display: flex; align-items: center; gap: 10px;
    color: #94a3b8; font-size: .75rem; margin: 16px 0;
}
.or-divider::before, .or-divider::after {
    content: ''; flex: 1; height: 1px; background: #e2e8f0;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline { position: relative; padding-left: 24px; }
.timeline::before { content:''; position:absolute; left:8px; top:0; bottom:0; width:2px; background:#e2e8f0; }
.timeline-item { position:relative; margin-bottom:16px; }
.timeline-dot {
    position:absolute; left:-22px; top:3px;
    width:18px; height:18px; border-radius:50%;
    background:#fff; border:2px solid #e2e8f0;
    display:flex; align-items:center; justify-content:center;
    font-size:8px;
}
.timeline-body { background:#f8fafc; border-radius:7px; padding:10px 14px; }

/* ============================================================
   LEGACY COMPAT (Bootstrap 4 pagina's)
   ============================================================ */
.container-fluid { padding-left: 18px !important; padding-right: 18px !important; }
.page-wrap, .boxklant { padding: 16px 20px; }

/* DataTables */
div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
    border-radius: 7px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 6px 10px !important;
    font-size: .83rem;
}
div.dataTables_wrapper div.dataTables_info,
div.dataTables_wrapper div.dataTables_paginate { font-size: .8rem; }

/* Select2 */
.select2-container--bootstrap-5 .select2-selection {
    border-radius: 7px !important;
    border: 1px solid #cbd5e1 !important;
    min-height: 38px !important;
    font-size: .875rem;
}

/* Tom Select */
.ts-wrapper.single .ts-control {
    border-radius: 7px !important;
    border: 1px solid #cbd5e1 !important;
    padding: 8px 12px !important;
}

/* Breadcrumb */
.breadcrumb { font-size: .8rem; }
.breadcrumb-item + .breadcrumb-item::before { color: #94a3b8; }

/* ============================================================
   Legacy container overrides - voorkomt dubbele padding
   ============================================================ */
.main-content .container-fluid {
    padding-left: 20px;
    padding-right: 20px;
}
.main-content > .page-wrapper > .container-fluid,
.main-content > .page-wrapper > .container {
    padding-left: 0;
    padding-right: 0;
}
/* Bootstrap 4 badge compat extra */
.badge.badge-pill { border-radius: 20px; }
span.badge-primary, span.badge-success, span.badge-warning,
span.badge-danger, span.badge-secondary, span.badge-info {
    display: inline-flex;
    align-items: center;
}
