/* ================================================================
   TETRA CDR Analyzer — Stijlen
   Thema: Rood / Wit / Zwart
   ================================================================ */

/* === RESET === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* === VARIABELEN === */
:root {
    --rood:          #c0392b;
    --rood-donker:   #96281b;
    --rood-licht:    #e74c3c;
    --rood-subtiel:  #fef2f2;
    --zwart:         #111111;
    --grijs-900:     #222222;
    --grijs-700:     #555555;
    --grijs-500:     #888888;
    --grijs-300:     #cccccc;
    --grijs-100:     #f5f5f5;
    --wit:           #ffffff;

    --kleur-tekst:        var(--grijs-900);
    --kleur-tekst-zacht:  var(--grijs-700);
    --kleur-tekst-hint:   var(--grijs-500);
    --kleur-achtergrond:  #f2f2f2;
    --kleur-kaart:        var(--wit);
    --kleur-rand:         #dedede;
    --kleur-accent:       var(--rood);
    --kleur-succes:       #16a34a;

    --schaduw-xs: 0 1px 2px rgba(0,0,0,0.06);
    --schaduw-sm: 0 2px 6px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
    --schaduw:    0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
    --schaduw-lg: 0 12px 40px rgba(0,0,0,0.14), 0 4px 10px rgba(0,0,0,0.06);

    --font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'Monaco', 'Consolas', 'Courier New', monospace;

    --radius:    6px;
    --radius-lg: 10px;
    --radius-xl: 14px;
}

/* === BASIS === */
body {
    font-family: var(--font);
    background-color: var(--kleur-achtergrond);
    color: var(--kleur-tekst);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 15px;
}

/* === LAYOUT === */
.page-wrapper {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

/* === HEADER === */
header {
    background-color: var(--zwart);
    color: var(--wit);
    padding: 0 1.5rem;
    margin: 0 -1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    height: 62px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--rood);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    text-decoration: none;
}

.header-logo-mark {
    width: 34px;
    height: 34px;
    background-color: var(--rood);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.75rem;
    letter-spacing: -0.05em;
    color: var(--wit);
    flex-shrink: 0;
}

.header-title {
    font-size: 1rem;
    font-weight: 800;
    color: var(--wit);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.header-subtitle {
    font-size: 0.6875rem;
    color: rgba(255,255,255,0.45);
    white-space: nowrap;
    font-weight: 400;
}

.header-spacer { flex: 1; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* === KNOPPEN === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.125rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    text-decoration: none;
    font-family: var(--font);
    line-height: 1;
}

.btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.btn.hidden { display: none !important; }

.btn-primary {
    background-color: var(--rood);
    color: var(--wit);
}
.btn-primary:hover:not(:disabled) { background-color: var(--rood-donker); }

.btn-ghost {
    background-color: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.18);
}
.btn-ghost:hover:not(:disabled) { background-color: rgba(255,255,255,0.2); }

.btn-success {
    background-color: var(--kleur-succes);
    color: var(--wit);
}
.btn-success:hover:not(:disabled) { background-color: #15803d; }

.btn-outline {
    background-color: transparent;
    color: var(--rood);
    border: 1.5px solid var(--rood);
}
.btn-outline:hover:not(:disabled) {
    background-color: var(--rood);
    color: var(--wit);
}

.btn-secondary {
    background-color: var(--grijs-100);
    color: var(--kleur-tekst-zacht);
    border: 1px solid var(--kleur-rand);
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--kleur-rand);
    color: var(--kleur-tekst);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-help {
    background-color: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    font-size: 0.9375rem;
    font-weight: 800;
    flex-shrink: 0;
}
.btn-help:hover { background-color: var(--rood); border-color: var(--rood); }

/* === SLIDEOVER === */
.slideover {
    position: fixed;
    inset: 0;
    z-index: 1000;
}
.slideover.hidden { display: none; }

.slideover-backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
}

.slideover-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: 620px;
    max-width: 96%;
    height: 100%;
    background-color: var(--wit);
    display: flex;
    flex-direction: column;
    animation: slideIn 0.2s ease-out;
    box-shadow: var(--schaduw-lg);
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

