/* ============================================================
   ONS-VMZ Vergelijker — Web UI Stylesheet
   Ariane Zorg huisstijl: oranje #f79437, grijs #58585a
   ============================================================ */

/* ── Reset & basis ────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Ariane Zorg huisstijl */
    --brand-orange: #f79437;
    --brand-orange-hover: #e07e1f;
    --brand-orange-light: #fef5eb;
    --brand-gray: #58585a;
    --brand-black: #1a1a2e;

    --primary: var(--brand-orange);
    --primary-hover: var(--brand-orange-hover);
    --primary-light: var(--brand-orange-light);
    /* Het huisstijloranje haalt op wit 2,27:1 en is dus geen tekstkleur.
       Deze donkerdere tint haalt 4,73:1 en blijft herkenbaar dezelfde kleur.
       Randen, focusringen en vlakken houden --primary. */
    --primary-tekst: #ae5f0b;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --info: #0891b2;
    --info-bg: #cffafe;

    /* Dezelfde kleuren, een stap donkerder, voor tekst op de -bg variant.
       De volle kleur haalt daar 2,9 tot 4,0 op 1; WCAG AA vraagt 4,5 voor
       tekst onder 18,66px vet, en elk statuslabel valt daaronder. Vlakken,
       randen, stippen en grafiekstaven houden de volle kleur — daar geldt de
       eis niet en daar is de kleur zelf het signaal. */
    --success-tekst: #15803d;
    --warning-tekst: #b45309;
    --danger-tekst: #b91c1c;
    --info-tekst: #0e7490;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: var(--brand-gray);
    --gray-700: #3d3d3f;
    --gray-800: #2a2a2c;
    --gray-900: #1a1a2e;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.06), 0 2px 4px rgba(0,0,0,0.04);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
    margin: 0;
}

/* ── Sidebar layout ──────────────────────────────────────── */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--gray-900);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width 0.25s ease, min-width 0.25s ease;
    overflow: hidden;
}

.main-area {
    flex: 1;
    margin-left: 220px;
    min-height: 100vh;
    transition: margin-left 0.25s ease;
}

/* Sidebar header */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    min-height: 52px;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    text-decoration: none;
    color: white;
    overflow: hidden;
}

.sidebar-logo-wrap {
    display: inline-flex;
    align-items: center;
    background: white;
    border-radius: 4px;
    padding: 2px 5px;
    height: 28px;
    min-width: 28px;
    justify-content: center;
}

.sidebar-logo {
    height: 18px;
    width: auto;
    display: block;
}

.sidebar-app-name {
    font-size: 0.92rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: -0.01em;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.2rem;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
}

.sidebar-toggle:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* Sidebar navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.sidebar-link.active {
    background: rgba(247, 148, 55, 0.12);
    color: var(--brand-orange);
    border-left-color: var(--brand-orange);
    font-weight: 600;
}

.sidebar-icon {
    font-size: 0.92rem;
    min-width: 20px;
    text-align: center;
    line-height: 1;
}

.sidebar-label {
    opacity: 1;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}
.sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1;
    margin-left: 4px;
    vertical-align: middle;
}

/* Sidebar sub-header (voor run detail tabs) */
.sidebar-sub-header {
    padding: 0.6rem 0.85rem 0.25rem;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-400);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
}

/* Sidebar footer */
.sidebar-footer {
    padding: 0.6rem 0.85rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer-text {
    font-size: 0.68rem;
    color: var(--gray-500);
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    margin-bottom: 0.2rem;
}
.sidebar-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand-orange);
    /* Wit op het huisstijloranje haalt 2,27:1. Donker haalt 8,1:1. */
    color: var(--gray-900);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78rem;
    flex-shrink: 0;
}
.sidebar-user-name {
    font-size: 0.78rem;
    color: var(--gray-300);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Sidebar collapsed state ─────────────────────────────── */
.sidebar-collapsed .sidebar {
    width: 52px;
    min-width: 52px;
}

.sidebar-collapsed .main-area {
    margin-left: 52px;
}

.sidebar-collapsed .sidebar-app-name,
.sidebar-collapsed .sidebar-label,
.sidebar-collapsed .sidebar-footer-text,
.sidebar-collapsed .sidebar-sub-header,
.sidebar-collapsed .sidebar-user-name {
    display: none;
}
.sidebar-collapsed .sidebar-user {
    justify-content: center;
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar-collapsed .sidebar-brand {
    display: none;
}

.sidebar-collapsed .sidebar-link {
    justify-content: center;
    padding: 0.55rem 0;
    border-left-width: 2px;
    gap: 0;
}

.sidebar-collapsed .sidebar-icon {
    font-size: 1.05rem;
    min-width: auto;
}

.sidebar-collapsed .sidebar-footer {
    text-align: center;
    padding: 0.6rem 0;
}

.sidebar-collapsed .sidebar-toggle {
    margin: 0 auto;
}

/* ── Container ────────────────────────────────────────────── */
.container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
    flex: 1;
    width: 100%;
}

/* ── Page header ──────────────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.page-header h1 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
}

.page-header-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}


/* ── Layout-utility: 2-koloms grid (forms/details) ────────── */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* ── Tekst-/stat-utilities (uit herhaalde inline-styles) ──── */
.text-muted-xs { color: var(--gray-400); font-size: 0.72rem; }
.text-muted-sm { font-size: 0.85rem; color: var(--gray-500); }
.text-label    { color: var(--gray-400); font-size: 0.78rem; letter-spacing: 0.04em; }
.stat-num-lg   { font-size: 1.6rem; font-weight: 700; }
.stat-num-md   { font-size: 1.5rem; font-weight: 700; }
.stat-num-sm   { font-size: 1.4rem; font-weight: 700; }
