:root {
    --bg: #f0f2f5; --surface: #ffffff; --surface-hover: #fafbfc;
    --primary: #aa8860; --primary-light: #c4a47a; --primary-bg: #faf6f0; --primary-border: #d4bc9a;
    --dark: #16161e; --dark-light: #2a2a35;
    --text: #1e293b; --text-secondary: #64748b; --text-muted: #94a3b8;
    --border: #e2e8f0; --border-light: #f1f5f9;
    --success: #16a34a; --warning: #d97706; --danger: #dc2626;
    --radius: 10px; --radius-lg: 14px; --radius-sm: 6px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow: 0 4px 16px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 40px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
    --transition: 0.15s ease;
}
/* Login */
#loginOverlay { position:fixed; inset:0; z-index:9999; background:linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 60%, #3a3540 100%); display:flex; align-items:center; justify-content:center; }
#loginOverlay.hidden { display:none; }
.login-card { background:var(--surface); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); padding:48px 40px; text-align:center; max-width:420px; width:100%; }
.login-card h1 { font-size:1.5em; margin-bottom:8px; }
.login-card .subtitle { margin-bottom:28px; }
.login-card .login-btn { display:inline-flex; align-items:center; gap:10px; padding:12px 28px; background:var(--primary); color:#fff; border:none; border-radius:var(--radius); cursor:pointer; font-size:1em; font-weight:600; font-family:inherit; transition:var(--transition); }
.login-card .login-btn:hover { background:var(--primary-light); }
.login-card .login-btn svg { width:20px; height:20px; }
.login-error { color:var(--danger); font-size:0.85em; margin-top:16px; display:none; }
.user-bar { display:flex; align-items:center; gap:10px; justify-content:flex-end; margin-bottom:8px; font-size:0.82em; color:var(--text-secondary); }
.user-bar .user-email { font-weight:600; }
.user-bar .user-role { background:var(--primary-bg); color:var(--primary); padding:2px 8px; border-radius:var(--radius-sm); font-size:0.85em; font-weight:600; }
.user-bar .logout-btn { padding:4px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--surface); cursor:pointer; font-size:0.85em; color:var(--text-secondary); font-family:inherit; }
.user-bar .logout-btn:hover { background:var(--bg); }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); line-height: 1.5; -webkit-font-smoothing: antialiased; }
.container { max-width: 1120px; margin: 0 auto; padding: 24px 20px; }

/* Header */
h1 { text-align: center; color: var(--dark); margin-bottom: 4px; font-size: 1.75em; font-weight: 800; letter-spacing: -0.02em; }
.subtitle { text-align: center; color: var(--text-muted); margin-bottom: 28px; font-size: 0.9em; font-weight: 400; }

/* Cards */
.card {
    background: var(--surface); border-radius: var(--radius-lg); border: 1px solid var(--border);
    padding: 20px 24px; margin-bottom: 16px; transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-sm); }