.slideover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background-color: var(--zwart);
    color: var(--wit);
    border-bottom: 3px solid var(--rood);
    flex-shrink: 0;
}

.slideover-header h2 {
    font-size: 1.0625rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.01em;
}

.slideover-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
    line-height: 1;
    padding: 0.125rem 0.25rem;
    border-radius: 4px;
    transition: color 0.15s;
}
.slideover-close:hover { color: var(--wit); }

.slideover-tabs {
    display: flex;
    border-bottom: 1px solid var(--kleur-rand);
    background-color: var(--grijs-100);
    flex-shrink: 0;
}

.slideover-tab-btn {
    flex: 1;
    padding: 0.875rem 1rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--kleur-tekst-zacht);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}
.slideover-tab-btn:hover { color: var(--kleur-tekst); background-color: var(--wit); }
.slideover-tab-btn.active {
    color: var(--rood);
    border-bottom-color: var(--rood);
    background-color: var(--wit);
}

.slideover-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
}

.alias-tab-content { display: none; }
.alias-tab-content.active { display: block; }

.slideover-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--kleur-rand);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--grijs-100);
    flex-shrink: 0;
}

.alias-storage-info {
    font-size: 0.75rem;
    color: var(--kleur-tekst-hint);
}

/* === ALIAS IMPORT === */
.import-methods {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.25rem;
    gap: 0;
}

.import-method {
    background-color: var(--grijs-100);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    padding: 1rem;
}

.import-method-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.375rem;
}

.import-method-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    background-color: var(--rood);
    color: var(--wit);
    font-size: 0.6875rem;
    font-weight: 900;
    flex-shrink: 0;
}

.import-method-desc {
    font-size: 0.8rem;
    color: var(--kleur-tekst-zacht);
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.import-divider {
    display: flex;
    align-items: center;
    color: var(--kleur-tekst-hint);
    font-size: 0.6875rem;
    margin: 0.625rem 0;
}
.import-divider::before,
.import-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--kleur-rand);
}
.import-divider span {
    padding: 0 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.csv-import-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-csv-import {
    padding: 0.4375rem 0.875rem;
    background-color: var(--wit);
    border: 1.5px solid var(--rood);
    border-radius: var(--radius);
    color: var(--rood);
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}
.btn-csv-import:hover { background-color: var(--rood); color: var(--wit); }

.csv-status {
    font-size: 0.8125rem;
    color: var(--kleur-succes);
    font-weight: 700;
}
.csv-status.error { color: var(--rood); }

.alias-import-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.alias-column label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--kleur-tekst-hint);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.375rem;
}

.alias-column-hint {
    font-size: 0.75rem;
    color: var(--kleur-tekst-hint);
    font-style: italic;
}

.alias-paste-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 2px dashed var(--kleur-rand);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background-color: var(--wit);
    color: var(--kleur-tekst);
    transition: all 0.15s;
    font-family: var(--font);
}
.alias-paste-input:focus {
    outline: none;
    border-color: var(--rood);
    border-style: solid;
}
.alias-paste-input::placeholder { color: var(--kleur-tekst-hint); }

.alias-list {
    max-height: 380px;
    overflow-y: auto;
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    background-color: var(--wit);
    margin-bottom: 0.75rem;
}

.alias-list-header {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--zwart);
    color: rgba(255,255,255,0.85);
    border-bottom: 1px solid var(--kleur-rand);
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    position: sticky;
    top: 0;
}

.alias-row {
    display: grid;
    grid-template-columns: 110px 1fr;
    gap: 0.5rem;
    padding: 0.375rem 1rem;
    border-bottom: 1px solid var(--kleur-rand);
    align-items: center;
}
.alias-row:last-child { border-bottom: none; }
.alias-row:hover { background-color: var(--grijs-100); }

.alias-id {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--rood);
}

.alias-input {
    width: 100%;
    padding: 0.3125rem 0.625rem;
    border: 1px solid var(--kleur-rand);
    border-radius: 4px;
    font-size: 0.8125rem;
    background-color: var(--wit);
    color: var(--kleur-tekst);
    transition: border-color 0.15s;
    font-family: var(--font);
}
.alias-input:focus { outline: none; border-color: var(--rood); }
.alias-input.has-value { background-color: #f0fdf4; border-color: #86efac; }

.alias-list-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--kleur-tekst-hint);
    font-size: 0.875rem;
}

.alias-actions {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--kleur-rand);
}

.alias-count {
    font-size: 0.8125rem;
    color: var(--kleur-tekst-hint);
    flex: 1;
    font-weight: 600;
}

.btn-clear-alias {
    padding: 0.375rem 0.75rem;
    background-color: transparent;
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    color: var(--kleur-tekst-zacht);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}
.btn-clear-alias:hover {
    background-color: var(--rood-subtiel);
    border-color: var(--rood-licht);
    color: var(--rood-donker);
}

.btn-save-alias {
    padding: 0.375rem 0.875rem;
    background-color: var(--kleur-succes);
    color: var(--wit);
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: var(--font);
}
.btn-save-alias:hover { background-color: #15803d; }

.btn-apply-alias {
    padding: 0.5625rem 1.5rem;
    background-color: var(--rood);
    color: var(--wit);
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 800;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: var(--font);
}
.btn-apply-alias:hover { background-color: var(--rood-donker); }

.id-display {
    display: block;
    font-size: 0.6875rem;
    color: var(--kleur-tekst-hint);
    font-weight: 400;
    font-family: var(--font-mono);
}

/* === UPLOAD ZONE === */
#upload-section { margin-bottom: 2rem; }

.drop-zone {
    border: 2px dashed var(--kleur-rand);
    border-radius: var(--radius-lg);
    padding: 2.75rem 2rem;
    text-align: center;
    background-color: var(--wit);
    cursor: pointer;
    transition: all 0.2s;
}
.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--rood);
    background-color: var(--rood-subtiel);
    border-style: solid;
}

.upload-icon {
    width: 44px;
    height: 44px;
    color: var(--grijs-300);
    margin-bottom: 0.875rem;
}

.drop-text {
    font-size: 1rem;
    font-weight: 800;
    color: var(--kleur-tekst);
    margin-bottom: 0.375rem;
    letter-spacing: -0.01em;
}

.drop-subtext {
    font-size: 0.875rem;
    color: var(--kleur-tekst-hint);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background-color: var(--wit);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.file-info.hidden { display: none; }

#file-name {
    font-weight: 700;
    color: var(--kleur-tekst);
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-count-badge {
    display: inline-block;
    background-color: var(--rood);
    color: var(--wit);
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.btn-add-more {
    padding: 0.375rem 0.75rem;
    background-color: var(--rood);
    color: var(--wit);
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: var(--font);
}
.btn-add-more:hover { background-color: var(--rood-donker); }
.btn-add-more.hidden { display: none; }

/* === RESULTATEN === */
#results-section { margin-top: 0; }
#results-section.hidden { display: none; }

/* === SAMENVATTING STATS === */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background-color: var(--wit);
    padding: 1.25rem 1.25rem 1rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--schaduw-sm);
    border-top: 3px solid var(--rood);
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--rood);
    margin-bottom: 0.25rem;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-label {
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--kleur-tekst-hint);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}

/* === TAB NAVIGATIE === */
.tab-navigation {
    display: flex;
    border-bottom: 2px solid var(--kleur-rand);
    margin-bottom: 1.75rem;
    overflow-x: auto;
    scrollbar-width: none;
    background-color: var(--wit);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--schaduw-xs);
    padding: 0 0.5rem;
    position: sticky;
    top: 62px;
    z-index: 50;
    user-select: none;
    -webkit-user-select: none;
}
.tab-navigation::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--kleur-tekst-zacht);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    font-family: var(--font);
    letter-spacing: 0.01em;
}
.tab-btn:hover { color: var(--kleur-tekst); }
.tab-btn.active {
    color: var(--rood);
    border-bottom-color: var(--rood);
}