.card h2 {
    color: var(--text); font-size: 0.95em; font-weight: 700; margin-bottom: 16px;
    padding-bottom: 10px; border-bottom: 1px solid var(--border); text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-group { display: flex; flex-direction: column; }
label { font-weight: 600; margin-bottom: 5px; font-size: 0.8em; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.03em; }
select, input[type="number"] {
    padding: 10px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 0.9em; font-family: inherit; transition: all var(--transition); background: var(--surface);
    color: var(--text);
}
select:focus, input:focus { outline: none; border-color: var(--primary-light); box-shadow: 0 0 0 3px rgba(170,136,96,0.15); }

/* Tabs */
.tabs-bar {
    display: flex; gap: 0; flex-wrap: wrap; align-items: flex-end;
    margin-bottom: 0; border-bottom: 2px solid var(--primary);
    position: sticky; top: 0; z-index: 120; background: var(--bg); padding-top: 4px;
}
.tabs-bar.compact {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    background: rgba(240, 242, 245, 0.96); backdrop-filter: blur(6px);
    box-shadow: 0 6px 14px rgba(0,0,0,0.08); border-bottom-width: 1.5px;
}
.tabs-bar.compact::-webkit-scrollbar { display: none; }
.tabs-bar.compact .tab-btn { padding: 8px 14px; font-size: 0.78em; }
.tabs-bar.compact .tab-add { display: none; }
.tab-btn {
    padding: 10px 22px; border: 1.5px solid var(--border); border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0; background: var(--bg);
    cursor: pointer; font-size: 0.82em; font-weight: 600; font-family: inherit;
    color: var(--text-secondary); transition: all var(--transition);
    position: relative; margin-bottom: -2px;
}
.tab-btn:hover { background: #e8ecf1; color: var(--text); }
.tab-btn.active {
    background: var(--surface); border-color: var(--primary);
    border-bottom: 2px solid var(--surface); color: var(--primary); z-index: 1;
}
.tab-btn.tab-overzicht { font-weight: 700; }
.tab-btn .tab-close { margin-left: 8px; font-size: 0.8em; color: var(--text-muted); cursor: pointer; }
.tab-btn .tab-close:hover { color: var(--danger); }
.tab-add {
    width: 34px; height: 34px; border: 2px dashed var(--border); border-radius: var(--radius-sm);
    background: transparent; cursor: pointer; font-size: 1.2em; color: var(--primary-light);
    display: flex; align-items: center; justify-content: center; transition: all var(--transition);
    margin-left: 6px; margin-bottom: 4px;
}
.tab-add:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.tab-content { padding-top: 16px; }
.section-clear-btn {
    float: right; border: 1px solid var(--border); background: var(--surface);
    color: var(--text-secondary); border-radius: 12px; padding: 3px 10px;
    font-size: 0.75em; cursor: pointer; font-family: inherit;
}
.section-clear-btn:hover { background: var(--surface-hover); border-color: var(--primary-border); color: var(--text); }
.layout-presets-wrap { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.layout-preset-label { font-size: 0.85em; font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.layout-preset-select {
    min-width: 180px; max-width: min(100%, 400px); padding: 6px 10px; font-size: 0.85em;
    border: 1px solid var(--primary-border); border-radius: var(--radius); background: var(--surface);
    color: var(--text); cursor: pointer; font-family: inherit;
}
.layout-preset-select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.layout-preset-empty { color: var(--text-muted); font-size: 0.82em; }

/* Panels */
.panel-config { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; align-items: flex-start; }
.panel-config.scroll-mode { flex-wrap: nowrap; width: max-content; min-width: max-content; }
.panel-layout-top { margin-bottom: 10px; margin-left: 164px; overflow-x: auto; }
.panel-layout-top::-webkit-scrollbar { height: 6px; }
.panel-layout-top::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.panel-layout-editor { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: stretch; }
.panel-height-col, .panel-total-width-row {
    background: var(--surface-hover); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 10px;
}
.panel-height-col { align-self: stretch; height: 100%; }
.panel-height-col label, .panel-total-width-row label {
    margin-bottom: 6px; text-transform: none; letter-spacing: 0; font-size: 0.8em;
}
.panel-height-col input, .panel-total-width-row input { width: 100%; }
.panel-main-col { min-width: 0; overflow-x: auto; }
.panel-total-width-row { max-width: none; width: 100%; margin-bottom: 8px; }
.panel-slot {
    min-width: 130px; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
    text-align: center; font-size: 0.8em; position: relative; background: var(--surface-hover);
    transition: border-color var(--transition);
}
.panel-slot:hover { border-color: var(--primary-border); background: #fff; }
.panel-slot select { width: 100%; font-size: 0.82em; padding: 6px 4px; }
.panel-slot .slot-label { font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); font-size: 0.85em; }
.panel-width-wrap { margin-top: 6px; text-align: left; }
.panel-width-wrap label {
    display: block; margin-bottom: 3px; font-size: 0.72em; font-weight: 600;
    color: var(--text-muted); text-transform: none; letter-spacing: 0;
}
.panel-width-wrap input {
    width: 100%; padding: 6px 8px; font-size: 0.82em;
}
.panel-width-hint { margin-top: 3px; font-size: 0.7em; color: var(--text-muted); }
.panel-option-cost {
    margin-top: 4px; font-size: 0.75em; color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
/* Zelfde typografische schaal als .glass-total-row (Totaal beglazing) */
.panel-opt-summary {
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light);
    line-height: 1.45;
    color: var(--text);
}
.panel-opt-summary-amounts {
    font-size: 0.9em;
}
.panel-opt-summary-title { font-weight: 600; color: #334155; margin-bottom: 6px; }
.panel-opt-summary-list {
    margin: 8px 0 0 1.15em; padding: 0; list-style: disc;
    font-variant-numeric: tabular-nums;
    color: #475569;
}
.panel-opt-summary li { margin: 3px 0; }
.panel-opt-summary .panel-opt-total-line {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    font-weight: 600;
    color: var(--text);
}
.panel-opt-summary .panel-opt-total-line span:last-child {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.panel-opt-totals {
    margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-light);
    display: flex; flex-direction: column; gap: 6px;
}
.panel-opt-total-line-strong { font-weight: 700; }
.panel-opt-summary-empty { margin: 8px 0 0; color: #94a3b8; font-weight: 400; }
.panel-slot .remove-btn {
    position: absolute; top: -8px; right: -8px; width: 20px; height: 20px;
    border-radius: 50%; background: var(--danger); color: #fff; border: 2px solid var(--surface);
    cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); transition: background var(--transition);
}
.panel-slot .remove-btn:hover { background: #b91c1c; }
.add-panel-btn {
    width: 28px; height: 28px; border: 1.5px dashed var(--border); border-radius: 50%;
    background: var(--surface); cursor: pointer; font-size: 1.1em; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center; transition: all var(--transition);
    flex-shrink: 0; align-self: center;
}
.add-panel-btn:hover { border-color: var(--primary-light); background: var(--primary-bg); color: var(--primary); transform: scale(1.15); }
.panel-insert-btn {
    width: 24px; height: 24px; border: 1.5px dashed var(--border); border-radius: 50%;
    background: var(--surface); cursor: pointer; font-size: 1em; color: var(--text-muted);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition); flex-shrink: 0; align-self: center;
    opacity: 1; pointer-events: auto;
}
.panel-insert-btn:hover {
    border-color: var(--primary-light); background: var(--primary-bg);
    color: var(--primary); transform: scale(1.15);
}

/* Glass */
.glass-section { margin-bottom: 12px; padding: 14px; background: var(--surface-hover); border-radius: var(--radius); border: 1px solid var(--border-light); }
.glass-section h3 { font-size: 0.85em; color: var(--text); margin-bottom: 10px; font-weight: 700; }
.glass-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.glass-row label {
    margin-bottom: 0; font-weight: 500; flex: 0 0 190px; width: 190px;
    text-transform: none; font-size: 0.85em; letter-spacing: 0;
}
.glass-row select { flex: 1; }
.glass-price {
    color: var(--text-muted); font-size: 0.82em; flex: 1 1 240px; min-width: 180px; max-width: 460px;
    text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.35;
}
.glass-total-row {
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-light);
    font-size: 0.9em;
}
.glass-total-row .glass-total-line {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600;
}
.glass-total-row .glass-total-debug {
    margin-top: 4px; font-size: 0.78em; color: var(--text-muted); font-weight: 400;
}

/* Options */
.options-list { display: flex; flex-direction: column; gap: 6px; }
.option-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: var(--surface-hover); border-radius: var(--radius); border: 1px solid var(--border-light);
    transition: border-color var(--transition);
}
.option-row:hover { border-color: var(--border-light); background: var(--surface-hover); }
.option-row label { margin-bottom: 0; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 0.88em; }
.opt-label-col { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.opt-img-thumbs { display: flex; gap: 4px; flex-wrap: wrap; }
.opt-img-thumb {
    cursor: pointer; display: inline-block; position: relative;
    width: 80px; height: 50px;
}
.opt-img-thumb img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    border: 1.5px solid var(--border); border-radius: 4px;
    opacity: 0.9; transition: var(--transition);
    object-fit: cover; z-index: 1;
}
.opt-img-thumb:hover img {
    opacity: 1; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    border-color: var(--primary);
}
.opt-img-fallback {
    width: 100%; height: 100%; border: 1.5px solid var(--border); border-radius: 4px;
    background: var(--primary-bg); color: var(--text-secondary); font-size: 0.68em;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    text-align: center; padding: 2px 4px; line-height: 1.2; word-break: break-word;
}
.opt-img-thumb:hover .opt-img-fallback { border-color: var(--primary); color: var(--primary); }
.opt-remark-text {
    display: block; font-size: 0.78em; color: var(--text-secondary);
    line-height: 1.3; margin-top: 2px; font-weight: 400;
}
.option-row input[type="number"] { width: 70px; padding: 6px 8px; }
.option-row .price { color: var(--text-muted); font-size: 0.82em; min-width: 150px; text-align: right; font-weight: 500; white-space: nowrap; }
.option-row .total { color: var(--text-muted); font-size: 0.83em; min-width: 200px; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.option-row.excluded {
    opacity: 0.45;
    background: #f3f4f6;
}
.option-row.excluded input[type="number"],
.option-row.excluded input[type="checkbox"] {
    cursor: not-allowed;
}
.option-row.verplicht {
    background: #eef6ee;
    border-color: #8bc48b;
}
.option-row.verplicht input[type="number"],
.option-row.verplicht input[type="checkbox"] {
    cursor: not-allowed;
}
.panel-rule-badge {
    display: inline-block;
    font-size: 0.7em;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    margin-left: 6px;
    vertical-align: middle;
}
.panel-rule-badge.verplicht { background: #d4edda; color: #155724; }
.panel-rule-badge.uitgesloten { background: #f8d7da; color: #721c24; }
.family-images {
    margin-bottom: 12px;
}
.family-img-strip {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px; width: 100%;
}
.family-img-strip-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.family-img-strip-item.family-img-hidden { display: none; }
.family-img {
    width: 100%; height: 160px; border-radius: var(--radius);
    border: 1px solid var(--border); cursor: pointer;
    transition: var(--transition); object-fit: contain;
    background: var(--surface-hover);
}
.family-img:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.family-img-caption { font-size: 0.82em; color: var(--text-secondary); text-align: center; }
.family-img-show-more {
    display: block; margin: 8px auto 0; padding: 6px 18px;
    font-size: 0.85em; color: var(--primary); background: none;
    border: 1px solid var(--primary); border-radius: var(--radius);
    cursor: pointer; transition: var(--transition);
}
.family-img-show-more:hover { background: var(--primary-bg); }

/* ── Voorbeeldopstelling afbeelding (stap 2) ── */
.layout-preset-image {
    margin-top: 10px; padding: 10px; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.layout-preset-image-wrap {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.layout-preset-image-img {
    max-width: 100%; max-height: 200px; object-fit: contain;
    border-radius: var(--radius); border: 1px solid var(--border);
    cursor: pointer; transition: var(--transition);
}
.layout-preset-image-img:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.layout-preset-image-caption {
    font-size: 0.85em; color: var(--text-secondary); text-align: center;
}
.family-img-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--primary); text-decoration: none; font-size: 0.88em; font-weight: 500;
    transition: var(--transition);
}
.family-img-link:hover { border-color: var(--primary); background: var(--primary-bg); }
.family-dropzone {
    border: 2px dashed var(--border); border-radius: var(--radius);
    padding: 16px 20px; text-align: center; font-size: 0.84em;
    color: var(--text-muted); cursor: pointer; transition: var(--transition);
}
.family-dropzone:hover { border-color: var(--primary-border); color: var(--text-secondary); }
.family-dropzone.dragover { border-color: var(--primary); background: var(--primary-bg); color: var(--primary); }
.family-remark {
    background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius);
    padding: 10px 14px; margin-bottom: 12px; font-size: 0.88em; color: #92400e;
    line-height: 1.5; white-space: pre-wrap;
}
.options-total-row {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border-light);
    font-size: 0.9em; font-weight: 600; color: var(--text);
}
.options-total-row .options-total-val { font-variant-numeric: tabular-nums; }
.panel-options-total-row { margin-top: 10px; width: 100%; background: var(--surface-hover); border-radius: var(--radius); padding: 10px 14px; border: 1px solid var(--border-light); }
.option-excludes-dropdown {
    position: relative;
    min-width: 170px;
}
.option-excludes-dropdown summary {
    cursor: pointer;
    list-style: none;
    font-size: 0.8em;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    padding: 5px 8px;
}
.option-excludes-dropdown summary::-webkit-details-marker { display: none; }
.option-excludes-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 5;
    min-width: 220px;
    max-width: 320px;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.option-excludes-item {
    font-size: 0.78em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* Results */
.results {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow);
}
.results h2 { color: var(--primary); border-bottom-color: rgba(170,136,96,0.3); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.9em; }
.result-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,0.08); font-size: 0.9em; }
.result-row:last-child { border-bottom: none; }
.result-row.indent .result-label { padding-left: 18px; color: rgba(255,255,255,0.65); }
.result-row.total {
    font-size: 1.35em; font-weight: 800; padding-top: 14px;
    border-top: 2px solid rgba(255,255,255,0.2); margin-top: 6px; letter-spacing: -0.01em;
}
.result-row.subtotal { font-weight: 700; }
.result-label { color: rgba(255,255,255,0.75); }
.result-row.total .result-label { color: #fff; }

.merk-crm-wrap { overflow-x: auto; margin: 4px -6px 12px; -webkit-overflow-scrolling: touch; }
.merk-crm-table {
    width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.78em;
    color: rgba(255,255,255,0.92);
}
.merk-crm-table th, .merk-crm-table td {
    padding: 7px 8px; border-bottom: 1px solid rgba(255,255,255,0.1);
    vertical-align: top; text-align: left;
}
.merk-crm-table thead th {
    color: rgba(255,255,255,0.55); font-weight: 600; font-size: 0.92em;
    white-space: nowrap;
}
.merk-crm-table .merk-crm-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.merk-crm-table .merk-crm-om { font-size: 0.95em; color: rgba(255,255,255,0.8); max-width: 280px; }
.merk-crm-table tbody tr.merk-crm-n1 { background: rgba(255,255,255,0.06); font-weight: 600; }
.merk-crm-table .merk-crm-name { font-weight: 500; }
.merk-crm-table .merk-crm-indent { padding-left: 18px; color: rgba(255,255,255,0.75); font-weight: 500; }
.merk-montage-row { margin-top: 4px; border-top: 1px solid rgba(255,255,255,0.12); padding-top: 10px !important; }

/* Summary */
.summary { background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%); color: #fff; box-shadow: var(--shadow); }
.summary-merk {
    display: flex; justify-content: space-between; padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1); font-size: 0.9em;
    cursor: pointer; transition: padding-left var(--transition);
}
.summary-merk:hover { padding-left: 6px; }
.summary-merk:last-child { border-bottom: none; }

.warning {
    background: #fffbeb; border: 1px solid #fbbf24; color: #92400e;
    padding: 10px 14px; border-radius: var(--radius); margin-top: 12px;
    font-size: 0.85em; font-weight: 500; display: none;
}
.warning.visible { display: block; }
.glass-weight-warning { margin-top: 6px; margin-bottom: 6px; padding: 8px 12px; font-size: 0.82em; }
.info-notice {
    background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a;
    padding: 10px 14px; border-radius: var(--radius); margin-top: 12px;
    font-size: 0.85em; font-weight: 500;
}
#beglazingCraneNotice {
    background: #fef2f2;
    border-color: #f87171;
    color: #991b1b;
}

/* Debug panel */
.debug-panel {
    background: #0f172a; color: #22d3ee; font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.75em; border-radius: var(--radius); padding: 16px; margin-top: 16px;
    line-height: 1.7; white-space: pre-wrap; max-height: 500px; overflow-y: auto; display: none;
    border: 1px solid #1e293b;
}
.debug-panel.visible { display: block; }
.debug-panel .dbg-title { color: #facc15; font-weight: bold; font-size: 1.1em; }
.debug-panel .dbg-sub { color: #38bdf8; font-weight: bold; }
.debug-panel .dbg-warn { color: #f87171; }
.debug-panel .dbg-ok { color: #4ade80; }
.debug-panel .dbg-dim { color: #475569; }
.debug-panel .dbg-val { color: #e2e8f0; font-weight: 600; }
.debug-dock-content .dbg-title { color: #facc15; font-weight: bold; font-size: 1.1em; }
.debug-dock-content .dbg-sub { color: #38bdf8; font-weight: bold; }
.debug-dock-content .dbg-warn { color: #f87171; }
.debug-dock-content .dbg-ok { color: #4ade80; }
.debug-dock-content .dbg-dim { color: #475569; }
.debug-dock-content .dbg-val { color: #e2e8f0; font-weight: 600; }
.debug-dock {
    position: fixed; top: 74px; right: 14px; width: 420px; max-width: 38vw;
    height: calc(100vh - 88px); background: #0f172a; border: 1px solid #1e293b;
    border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 980;
    display: none; overflow: hidden;
}
.debug-dock.visible { display: flex; flex-direction: column; }
.debug-dock-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 12px; border-bottom: 1px solid #1e293b; background: #111c33;
    color: #f8fafc; font-size: 0.86em;
}
.debug-dock-switch { display: inline-flex; gap: 6px; }
.debug-dock-switch button {
    border: 1px solid #334155; background: #0f172a; color: #cbd5e1; border-radius: 12px;
    padding: 3px 8px; font-size: 0.76em; cursor: pointer; font-family: inherit;
}
.debug-dock-switch button.active { background: #1e40af; color: #fff; border-color: #1e40af; }
.debug-dock-content {
    padding: 12px; overflow-y: auto; white-space: pre-wrap;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.75em; line-height: 1.7; color: #22d3ee;
}
/* Debug dock is fixed. Laat de rest van de layout onaangeroerd. */
.debug-open .container { padding-right: 0; }
.debug-open .panel-layout-editor { grid-template-columns: 150px 1fr; }
.debug-open .panel-layout-top { margin-left: 164px; }
.debug-open .panel-config { flex-wrap: wrap; width: auto; min-width: 0; }
@media (max-width: 1200px) {
    .debug-dock { width: 360px; max-width: 95vw; height: calc(100vh - 84px); top: 68px; right: 8px; }
    .debug-open .container { padding-right: 0; }
}

/* Step debug panels (inline per stap) */
.step-debug-panel {
    background: #0f172a; color: #22d3ee; font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.75em; border-radius: var(--radius); padding: 14px; margin-top: 14px;
    line-height: 1.7; white-space: pre-wrap; max-height: 350px; overflow-y: auto;
    border: 1px solid #1e293b;
}
.step-debug-panel .dbg-title { color: #facc15; font-weight: bold; font-size: 1.1em; }
.step-debug-panel .dbg-sub { color: #38bdf8; font-weight: bold; }
.step-debug-panel .dbg-warn { color: #f87171; }
.step-debug-panel .dbg-ok { color: #4ade80; }
.step-debug-panel .dbg-dim { color: #475569; }
.step-debug-panel .dbg-val { color: #e2e8f0; font-weight: 600; }

/* Inkoop/verkoop weergave */
.price-inkoop { color: #94a3b8; font-size: 0.85em; }
.price-inkoop::after { content: ' / '; }

/* Prijstabellen overlay */
.prijzen-overlay { display: none; position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,0.6); overflow-y: auto; backdrop-filter: blur(4px); }
.prijzen-overlay.visible { display: block; }
.prijzen-modal {
    background: var(--surface); width: min(96vw, 1700px); max-width: none; margin: 30px auto; border-radius: var(--radius-lg);
    padding: 28px; box-shadow: var(--shadow-lg); position: relative; overflow-x: auto;
}
.prijzen-modal h2 { color: var(--dark); margin-bottom: 16px; font-size: 1.3em; }
.prijzen-close {
    position: absolute; top: 16px; right: 20px; font-size: 1.6em; cursor: pointer;
    color: var(--text-muted); background: none; border: none; line-height: 1; transition: color var(--transition);
}
.prijzen-close:hover { color: var(--danger); }
.prijzen-nav {
    display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px;
    border-bottom: 1px solid var(--border); padding-bottom: 14px;
}
.prijzen-nav-group { display: flex; flex-direction: column; gap: 6px; }
.prijzen-nav-group-title {
    font-size: 0.72em; text-transform: uppercase; letter-spacing: 0.06em;
    color: var(--text-muted); font-weight: 700;
}
.prijzen-nav-group-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.prijzen-nav button {
    padding: 8px 18px; border: 1.5px solid var(--border); border-radius: 20px;
    background: var(--surface); cursor: pointer; font-size: 0.82em; color: var(--text-secondary);
    font-weight: 600; font-family: inherit; transition: all var(--transition);
}
.prijzen-nav button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.prijzen-nav button:hover:not(.active) { background: var(--surface-hover); border-color: var(--primary-border); }
.prijs-admin-toolbar { display:flex; gap:8px; align-items:end; flex-wrap:wrap; margin-bottom:12px; }
.prijs-admin-btn {
    padding: 8px 16px; border: none; border-radius: var(--radius); cursor: pointer;
    font-size: 0.85em; font-weight: 600; font-family: inherit; background: var(--primary); color:#fff;
}
.prijs-admin-btn.success { background: var(--success); }
.prijs-admin-btn.danger { background: var(--danger); }
.prijs-tabel { width: 100%; border-collapse: collapse; font-size: 0.82em; margin-bottom: 16px; }
.opt-drag-handle { cursor: grab; }
.opt-drag-handle:active { cursor: grabbing; }
tr.opt-dragging { opacity: 0.4; }
tr.opt-drop-target { background: var(--primary-bg) !important; box-shadow: inset 0 2px 0 var(--primary); }
.prijzen-modal #prijzenContent { overflow-x: auto; }
.prijzen-modal .prijs-tabel { min-width: max-content; }
.prijs-tabel th {
    background: var(--primary); color: #fff; padding: 7px 8px; text-align: left;
    font-weight: 600; font-size: 0.82em; position: sticky; top: 0; white-space: nowrap;
}
.prijs-tabel th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.prijs-tabel th:last-child { border-radius: 0 var(--radius-sm) 0 0; }
.prijs-tabel td { padding: 4px 6px; border-bottom: 1px solid var(--border-light); font-size: 0.83em; }
.prijs-tabel tr:hover { background: var(--primary-bg); }
.prijs-tabel input[type="number"] {
    width: 78px; padding: 4px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.92em; text-align: right; font-family: inherit; transition: border-color var(--transition);
    -moz-appearance: textfield;
}
.prijs-tabel input[type="number"]::-webkit-inner-spin-button,
.prijs-tabel input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.prijs-tabel input[type="number"]:focus { border-color: var(--primary-light); outline: none; box-shadow: 0 0 0 2px rgba(170,136,96,0.15); }
.prijs-tabel input[type="text"] {
    width: 140px; padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.92em; font-family: inherit;
}
.prijs-tabel .row-key { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.78em; color: var(--text-muted); white-space: nowrap; }
.dim-inp, .sur-inp {
    width: 44px; padding: 2px 3px; border: 1px solid var(--border); border-radius: 3px;
    font-size: 0.88em; text-align: right; font-family: inherit; background: #f7fafc;
}
.dim-inp:focus, .sur-inp:focus { border-color: var(--primary-light); outline: none; background: #fff; }
.dim-inp::-webkit-inner-spin-button, .dim-inp::-webkit-outer-spin-button,
.sur-inp::-webkit-inner-spin-button, .sur-inp::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dim-inp, .sur-inp { -moz-appearance: textfield; }
.sur-sel { width: 62px; padding: 1px 2px; border: 1px solid var(--border); border-radius: 3px; font-size: 0.8em; font-family: inherit; background: #f7fafc; cursor: pointer; }
.sur-sel:focus { border-color: var(--primary-light); outline: none; }
.prijs-tabel-wide th {
    padding: 6px 4px; font-size: 0.7em; text-align: center;
    height: 70px; vertical-align: bottom; white-space: nowrap; position: relative;
}
.prijs-tabel-wide th .th-label {
    display: inline-block; transform: rotate(-45deg); transform-origin: bottom left;
    position: absolute; bottom: 6px; left: 50%; white-space: nowrap;
}
.prijs-tabel-wide th:first-child .th-label { transform: none; position: static; }
.prijs-tabel-wide td { padding: 3px 2px; text-align: center; }
.prijs-tabel-wide td:first-child { text-align: left; }
.prijs-tabel-wide .prijs-input-wrap input { width: 68px; }
.prijzen-gear {
    position: fixed; bottom: 24px; right: 24px; z-index: 999;
    width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff;
    border: none; font-size: 1.4em; cursor: pointer; box-shadow: var(--shadow);
    display: flex; align-items: center; justify-content: center;
    transition: all var(--transition);
}
.prijzen-gear:hover { transform: scale(1.08); background: #1e3a8a; box-shadow: var(--shadow-lg); }
.prijs-save-msg {
    display: inline-block; margin-left: 12px; color: var(--success); font-weight: 600;
    font-size: 0.85em; opacity: 0; transition: opacity 0.3s;
}
.prijs-save-msg.show { opacity: 1; }
.prijs-save-msg.is-pending { color: #2563eb; }
.prijs-save-msg.is-error { color: var(--danger); }
.hist-btn { background:none;border:none;cursor:pointer;font-size:0.82em;padding:2px 4px;color:var(--text-muted);vertical-align:middle;position:relative;transition:color var(--transition); }
.hist-btn.has-hist { color:var(--primary-light); }
.hist-btn:hover { color:var(--primary); }
.hist-popup { position:fixed;z-index:1100;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);padding:0;min-width:320px;max-width:450px;max-height:350px;overflow:hidden; }
.hist-popup .hist-header { display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid var(--border);background:var(--surface-hover);border-radius:var(--radius) var(--radius) 0 0; }
.hist-popup .hist-header h4 { margin:0;font-size:0.82em;color:var(--text);font-weight:600; }
.hist-popup .hist-body { max-height:280px;overflow-y:auto;padding:10px 16px; }
.hist-popup .hist-row { display:flex;justify-content:space-between;align-items:center;padding:6px 0;border-bottom:1px solid var(--border-light);font-size:0.82em; }
.hist-popup .hist-row:last-child { border-bottom:none; }
.hist-popup .hist-old { color:var(--danger);text-decoration:line-through; }
.hist-popup .hist-new { color:var(--success);font-weight:600; }
.hist-popup .hist-date { color:var(--text-muted);font-size:0.88em; }
.hist-popup .hist-empty { color:var(--text-muted);font-style:italic;padding:16px 0;text-align:center; }
.prijs-input-wrap { display:inline-flex;align-items:center;gap:2px; }

/* Test mode */
.test-table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.test-table {
    width: 100%; border-collapse: collapse; font-size: 0.78em; background: var(--surface);
}
.test-table th {
    background: #0f172a; color: #e2e8f0; padding: 10px 8px; text-align: center;
    font-weight: 600; font-size: 0.82em; white-space: nowrap; letter-spacing: 0.02em;
}
.test-filter-row th, .test-filter-row td {
    background: #1e293b; padding: 4px 3px; border-bottom: 2px solid #334155;
}
.test-filter-row select, .test-filter-row input {
    width: 100%; padding: 3px 4px; font-size: 0.78em; border: 1px solid #475569;
    border-radius: 4px; background: #0f172a; color: #e2e8f0; font-family: inherit;
    box-sizing: border-box;
}
.test-filter-row select:focus, .test-filter-row input:focus {
    outline: none; border-color: var(--primary);
}
.test-filter-row .filter-clear {
    cursor: pointer; color: #94a3b8; font-size: 0.75em; text-align: center;
    padding: 2px 4px; border-radius: 3px; background: transparent; border: 1px solid #475569;
    font-family: inherit;
}
.test-filter-row .filter-clear:hover { background: #334155; color: #e2e8f0; }
.test-table td { padding: 6px 6px; border-bottom: 1px solid var(--border-light); text-align: center; vertical-align: middle; }
.test-table tr:nth-child(even) { background: var(--surface-hover); }
.test-table tr:hover { background: var(--primary-bg); }
.test-table input, .test-table select {
    padding: 5px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.92em; text-align: center; font-family: inherit;
}
.test-table input[type="number"] { width: 62px; }
.test-table input[type="text"] { width: 96px; }
.test-table select { width: 68px; }
.test-table .test-panels { width: 140px; font-size: 0.85em; }
.test-table .test-result { font-weight: 700; }
.test-panel-config { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; min-width: 180px; }
.sortable { cursor: pointer; user-select: none; position: relative; }
.sortable:hover { color: var(--primary); }
.sortable::after { content: ' ⇅'; font-size: 0.7em; color: #bbb; }
.sortable.sort-asc::after { content: ' ▲'; color: var(--primary); }
.sortable.sort-desc::after { content: ' ▼'; color: var(--primary); }
.test-panel-block { margin-bottom: 3px; }
.test-panel-chip {
    display: inline-flex; align-items: center; gap: 2px;
    background: var(--primary-bg); border: 1px solid var(--primary-border); border-radius: 4px;
    padding: 2px 5px; font-size: 0.8em; color: var(--primary);
}
.test-panel-chip select {
    border: none; background: transparent; font-size: 0.92em;
    padding: 1px 2px; cursor: pointer; width: auto; text-align: left;
    color: var(--primary); font-family: inherit;
}
.test-panel-chip .chip-expand {
    cursor: pointer; font-size: 0.75em; color: #aaa; margin-left: 1px;
    user-select: none; transition: color 0.15s; padding: 0 2px;
}
.test-panel-chip .chip-expand:hover { color: var(--primary); }
.test-panel-chip .chip-expand.has-opts { color: #c05621; }
.test-panel-chip .chip-del {
    cursor: pointer; color: var(--text-muted); font-size: 1em; line-height: 1;
    margin-left: 1px; padding: 0 2px; transition: color var(--transition);
}
.test-panel-chip .chip-del:hover { color: var(--danger); }
.test-panel-opts {
    margin: 1px 0 2px 8px; padding: 3px 6px;
    background: #f8f9fa; border-left: 2px solid var(--primary-border);
    font-size: 0.72em; display: flex; flex-direction: column; gap: 2px;
}
.test-panel-opts label {
    display: flex; align-items: center; gap: 4px; cursor: pointer;
    color: #555; white-space: nowrap;
}
.test-panel-opts input[type="checkbox"] { margin: 0; cursor: pointer; }
.test-panel-opts input[type="number"] {
    width: 40px; padding: 1px 3px; border: 1px solid #ccc; border-radius: 3px;
    font-size: 1em;
}
.test-panel-add {
    width: 22px; height: 22px; border: 1.5px dashed var(--text-muted); border-radius: 4px;
    background: none; color: var(--primary-light); cursor: pointer; font-size: 1em;
    display: inline-flex; align-items: center; justify-content: center; transition: all var(--transition);
}
.test-panel-add:hover { border-color: var(--primary-light); background: var(--primary-bg); }
.test-opties-cell { min-width: 120px; }
.test-opties-wrap { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.test-opt-chip {
    display: inline-flex; align-items: center; gap: 2px;
    padding: 1px 5px; border-radius: 3px; font-size: 0.7em;
    cursor: pointer; user-select: none; transition: all 0.15s;
    background: #f0f0f0; color: #888; border: 1px solid #ddd;
}
.test-opt-chip:hover { border-color: #999; color: #555; }
.test-opt-chip.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-border); font-weight: 600; }
.test-opt-summary { font-size: 0.85em; color: #c05621; }
.test-table .test-ok { color: var(--success); font-weight: 700; }
.test-table .test-warn { color: var(--warning); font-weight: 600; }
.test-table .test-bad { color: var(--danger); font-weight: 700; }
.test-table .test-glas-miss { color: #b45309; font-weight: 600; background: #fffbeb; }
.test-table .test-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 1.1em; transition: color var(--transition); }
.test-table .test-del:hover { color: var(--danger); }
.test-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.test-bar button {
    padding: 8px 18px; border: none; border-radius: 20px; cursor: pointer;
    font-size: 0.82em; font-weight: 600; font-family: inherit; transition: all var(--transition);
}
.test-btn-add { background: var(--primary); color: #fff; }
.test-btn-add:hover { background: #8a6d4a; }
.test-btn-clear { background: var(--border); color: var(--text-secondary); }
.test-btn-clear:hover { background: #cbd5e1; }
.test-summary {
    display: flex; gap: 0; margin-top: 14px;
    background: var(--surface); border-radius: var(--radius); font-size: 0.88em;
    border: 1px solid var(--border); overflow: hidden;
}
.test-summary .stat {
    display: flex; flex-direction: column; align-items: center; flex: 1;
    padding: 14px 12px; border-right: 1px solid var(--border);
}
.test-summary .stat:last-child { border-right: none; }
.test-summary .stat-val { font-size: 1.5em; font-weight: 800; letter-spacing: -0.02em; }
.test-summary .stat-label { font-size: 0.72em; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px; }

/* Input validation */
input:invalid { border-color: var(--danger) !important; }
input[type="number"]::-webkit-inner-spin-button { opacity: 1; }

/* Smooth transitions on interactive elements */
.card { transition: box-shadow var(--transition), transform var(--transition); }
.option-row { transition: border-color var(--transition), background var(--transition); }

/* Better focus styles for accessibility */
select:focus-visible, input:focus-visible, button:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== TABLET ===== */
@media (max-width: 768px) {
    .container { max-width: 100%; padding: 20px 16px; }
    h1 { font-size: 1.5em; }
    .panel-layout-editor { grid-template-columns: 130px minmax(0, 1fr); }
    .panel-layout-top { margin-left: 144px; }
    .panel-total-width-row { min-width: 240px; }
    .panel-config { flex-wrap: nowrap; width: max-content; min-width: max-content; }
    .prijzen-modal { margin: 16px; padding: 20px; }
    .test-bar { flex-direction: column; align-items: stretch; }
    .test-bar button { width: 100%; }
    .test-bar label { width: 100%; display: flex; justify-content: space-between; }
}

/* ===== MOBILE ===== */
@media (max-width: 600px) {
    :root { --radius: 8px; --radius-lg: 10px; }
    .container { padding: 12px 10px; }
    h1 { font-size: 1.3em; margin-bottom: 2px; }
    .subtitle { font-size: 0.82em; margin-bottom: 16px; }

    /* Login */
    .login-card { padding: 32px 24px; margin: 12px; }
    .login-card h1 { font-size: 1.25em; }

    /* User bar */
    .user-bar { flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 0.78em; margin-bottom: 12px; }

    /* Tabs - horizontaal scrollbaar */
    .tabs-bar { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; gap: 0; }
    .tabs-bar::-webkit-scrollbar { display: none; }
    .tab-btn { padding: 8px 14px; font-size: 0.78em; white-space: nowrap; flex-shrink: 0; }
    .tab-add { width: 30px; height: 30px; flex-shrink: 0; }

    /* Cards */
    .card { padding: 14px 14px; margin-bottom: 12px; }
    .card h2 { font-size: 0.85em; margin-bottom: 12px; padding-bottom: 8px; }

    /* Forms */
    .form-grid { grid-template-columns: 1fr; gap: 10px; }
    select, input[type="number"], input[type="text"] { padding: 10px 12px; font-size: 1em; }

    /* Paneel indeling */
    .panel-layout-top { margin-bottom: 8px; }
    .panel-layout-editor { grid-template-columns: 120px minmax(0, 1fr); }
    .panel-layout-top { margin-left: 134px; }
    .panel-config { gap: 8px; flex-wrap: nowrap; width: max-content; min-width: max-content; }
    .panel-slot { min-width: 85px; padding: 10px; font-size: 0.78em; }
    .panel-slot select { font-size: 0.85em; padding: 6px 4px; }
    .add-panel-btn { min-width: 44px; height: 68px; }

    /* Glass */
    .glass-section { padding: 10px; }
    .glass-row { flex-wrap: wrap; gap: 6px; align-items: flex-start; }
    .glass-row label {
        min-width: 0;
        width: 100%;
        flex: 0 0 auto;
        flex-basis: auto;
        max-width: 100%;
        margin-bottom: 0;
    }
    .glass-row select { width: 100%; flex: 1 1 auto; min-width: 0; max-width: 100%; }
    .glass-price { min-width: 0; flex: 1 1 auto; max-width: 100%; text-align: left; width: 100%; }

    /* Options */
    .option-row { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
    .option-row { align-items: flex-start; }
    .opt-label-col { flex: 1 1 100%; width: 100%; min-width: 0; }
    .option-row label { width: auto; min-width: 0; font-size: 0.85em; }
    .opt-remark-text { font-size: 0.76em; }
    .opt-img-thumbs { margin-top: 4px; }
    .opt-img-thumb { width: 70px; height: 44px; }
    .option-row .price { min-width: 0; flex: 1 1 auto; text-align: left; font-size: 0.8em; }
    .option-row .total { min-width: 0; flex: 1 1 auto; }
    .option-row input[type="number"] { width: 60px; }

    /* Results */
    .results { padding: 16px; }
    .result-row { font-size: 0.85em; padding: 7px 0; }
    .result-row.total { font-size: 1.15em; }

    /* Summary overzicht */
    .summary-merk { font-size: 0.85em; }

    /* Merk-overzicht tabel (onderaan) */
    .merk-crm-wrap { margin: 0 0 12px 0; }
    .merk-crm-table { min-width: 0; font-size: 0.72em; }
    .merk-crm-table th, .merk-crm-table td { padding: 6px 6px; }
    .merk-crm-indent { padding-left: 12px; }

    /* CRM overlay */
    #crmOverlay .prijzen-modal { margin: 8px; padding: 16px; }

    /* Prijzen overlay */
    .prijzen-modal { margin: 8px; padding: 16px; }
    .prijzen-gear { width: 42px; height: 42px; font-size: 1.2em; bottom: 16px; right: 16px; }
    .prijs-tabel { font-size: 0.72em; }
    .prijs-tabel th, .prijs-tabel td { padding: 5px 6px; }
    .prijs-tabel input[type="number"] { width: 68px; }
    .prijzen-nav { gap: 6px; }
    .prijzen-nav button { padding: 6px 12px; font-size: 0.78em; }

    /* Test section */
    .test-section { font-size: 0.85em; }
    .test-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .test-summary { flex-wrap: wrap; }
    .test-summary .stat { min-width: 33%; border-bottom: 1px solid var(--border); }
    .test-summary .stat-val { font-size: 1.2em; }

    /* Kopieer knop */
    [onclick="duplicateMerk(activeMerkIndex)"] { width: 100%; justify-content: center; }

    /* CRM export knop */
    #summaryCard button { font-size: 0.85em; padding: 12px 16px; }
}

/* ===== SMALL MOBILE ===== */
@media (max-width: 380px) {
    .container { padding: 10px 8px; }
    h1 { font-size: 1.15em; }
    .card { padding: 12px 10px; }
    .panel-slot { min-width: 75px; padding: 8px; }
    .tab-btn { padding: 7px 10px; font-size: 0.72em; }
    .login-card { padding: 24px 16px; }
}