/* === TAB INHOUD === */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* === STATS RASTER === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stats-grid-2 { grid-template-columns: repeat(2, 1fr); }
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid-auto { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.stats-grid-compact { margin-bottom: 1rem; }

.stat-block {
    background-color: var(--wit);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--schaduw-sm);
    text-align: center;
    border-left: 3px solid var(--kleur-rand);
}
.stat-block h3 {
    font-size: 0.625rem;
    font-weight: 800;
    color: var(--kleur-tekst-hint);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.375rem;
}
.stat-big {
    font-size: 2.125rem;
    font-weight: 900;
    color: var(--rood);
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.stat-desc {
    font-size: 0.75rem;
    color: var(--kleur-tekst-hint);
    margin-top: 0.25rem;
}

.stat-block.highlight {
    background-color: var(--rood);
    border-left-color: var(--rood-donker);
}
.stat-block.highlight h3 { color: rgba(255,255,255,0.75); }
.stat-block.highlight .stat-big { color: var(--wit); }
.stat-block.highlight .stat-desc { color: rgba(255,255,255,0.65); }

.stat-block.good {
    background-color: #f0fdf4;
    border-left-color: #4ade80;
}
.stat-block.good h3 { color: #166534; }
.stat-block.good .stat-big { color: #15803d; }
.stat-block.good .stat-desc { color: #166534; }

.stat-block.warning {
    background-color: #fffbeb;
    border-left-color: #fbbf24;
}
.stat-block.warning h3 { color: #92400e; }
.stat-block.warning .stat-big { color: #b45309; }
.stat-block.warning .stat-desc { color: #92400e; }

.stat-block.compact { padding: 0.875rem; }
.stat-block.compact h3 { font-size: 0.5625rem; }
.stat-block.compact .stat-big { font-size: 1.375rem; }
.stat-block.compact .stat-desc { font-size: 0.625rem; }

/* === GRAFIEK CONTAINERS === */
.chart-container {
    background-color: var(--wit);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--schaduw-sm);
    margin-bottom: 1.5rem;
}
.chart-container h2 {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--kleur-tekst);
    margin-bottom: 1rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--kleur-rand);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.chart-wrapper {
    position: relative;
    height: 380px;
    width: 100%;
}
.chart-wrapper-pie {
    position: relative;
    height: 320px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

/* === TABEL CONTAINERS === */
.table-container {
    background-color: var(--wit);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--schaduw-sm);
    margin-bottom: 1.5rem;
}
.table-container h2 {
    font-size: 0.9375rem;
    font-weight: 800;
    color: var(--kleur-tekst);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.table-container h3 {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--kleur-tekst);
    margin-bottom: 0.375rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.table-desc {
    font-size: 0.8125rem;
    color: var(--kleur-tekst-hint);
    margin-bottom: 1rem;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}

.table-header-with-sort {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.table-header-with-sort h2 { margin: 0; }

.sort-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.sort-label {
    font-size: 0.6875rem;
    color: var(--kleur-tekst-hint);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sort-btn {
    padding: 0.3125rem 0.75rem;
    background-color: var(--grijs-100);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--kleur-tekst-zacht);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}
.sort-btn:hover { border-color: var(--rood); color: var(--rood); }
.sort-btn.active {
    background-color: var(--rood);
    border-color: var(--rood);
    color: var(--wit);
}

.table-header-with-filter {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    gap: 1rem;
}
.table-header-with-filter h3 { margin: 0 0 0.25rem 0; }
.table-header-with-filter .table-desc { margin: 0; }

.filter-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}
.filter-label {
    font-size: 0.6875rem;
    color: var(--kleur-tekst-hint);
    font-weight: 800;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.filter-input {
    padding: 0.375rem 0.625rem;
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    width: 150px;
    color: var(--kleur-tekst);
    background-color: var(--wit);
    transition: border-color 0.15s;
    font-family: var(--font);
}
.filter-input:focus { outline: none; border-color: var(--rood); }
.btn-filter {
    padding: 0.375rem 0.75rem;
    background-color: var(--rood);
    border: none;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--wit);
    cursor: pointer;
    transition: background-color 0.15s;
    font-family: var(--font);
}
.btn-filter:hover { background-color: var(--rood-donker); }

/* === TABELLEN === */
table {
    width: 100%;
    border-collapse: collapse;
}
table th,
table td {
    padding: 0.5625rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ebebeb;
}
table th {
    background-color: var(--zwart);
    color: rgba(255,255,255,0.85);
    font-weight: 800;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    position: sticky;
    top: 0;
    z-index: 1;
}
table tbody tr:nth-child(even) { background-color: #fafafa; }
table tbody tr:hover { background-color: #fff5f5; }
table td:first-child {
    font-weight: 700;
    color: var(--rood);
}

.compact-table th,
.compact-table td {
    padding: 0.4375rem 0.75rem;
    font-size: 0.875rem;
}

/* === TWEE KOLOMMEN === */
.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* === TYPE BADGES === */
.type-badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.type-badge.radio       { background-color: #dbeafe; color: #1e40af; }
.type-badge.dispatcher  { background-color: #fef3c7; color: #92400e; }
.type-badge.test        { background-color: #ede9fe; color: #5b21b6; }
.type-badge.basestation { background-color: #dcfce7; color: #166534; }
.type-badge.custom      { background-color: #e2e8f0; color: #334155; }

/* === MINI TABS === */
.table-header-with-tabs {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.table-header-with-tabs h2 { margin: 0; }

.mini-tabs { display: flex; gap: 0.25rem; }

.mini-tab-btn {
    padding: 0.3125rem 0.75rem;
    background-color: var(--grijs-100);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--kleur-tekst-zacht);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font);
}
.mini-tab-btn:hover { border-color: var(--rood); color: var(--rood); }
.mini-tab-btn.active {
    background-color: var(--rood);
    border-color: var(--rood);
    color: var(--wit);
}

/* === NETWERK SECTIE === */
.network-section {
    background-color: var(--wit);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--schaduw-sm);
}
.network-section .section-header {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--kleur-tekst);
    margin: 0 0 1rem 0;
    padding-bottom: 0.625rem;
    border-bottom: 2px solid var(--rood);
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.network-section .stats-grid { margin-bottom: 1rem; }
.network-section .stats-grid:last-child { margin-bottom: 0; }
.network-section .subsection {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--kleur-rand);
}
.network-section .subsection-header {
    font-size: 0.6875rem;
    font-weight: 800;
    color: var(--kleur-tekst-hint);
    margin: 0 0 0.75rem 0;
    text-transform: uppercase;
    letter-spacing: 0.07em;
}
.network-section .table-container {
    margin-bottom: 1.25rem;
    padding: 0;
    border: none;
    box-shadow: none;
    border-radius: 0;
}
.network-section .table-container:last-child { margin-bottom: 0; }

/* === SECTIE TITELS === */
.section-divider {
    height: 1px;
    background: var(--kleur-rand);
    margin: 2rem 0 1.5rem;
}

/* === PIEK SELECTOR === */
.peak-selector {
    background-color: var(--wit);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--schaduw-sm);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.peak-selector.hidden { display: none; }
.peak-selector-label {
    font-size: 0.75rem;
    color: var(--kleur-tekst-zacht);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}
.peak-selector-buttons { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.peak-moment-btn {
    padding: 0.4375rem 0.875rem;
    background-color: var(--grijs-100);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--kleur-tekst-zacht);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font);
}
.peak-moment-btn:hover { border-color: var(--rood); color: var(--rood); }
.peak-moment-btn.active {
    background-color: var(--rood);
    border-color: var(--rood);
    color: var(--wit);
}

/* === REEKSEN (RANGES) === */
.ranges-fixed-note {
    background-color: var(--grijs-100);
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    padding: 0.625rem 0.875rem;
    font-size: 0.8rem;
    color: var(--kleur-tekst-zacht);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.range-list-header {
    display: grid;
    grid-template-columns: 80px 80px 1fr 90px 36px;
    gap: 0.375rem;
    padding: 0.4375rem 0.5rem;
    background-color: var(--zwart);
    color: rgba(255,255,255,0.75);
    font-size: 0.5625rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-radius: var(--radius) var(--radius) 0 0;
}

.ranges-list {
    border: 1px solid var(--kleur-rand);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    background-color: var(--wit);
    margin-bottom: 0.625rem;
    min-height: 40px;
}

.range-row {
    display: grid;
    grid-template-columns: 80px 80px 1fr 90px 36px;
    gap: 0.375rem;
    padding: 0.4375rem 0.5rem;
    border-bottom: 1px solid var(--kleur-rand);
    align-items: center;
}
.range-row:last-child { border-bottom: none; }
.range-row:hover { background-color: var(--grijs-100); }

.range-input {
    width: 100%;
    padding: 0.3125rem 0.5rem;
    border: 1px solid var(--kleur-rand);
    border-radius: 4px;
    font-size: 0.8125rem;
    background-color: var(--wit);
    color: var(--kleur-tekst);
    font-family: var(--font-mono);
    transition: border-color 0.15s;
}
.range-input:focus { outline: none; border-color: var(--rood); }

.range-label-input {
    width: 100%;
    padding: 0.3125rem 0.5rem;
    border: 1px solid var(--kleur-rand);
    border-radius: 4px;
    font-size: 0.8125rem;
    background-color: var(--wit);
    color: var(--kleur-tekst);
    font-family: var(--font);
    transition: border-color 0.15s;
}
.range-label-input:focus { outline: none; border-color: var(--rood); }

.range-exclude-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    cursor: pointer;
    font-size: 0.6875rem;
    color: var(--kleur-tekst-zacht);
    font-weight: 700;
    white-space: nowrap;
}
.range-exclude-label input[type="checkbox"] {
    accent-color: var(--rood);
    width: 0.875rem;
    height: 0.875rem;
    cursor: pointer;
}

.range-delete {
    background: none;
    border: 1px solid var(--kleur-rand);
    border-radius: 4px;
    color: var(--grijs-500);
    cursor: pointer;
    font-size: 0.875rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}
.range-delete:hover { border-color: var(--rood); color: var(--rood); background-color: var(--rood-subtiel); }

.range-add-row {
    margin: 0.625rem 0;
}

.ranges-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: var(--kleur-tekst-hint);
    font-size: 0.8125rem;
    font-style: italic;
}

/* === ELEMENTEN VERBORGEN BIJ START === */
#inactive-radios-container,
#peak-calls-container {
    display: none;
}

/* === LAAD STATUS === */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* === DASHBOARD SPECIFIEK === */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-top-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dashboard-top-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.875rem;
}
.dashboard-top-list li:last-child { border-bottom: none; }

.dashboard-rank {
    font-size: 0.6875rem;
    font-weight: 900;
    color: var(--kleur-tekst-hint);
    width: 1.5rem;
    text-align: right;
    flex-shrink: 0;
}
.dashboard-name { flex: 1; font-weight: 600; color: var(--kleur-tekst); }
.dashboard-count {
    font-weight: 800;
    color: var(--rood);
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* === FOOTER === */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--kleur-rand);
    color: var(--kleur-tekst-hint);
    font-size: 0.8125rem;
}

.footer-link {
    color: var(--rood);
    text-decoration: none;
    font-weight: 700;
}
.footer-link:hover { text-decoration: underline; }

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .page-wrapper { padding: 0 1rem 2rem; }
    header { padding: 0 1rem; margin: 0 -1rem 1.5rem; }
    .stats-summary { grid-template-columns: repeat(2, 1fr); }
    .two-column { grid-template-columns: 1fr; }
    .chart-wrapper { height: 280px; }
    table th, table td { padding: 0.4375rem 0.625rem; font-size: 0.875rem; }
    .tab-btn { padding: 0.75rem 0.875rem; font-size: 0.8125rem; }
    .slideover-panel { width: 100%; }
    .alias-import-grid { grid-template-columns: 1fr; }
    .header-subtitle { display: none; }
}

@media (max-width: 480px) {
    .stats-summary { grid-template-columns: repeat(2, 1fr); }
    .stats-grid-4 { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   EXPORT MODAL
   ============================================================ */
.export-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.export-modal-overlay.hidden { display: none; }

.export-modal-panel {
    background: var(--wit);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    width: 100%;
    max-width: 660px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.export-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--zwart);
    border-bottom: 3px solid var(--rood);
    flex-shrink: 0;
}
.export-modal-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--wit);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.export-modal-body {
    padding: 1.25rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.export-section-group {
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
}
.export-section-group-title {
    background: var(--kleur-achtergrond);
    padding: 0.5rem 0.875rem;
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--kleur-tekst-hint);
    border-bottom: 1px solid var(--kleur-rand);
    border-radius: var(--radius) var(--radius) 0 0;
}

.export-field {
    padding: 0.75rem 0.875rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.export-field:last-child { padding-bottom: 0.875rem; }

.export-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 0.75rem;
    padding: 0 0.875rem;
}
.export-field-row .export-field { padding-left: 0; padding-right: 0; }

.export-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--kleur-tekst-hint);
}
.export-input, .export-textarea {
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    padding: 0.5rem 0.625rem;
    font-size: 0.875rem;
    font-family: inherit;
    color: var(--kleur-tekst);
    background: var(--wit);
    transition: border-color 0.15s;
    width: 100%;
    box-sizing: border-box;
}
.export-input:focus, .export-textarea:focus {
    outline: none;
    border-color: var(--rood);
    box-shadow: 0 0 0 2px rgba(192,57,43,0.12);
}
.export-textarea { resize: vertical; min-height: 56px; }

.export-sections-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 0.5rem 0.5rem 0.75rem;
    gap: 0.25rem;
}
.export-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.5rem 0.625rem;
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.1s;
}
.export-check-item:hover { background: var(--kleur-achtergrond); }
.export-check-item input[type="checkbox"] {
    margin-top: 2px;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    accent-color: var(--rood);
    cursor: pointer;
}
.export-check-label { display: flex; flex-direction: column; gap: 1px; }
.export-check-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--kleur-tekst);
}
.export-check-desc {
    font-size: 0.6875rem;
    color: var(--kleur-tekst-hint);
}

.export-modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.25rem;
    background: var(--kleur-achtergrond);
    border-top: 1px solid var(--kleur-rand);
    flex-shrink: 0;
}
.export-status {
    flex: 1;
    font-size: 0.8125rem;
    color: var(--kleur-tekst-hint);
}
.export-status.bezig { color: var(--rood); font-weight: 600; }
.export-status.klaar { color: #15803d; font-weight: 600; }
.export-topn-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem 0.875rem;
    border-top: 1px solid var(--kleur-rand);
    margin-top: 0.25rem;
}

/* === AUTO-DETECT === */
.autodetect-upload-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.autodetect-upload-name {
    font-size: 0.8rem;
    color: var(--kleur-tekst-zacht);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}
.autodetect-textarea {
    width: 100%;
    box-sizing: border-box;
    height: 130px;
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    padding: 0.5rem 0.625rem;
    font-size: 0.8125rem;
    font-family: var(--font-mono);
    color: var(--kleur-tekst);
    background: var(--wit);
    resize: vertical;
    margin-top: 0.5rem;
}
.autodetect-textarea:focus {
    outline: none;
    border-color: var(--rood);
    box-shadow: 0 0 0 2px rgba(192,57,43,0.12);
}
.autodetect-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.625rem;
}
.autodetect-range-check {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--kleur-tekst-zacht);
    cursor: pointer;
}
.autodetect-result {
    margin-top: 1rem;
    border: 1px solid var(--kleur-rand);
    border-radius: var(--radius);
    overflow: hidden;
    font-size: 0.8125rem;
}
.autodetect-result-header {
    background: var(--kleur-achtergrond);
    padding: 0.5rem 0.875rem;
    font-weight: 700;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--kleur-tekst-hint);
    border-bottom: 1px solid var(--kleur-rand);
}
.autodetect-result-body { padding: 0.75rem 0.875rem; display: flex; flex-direction: column; gap: 0.375rem; }
.autodetect-stat { display: flex; gap: 0.5rem; align-items: baseline; }
.autodetect-stat-num { font-size: 1.125rem; font-weight: 800; color: var(--rood); min-width: 2.5rem; text-align: right; }
.autodetect-stat-label { color: var(--kleur-tekst-zacht); }
.autodetect-ranges-preview { margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--kleur-rand); }
.autodetect-ranges-preview-title { font-size: 0.6875rem; font-weight: 700; color: var(--kleur-tekst-hint); text-transform: uppercase; margin-bottom: 0.25rem; }
.autodetect-range-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 99px;
    font-size: 0.6875rem;
    font-weight: 600;
    margin: 0.125rem 0.25rem 0 0;
    background: var(--grijs-100);
    color: var(--grijs-700);
}
.autodetect-confirm {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    justify-content: flex-end;
}
