/* ═══════════════════════════════════════════════
   BKG EnergiePlanner — Component Styles
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════
   RADIO CARD SELECTOR
   ═══════════════════════════════════════ */
.radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}

.radio-card {
    cursor: pointer;
    position: relative;
}

.radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.radio-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem 0.5rem;
    border-radius: var(--radius);
    border: 2px solid var(--card-border);
    background: rgba(0, 0, 0, 0.15);
    transition: all 0.25s ease;
    text-align: center;
    min-height: 80px;
    height: 100%;
    box-sizing: border-box;
}

.radio-card-inner:hover {
    border-color: rgba(0, 170, 255, 0.35);
    background: rgba(0, 170, 255, 0.04);
    transform: translateY(-2px);
}

.radio-card input:checked + .radio-card-inner {
    border-color: var(--primary);
    background: rgba(0, 170, 255, 0.1);
    box-shadow: 0 0 16px rgba(0, 170, 255, 0.15), inset 0 0 0 1px rgba(0, 170, 255, 0.2);
}

.radio-card input:checked + .radio-card-inner .rc-label {
    color: var(--primary);
    font-weight: 600;
}

.radio-card .rc-icon {
    font-size: 1.5rem;
    margin-bottom: 0;
    line-height: 1;
}

.radio-card .rc-icon .woning-svg {
    width: 52px;
    height: 36px;
    color: var(--text-muted);
    transition: color 0.25s ease;
}

.radio-card input:checked + .radio-card-inner .rc-icon .woning-svg {
    color: var(--primary);
}

.radio-card .rc-icon-svg svg {
    width: 38px;
    height: 38px;
    color: var(--text-muted);
    transition: color 0.25s ease;
}
.radio-card input:checked + .radio-card-inner .rc-icon-svg svg {
    color: var(--primary);
}

.radio-card .rc-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.3;
    transition: all 0.25s ease;
}

.radio-card .rc-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ═══════════════════════════════════════
   THREE-WAY TOGGLE (Ja/Nee/Maakt niet uit)
   ═══════════════════════════════════════ */
.three-way-toggle {
    display: flex;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

.three-way-toggle label {
    flex: 1;
    position: relative;
    text-align: center;
    display: flex;
}

.three-way-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.three-way-toggle .tw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    border-right: 1px solid var(--card-border);
}

.three-way-toggle label:last-child .tw-btn {
    border-right: none;
}

.three-way-toggle .tw-btn:hover {
    background: rgba(0, 170, 255, 0.06);
    color: var(--text-main);
}

.three-way-toggle input:checked + .tw-btn {
    background: rgba(0, 170, 255, 0.15);
    color: var(--primary);
    font-weight: 600;
}

/* ── Light theme overrides ── */
[data-theme="light"] .three-way-toggle {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

[data-theme="light"] .three-way-toggle .tw-btn {
    color: #64748b;
    border-right-color: #e2e8f0;
}

[data-theme="light"] .three-way-toggle .tw-btn:hover {
    background: rgba(0, 130, 220, 0.06);
    color: #334155;
}

[data-theme="light"] .three-way-toggle input:checked + .tw-btn {
    background: #dbeafe;
    color: #1d4ed8;
    font-weight: 600;
    box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.3);
}

/* ═══════════════════════════════════════
   ENERGY BALANCE BAR
   ═══════════════════════════════════════ */
.energy-balance {
    display: flex;
    gap: 0.25rem;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 0.75rem 0;
    background: rgba(0, 0, 0, 0.3);
}

.energy-bar-consumption {
    background: linear-gradient(90deg, #ef4444, #f97316);
    transition: width 0.5s ease;
}

.energy-bar-pv {
    background: linear-gradient(90deg, #22c55e, #86efac);
    transition: width 0.5s ease;
}

.energy-legend {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.82rem;
}

.energy-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.energy-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.energy-legend-dot.consumption {
    background: #ef4444;
}

.energy-legend-dot.pv {
    background: #22c55e;
}

/* ═══════════════════════════════════════
   CHART LEGEND
   ═══════════════════════════════════════ */
.chart-legend {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════
   PROFILE CHART (canvas placeholder)
   ═══════════════════════════════════════ */
.profile-chart-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1rem;
    margin: 0.5rem 0;
    position: relative;
    overflow: hidden;
}

.profile-chart-wrapper canvas {
    width: 100% !important;
    height: 220px;
}

/* ═══════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.empty-state p {
    font-size: 0.9rem;
}

/* ═══════════════════════════════════════
   LOADING SPINNER
   ═══════════════════════════════════════ */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════
   REPORT STYLES
   ═══════════════════════════════════════ */
.report-page {
    background: #fff;
    color: #1a1a1a;
    max-width: 210mm;
    margin: 0 auto;
    padding: 20mm;
    font-family: var(--font-body);
    line-height: 1.6;
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid #00aaff;
    margin-bottom: 2rem;
}

.report-header h1 {
    color: #00aaff;
    font-size: 1.8rem;
    margin-bottom: 0.25rem;
}

.report-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: invert(1);
}

.report-header .report-date {
    color: #666;
    font-size: 0.85rem;
}

.report-section {
    margin-bottom: 2rem;
    page-break-inside: avoid;
}

.report-section h2 {
    color: #00aaff;
    font-size: 1.15rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 1rem;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.report-table th,
.report-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.88rem;
}

.report-table th {
    color: #666;
    font-weight: 500;
    width: 40%;
}

.report-table td {
    font-weight: 600;
}

.report-highlight {
    background: #f0f9ff;
    border: 1px solid #bfe3ff;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
}

.report-highlight h3 {
    color: #0077cc;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.report-footer {
    margin-top: 3rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
    font-size: 0.78rem;
    color: #888;
    text-align: center;
}

/* ═══════════════════════════════════════
   REPORT IN DARK MODE (screen view)
   ═══════════════════════════════════════ */
.report-preview-wrapper {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 0;
    overflow: hidden;
}

/* Override report colors when inside dark wizard */
.wizard-container .report-page {
    border-radius: var(--radius);
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
}

/* ═══════════════════════════════════════
   PRINT REPORT OVERRIDE
   ═══════════════════════════════════════ */
@media print {
    .report-page {
        padding: 15mm;
        box-shadow: none;
        max-width: 100%;
    }

    .report-section {
        page-break-inside: avoid;
    }

    .report-header {
        page-break-after: avoid;
    }
}

/* ═══════════════════════════════════════
   RESPONSIVE RADIO CARDS
   ═══════════════════════════════════════ */
@media (max-width: 768px) {
    .radio-cards {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .radio-card-inner {
        padding: 0.75rem 0.5rem;
    }

    .three-way-toggle .tw-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.78rem;
    }
}

/* ═══════════════════════════════════════
   GPS BUTTON & STATUS
   ═══════════════════════════════════════ */
.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.card-title-row .card-title {
    margin-bottom: 0;
}

.btn-gps {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid rgba(0, 170, 255, 0.3);
    border-radius: var(--radius-sm);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-gps:hover {
    background: rgba(0, 170, 255, 0.18);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-gps:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-gps.loading .gps-label::after {
    content: '...';
    animation: dots 1.2s steps(3, end) infinite;
}

.btn-gps svg {
    width: 16px;
    height: 16px;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

.gps-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease;
}

.gps-status.loading {
    background: rgba(0, 170, 255, 0.08);
    border: 1px solid rgba(0, 170, 255, 0.2);
    color: var(--primary);
}

.gps-status.success {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.gps-status.error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.gps-status svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.spin {
    animation: spin 1s linear infinite;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════
   READONLY FIELD & FIELD HINT
   ═══════════════════════════════════════ */
.readonly-field {
    opacity: 0.7;
    cursor: default;
    background: rgba(0, 0, 0, 0.15) !important;
}

.field-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.6;
}

/* ═══════════════════════════════════════
   MODAL OVERLAY
   ═══════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.25s ease;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    width: 94%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

.modal-header h2 {
    font-size: 1.15rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

.modal-header h2 svg {
    width: 20px;
    height: 20px;
    color: var(--primary);
}

.modal-close {
    width: 32px;
    height: 32px;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

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

/* ═══════════════════════════════════════
   PROJECT LIST & CARDS
   ═══════════════════════════════════════ */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    transition: var(--transition);
}

.project-card:hover {
    border-color: rgba(0, 170, 255, 0.3);
    background: rgba(0, 170, 255, 0.04);
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.35rem;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
}

.project-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.project-meta svg {
    width: 12px;
    height: 12px;
    opacity: 0.6;
}

.project-saved-at {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.5;
    margin-top: 0.25rem;
}

.project-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════
   SMALL BUTTONS
   ═══════════════════════════════════════ */
.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-sm svg {
    width: 14px;
    height: 14px;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    cursor: pointer;
    transition: var(--transition);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.22);
    border-color: #ef4444;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.btn-ghost:hover {
    background: rgba(0, 170, 255, 0.08);
    border-color: rgba(0, 170, 255, 0.3);
    color: var(--primary);
}

/* ═══════════════════════════════════════
   HEADER SAVE ANIMATION
   ═══════════════════════════════════════ */
.btn-icon.saved {
    border-color: #22c55e;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
}

/* ═══════════════════════════════════════
   MODAL EMPTY STATE
   ═══════════════════════════════════════ */
.modal-body .empty-state {
    padding: 3rem 1rem;
}

.modal-body .empty-state svg {
    width: 56px;
    height: 56px;
}

/* ═══════════════════════════════════════
   RESPONSIVE MODAL
   ═══════════════════════════════════════ */
@media (max-width: 480px) {
    .modal-content {
        width: 98%;
        max-height: 92vh;
        border-radius: var(--radius);
    }

    .modal-actions {
        flex-direction: column;
    }

    .project-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .project-actions {
        width: 100%;
    }

    .project-actions .btn-sm {
        flex: 1;
        justify-content: center;
    }
}

/* ═══════════════════════════════════════
   CSV EXPORT BUTTON & MODAL
   ═══════════════════════════════════════ */
.btn-export {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--electric);
    background: rgba(0, 170, 255, 0.08);
    color: var(--electric);
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.02em;
}

.btn-export:hover {
    background: rgba(0, 170, 255, 0.18);
    box-shadow: 0 0 12px rgba(0, 170, 255, 0.3);
    transform: translateY(-1px);
}

.btn-export svg {
    width: 14px;
    height: 14px;
}

/* ─── Modal Overlay ─── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-box {
    background: var(--card-bg, #1e293b);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.25s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary, #f1f5f9);
    margin-bottom: 0.5rem;
}

.modal-header svg {
    width: 18px;
    height: 18px;
    color: var(--electric);
    margin-right: 0.4rem;
    vertical-align: middle;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--text-primary, #f1f5f9);
}

.modal-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

/* ─── Export Options Grid ─── */
.export-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.export-option {
    cursor: pointer;
    position: relative;
}

.export-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.export-option-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1rem 0.5rem;
    border-radius: 10px;
    border: 1.5px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.2s ease;
    text-align: center;
}

.export-option-inner svg {
    width: 22px;
    height: 22px;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.export-option-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary, #f1f5f9);
}

.export-option-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.export-option-inner:hover {
    border-color: rgba(0, 170, 255, 0.25);
    background: rgba(0, 170, 255, 0.04);
}

.export-option input:checked + .export-option-inner {
    border-color: var(--electric);
    background: rgba(0, 170, 255, 0.1);
    box-shadow: 0 0 16px rgba(0, 170, 255, 0.15);
}

.export-option input:checked + .export-option-inner svg {
    color: var(--electric);
}

.export-option input:checked + .export-option-inner .export-option-title {
    color: var(--electric);
}

/* ─── Format Toggle (Excel / CSV) ─── */
.format-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.format-option {
    flex: 1;
    cursor: pointer;
    position: relative;
}

.format-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.format-option-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.format-option-inner svg {
    width: 16px;
    height: 16px;
}

.format-option-inner:hover {
    border-color: rgba(0, 170, 255, 0.2);
    background: rgba(0, 170, 255, 0.03);
}

.format-option input:checked + .format-option-inner {
    border-color: var(--electric);
    background: rgba(0, 170, 255, 0.12);
    color: var(--electric);
    box-shadow: 0 0 12px rgba(0, 170, 255, 0.15);
}

.format-option input:checked + .format-option-inner svg {
    color: var(--electric);
}

/* ─── Input with Hint Button ─── */
.input-with-hint {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.input-with-hint input {
    flex: 1;
}

.btn-hint {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-hint:hover {
    border-color: var(--electric);
    color: var(--electric);
    background: rgba(0, 170, 255, 0.06);
}

.btn-hint svg {
    width: 13px;
    height: 13px;
}

.field-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.field-hint strong {
    color: var(--electric);
    font-weight: 600;
}

/* ─── EV Specs Bar ─── */
.ev-specs-bar {
    display: flex;
    gap: 1rem;
    margin: 0.75rem 0;
    padding: 0.65rem 1rem;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 8px;
}

.ev-spec {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.ev-spec-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ev-spec-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #22c55e;
}

/* ─── Chart View Toggle (Apart / Totaal) ─── */
.chart-view-toggle {
    display: flex;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
}

.chart-view-btn {
    padding: 0.25rem 0.65rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chart-view-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.06);
}

.chart-view-btn.active {
    background: var(--electric);
    color: #fff;
    font-weight: 600;
}

/* ─── Fase filter knoppen ─── */
.wpc-fase-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
}

.wpc-fase-btn:hover {
    border-color: rgba(0, 170, 255, 0.4);
    color: var(--text-primary);
    background: rgba(0, 170, 255, 0.06);
}

.wpc-fase-btn.active {
    background: rgba(0, 170, 255, 0.15);
    border-color: var(--electric);
    color: var(--electric);
    font-weight: 600;
}


.wp-modus-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid var(--card-border);
}

.wp-modus-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wp-modus-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.04);
}

.wp-modus-btn.active {
    background: rgba(0, 170, 255, 0.15);
    color: var(--electric);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.15);
}

.wp-modus-btn svg {
    width: 16px;
    height: 16px;
}

/* Badge header */
.wp-calc-badge-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--electric);
    background: rgba(0, 170, 255, 0.06);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 170, 255, 0.15);
}

.wp-calc-badge-header svg {
    width: 14px;
    height: 14px;
}

/* Floor grid */
.wp-floor-grid {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.wp-floor-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
}

.wp-floor-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 110px;
}

.wp-floor-field {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex: 1;
}

.wp-floor-field label {
    font-size: 0.68rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.wp-floor-field input {
    padding: 0.35rem 0.5rem;
    font-size: 0.82rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    width: 100%;
    transition: border-color 0.2s;
}

.wp-floor-field input:focus {
    outline: none;
    border-color: var(--electric);
}

/* Isolatie grid */
.wp-isolatie-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wp-iso-field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.wp-iso-field label {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.wp-iso-field select {
    padding: 0.4rem 0.5rem;
    font-size: 0.78rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.wp-iso-field select:focus {
    outline: none;
    border-color: var(--electric);
}

/* Afgiftesysteem */
.wp-afgifte-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
}

.wp-afgifte-toggles {
    display: flex;
    gap: 0.35rem;
    flex: 1;
}

.wp-afgifte-btn {
    flex: 1;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.15);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.wp-afgifte-btn:hover {
    border-color: rgba(0, 170, 255, 0.3);
    background: rgba(0, 170, 255, 0.04);
}

.wp-afgifte-btn.selected {
    border-color: var(--electric);
    background: rgba(0, 170, 255, 0.12);
    color: var(--electric);
    font-weight: 600;
}

/* Result badge bar */
.wp-calc-result {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.08) 0%, rgba(34, 197, 94, 0.06) 100%);
    border: 1px solid rgba(0, 170, 255, 0.2);
    border-radius: 10px;
    margin-top: 0.75rem;
    animation: fadeSlideIn 0.3s ease;
}

.wp-calc-result-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.25rem 0;
}

.wp-calc-result-item + .wp-calc-result-item {
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.wp-calc-result-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.wp-calc-result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--electric);
    font-family: 'Outfit', sans-serif;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .wp-modus-toggle {
        flex-direction: column;
    }

    .wp-isolatie-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wp-floor-row {
        flex-wrap: wrap;
    }

    .wp-floor-name {
        min-width: 100%;
    }

    .wp-calc-result {
        flex-direction: column;
    }

    .wp-calc-result-item + .wp-calc-result-item {
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding-top: 0.5rem;
    }

    .wp-afgifte-toggles {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════
   VERBRUIKSOVERZICHT TOTALS
   ═══════════════════════════════════════ */
.overview-totals {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.overview-total-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.overview-total-item:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.overview-total-item.total {
    grid-column: 1 / -1;
    border-color: rgba(0, 170, 255, 0.3);
    background: rgba(0, 170, 255, 0.06);
}

.overview-total-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.overview-total-icon svg {
    width: 20px;
    height: 20px;
}

.overview-total-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.overview-total-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.1rem;
}

/* ═══════════════════════════════════════
   STEP 3 — PV TAB SWITCHER
   ═══════════════════════════════════════ */
.pv-tabs {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 1.25rem;
}

.pv-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.6rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pv-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.pv-tab-btn.active {
    background: rgba(0, 170, 255, 0.12);
    color: var(--primary);
    font-weight: 600;
}

.pv-tab-btn svg {
    width: 16px;
    height: 16px;
}

.pv-tab-content {
    display: none;
}

.pv-tab-content.active {
    display: block;
}

/* ═══════════════════════════════════════
   PANEEL PLAATSER
   ═══════════════════════════════════════ */
.pp-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Phase Navigation ── */
.pp-phase-nav {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 0.35rem 0.5rem;
    overflow-x: auto;
}

.pp-phase-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pp-phase-btn:hover:not(.disabled) {
    background: rgba(0, 170, 255, 0.06);
    color: var(--text-primary);
}

.pp-phase-btn.active {
    background: rgba(0, 170, 255, 0.12);
    color: var(--primary);
    font-weight: 600;
}

.pp-phase-btn.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pp-phase-btn svg {
    width: 14px;
    height: 14px;
}

.pp-phase-num {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(128, 128, 128, 0.15);
    font-size: 0.68rem;
    font-weight: 700;
}

.pp-phase-btn.active .pp-phase-num {
    background: var(--primary);
    color: #fff;
}

.pp-phase-sep {
    color: var(--card-border);
    display: flex;
    align-items: center;
    padding: 0 0.15rem;
}

.pp-phase-sep svg {
    width: 12px;
    height: 12px;
    opacity: 0.4;
}

/* ── Upload Zone ── */
.pp-upload-zone {
    position: relative;
    border: 2px dashed var(--card-border);
    border-radius: var(--radius);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.pp-upload-zone:hover,
.pp-upload-zone.dragover {
    border-color: var(--primary);
    background: rgba(0, 170, 255, 0.04);
}

.pp-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
    text-align: center;
}

.pp-upload-placeholder svg {
    width: 48px;
    height: 48px;
    opacity: 0.3;
}

.pp-upload-hint {
    font-size: 0.72rem;
    opacity: 0.5;
}

.pp-upload-preview {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--radius);
}

.pp-upload-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.pp-upload-zone:hover .pp-upload-overlay {
    opacity: 1;
}

.pp-upload-overlay svg {
    width: 20px;
    height: 20px;
}

/* ── Corner Status Chips ── */
.pp-corner-status {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.pp-corner-chip {
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-muted);
    border: 1px solid transparent;
}

.pp-corner-chip.done {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.pp-corner-chip.next {
    background: rgba(0, 170, 255, 0.12);
    color: var(--primary);
    border-color: rgba(0, 170, 255, 0.3);
    animation: pulse-chip 1.2s ease-in-out infinite;
}

@keyframes pulse-chip {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 170, 255, 0.2); }
    50% { box-shadow: 0 0 0 4px rgba(0, 170, 255, 0); }
}

/* ── Canvas Wrapper ── */
.pp-canvas-wrap {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--card-border);
    background: #0a0e17;
}

.pp-canvas-wrap canvas {
    display: block;
    width: 100%;
    cursor: crosshair;
}

.pp-place-wrap canvas {
    cursor: pointer;
}

/* ── Measurement Result ── */
.pp-measurement-result {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.75rem;
    background: rgba(0, 170, 255, 0.04);
    border: 1px solid rgba(0, 170, 255, 0.12);
    border-radius: var(--radius);
}

.pp-meas-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pp-meas-item span {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pp-meas-item strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.pp-meas-item.highlight strong {
    color: var(--primary);
    font-size: 1.15rem;
}

/* ── Config Card ── */
.pp-config-card .card-title {
    margin-bottom: 0.5rem;
}

.pp-config-body {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    max-height: 600px;
    opacity: 1;
    overflow: hidden;
}

.pp-config-body.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* ── Active group / mask indicator ── */
.pp-active-group-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.4rem 0.5rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
}

.pp-active-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
}

.pp-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.pp-group-chip:hover {
    opacity: 0.85;
    transform: scale(1.03);
}

.pp-group-chip.active {
    box-shadow: 0 0 8px currentColor;
    opacity: 1;
}

/* ── Toolbar ── */
.pp-toolbar {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pp-tool-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.pp-tool-btn svg {
    width: 14px;
    height: 14px;
}

.pp-tool-btn:hover {
    background: rgba(0, 170, 255, 0.06);
    border-color: rgba(0, 170, 255, 0.3);
    color: var(--primary);
}

.pp-tool-btn.active {
    background: rgba(0, 170, 255, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.pp-tool-btn.active-green {
    background: rgba(34, 197, 94, 0.12);
    border-color: #22c55e;
    color: #22c55e;
}

.pp-tool-btn.danger:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ── Mode Indicator ── */
.pp-mode-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 500;
}

.pp-mode-indicator svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.pp-mode-indicator.green {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.pp-mode-indicator.blue {
    background: rgba(0, 170, 255, 0.06);
    border: 1px solid rgba(0, 170, 255, 0.15);
    color: var(--text-muted);
}

.pp-tool-btn.active-orange {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
    color: #ef4444;
}

.pp-mode-indicator.orange {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ── Exclusion zone chips ── */
.pp-excl-list {
    padding: 0.5rem 0.75rem;
}

.pp-excl-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #ef4444;
}

.pp-excl-chip button {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity 0.15s;
}

.pp-excl-chip button:hover {
    opacity: 1;
}

/* ── Stats Bar ── */
.pp-stats {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pp-stat {
    flex: 1;
    min-width: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.45rem 0.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
}

.pp-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.pp-stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.pp-stat-value.green { color: #22c55e; }
.pp-stat-value.primary { color: var(--primary); }
.pp-stat-value.teal { color: #14b8a6; }
.pp-stat-value.amber { color: #fbbf24; }

/* ── Selection Bar ── */
.pp-selection-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    color: var(--text-primary);
}

.pp-selection-bar span:first-child {
    flex: 1;
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .pp-phase-nav {
        gap: 0;
        padding: 0.25rem;
    }

    .pp-phase-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.72rem;
    }

    .pp-phase-btn span:not(.pp-phase-num) {
        display: none;
    }

    .pp-phase-sep {
        display: none;
    }

    .pp-stats {
        gap: 0.2rem;
    }

    .pp-stat {
        min-width: 50px;
    }
}

/* ═══════════════════════════════════════
   PLAT DAK PANEEL PLAATSER (flat roof)
   ═══════════════════════════════════════ */

.fr-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.fr-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* ── Search Bar ── */
.fr-search-bar {
    position: relative;
}

.fr-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.fr-search-icon {
    position: absolute;
    left: 12px;
    width: 16px;
    height: 16px;
    color: var(--text-muted);
    opacity: 0.5;
    pointer-events: none;
}

.fr-address-input {
    width: 100%;
    padding: 0.7rem 0.75rem 0.7rem 2.25rem;
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    transition: all 0.2s ease;
}

.fr-address-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
}

.fr-address-input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

.fr-search-clear {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(128, 128, 128, 0.15);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.fr-search-clear:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.fr-search-clear svg {
    width: 12px;
    height: 12px;
}

/* ── Suggestions Dropdown ── */
.fr-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    margin-top: 4px;
    background: var(--card-bg, #1a1f2e);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: fadeSlideIn 0.15s ease;
}

.fr-suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.fr-suggestion-item:hover {
    background: rgba(0, 170, 255, 0.08);
}

.fr-suggestion-item + .fr-suggestion-item {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* ── Address Badge ── */
.fr-address-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-primary);
}

/* ── Map Container ── */
.fr-map-container {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--card-border);
}

.fr-leaflet-map {
    width: 100%;
    height: 800px;
    background: #0a0e17;
    z-index: 1;
}

/* Fix Leaflet z-index within our card context */
.fr-map-container .leaflet-pane { z-index: 1; }
.fr-map-container .leaflet-control { z-index: 5; }
.fr-map-container .leaflet-top,
.fr-map-container .leaflet-bottom { z-index: 5; }

/* ── Map Overlays ── */
.fr-map-overlay {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

.fr-map-hint {
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(10, 14, 23, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    color: var(--text-muted);
    font-size: 0.82rem;
    white-space: nowrap;
}

.fr-map-actions {
    position: absolute;
    z-index: 10;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.fr-draw-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.25rem;
    border-radius: 24px;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.fr-draw-btn.fr-add-active {
    background: rgba(34, 197, 94, 0.2) !important;
    border-color: #22c55e !important;
    color: #22c55e !important;
    animation: frAddPulse 1.5s ease-in-out infinite;
}

@keyframes frAddPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
    50% { box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4), 0 0 20px rgba(34, 197, 94, 0.2); }
}

.fr-draw-instructions {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(10, 14, 23, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 170, 255, 0.25);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 0.78rem;
    pointer-events: all;
}

.fr-draw-instructions svg {
    width: 16px;
    height: 16px;
    color: var(--primary);
    flex-shrink: 0;
}

.fr-finish-draw {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #22c55e !important;
    border: 1px solid rgba(34, 197, 94, 0.3) !important;
    padding: 0.3rem 0.75rem !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    white-space: nowrap;
    transition: all 0.15s;
}

.fr-finish-draw:hover {
    background: rgba(34, 197, 94, 0.3) !important;
}

.fr-cancel-draw {
    background: none !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--card-border) !important;
    padding: 0.3rem 0.75rem !important;
    font-size: 0.75rem !important;
    cursor: pointer !important;
    white-space: nowrap;
    transition: all 0.15s;
}

.fr-cancel-draw:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

/* ── Vertex Markers (draggable) ── */
.fr-vertex-marker {
    background: transparent !important;
    border: none !important;
}

.fr-map-hint {
    position: absolute;
    z-index: 10;
    pointer-events: none;
}

/* ── Config Card ── */
.fr-config-card {
    animation: fadeSlideIn 0.3s ease;
}

.fr-area-display {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.fr-area-item {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.6rem 0.75rem;
    background: rgba(0, 170, 255, 0.04);
    border: 1px solid rgba(0, 170, 255, 0.12);
    border-radius: var(--radius-sm);
}

.fr-area-item span {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.fr-area-item strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.fr-area-item.highlight strong {
    color: var(--primary);
    font-size: 1.15rem;
}

/* ── Phase btn done state ── */
.pp-phase-btn.done .pp-phase-num {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

/* ── Edge Labels (dimensions + numbers) ── */
.fr-edge-label {
    background: transparent !important;
    border: none !important;
}

.fr-edge-label-inner {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(10, 14, 23, 0.88);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 2px 8px;
    white-space: nowrap;
    font-size: 11px;
    color: #e0e0e0;
    font-weight: 500;
    line-height: 1.2;
}

.fr-edge-label-inner.ref {
    border-color: var(--primary);
    box-shadow: 0 0 6px rgba(0, 170, 255, 0.4);
}

.fr-edge-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 170, 255, 0.25);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.fr-edge-label-inner.ref .fr-edge-num {
    background: var(--primary);
    color: #fff;
}

.fr-edge-dim {
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
}

/* ── Panel Toolbar (floating on map) ── */
.fr-panel-toolbar {
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(10, 14, 23, 0.92);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 170, 255, 0.25);
    border-radius: var(--radius);
    animation: fadeSlideIn 0.2s ease;
    pointer-events: all;
}

.fr-toolbar-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-right: auto;
}

.fr-toolbar-delete {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
    border: 1px solid rgba(239, 68, 68, 0.25) !important;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.fr-toolbar-delete:hover {
    background: rgba(239, 68, 68, 0.25) !important;
}

.fr-toolbar-deselect {
    background: none !important;
    color: var(--text-muted) !important;
    border: 1px solid var(--card-border) !important;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.fr-toolbar-deselect:hover {
    color: var(--text-primary) !important;
}

/* ── Panel Tooltip ── */
.fr-panel-tooltip {
    background: rgba(10, 14, 23, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 6px !important;
    color: #fff !important;
    font-size: 11px !important;
    padding: 3px 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
}

.fr-panel-tooltip::before {
    border-top-color: rgba(10, 14, 23, 0.9) !important;
}

/* ── Toolbar hint ── */
.fr-toolbar-hint {
    font-size: 0.7rem;
    color: rgba(148, 163, 184, 0.5);
    font-style: italic;
}

/* ── Edge Margin Grid ── */
.fr-edge-margins-grid {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
}

.fr-edge-margin-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fr-edge-margin-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    min-width: 140px;
}

.fr-edge-margin-len {
    color: var(--text-muted);
    font-size: 0.72rem;
}

.fr-edge-num-sm {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 170, 255, 0.2);
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.fr-edge-margin-input {
    width: 70px !important;
    text-align: center;
    padding: 0.35rem 0.5rem !important;
    font-size: 0.82rem !important;
}

/* ── Zone Chips Bar ── */
.fr-zone-chips {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    flex-wrap: wrap;
    align-items: center;
}

.fr-zone-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.fr-zone-chip:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: var(--zone-color, var(--primary));
}

.fr-zone-chip.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--zone-color, var(--primary));
    color: var(--text-primary);
    box-shadow: 0 0 12px rgba(var(--zone-color, 0, 170, 255), 0.2);
}

.fr-zone-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.fr-zone-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.fr-zone-delete {
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
    margin-left: 0.2rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.15s ease;
}

.fr-zone-delete:hover {
    color: #ff4444;
    background: rgba(255, 68, 68, 0.15);
}

.fr-zone-add {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
    font-weight: 500;
}

.fr-zone-add:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 170, 255, 0.06);
}

/* ── Zone Drag Handle ── */
.fr-zone-drag-icon {
    background: none !important;
    border: none !important;
    z-index: 1000 !important;
}

/* ── Snap Spots (add-panel circles) ── */
.fr-snap-spot {
    background: transparent !important;
    border: none !important;
}

.fr-snap-spot-inner {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    border: 2px solid var(--spot-color, #ff9800);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.fr-snap-spot-inner:hover {
    transform: scale(1.3);
    background: var(--spot-color, #ff9800);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 12px color-mix(in srgb, var(--spot-color, #ff9800) 40%, transparent);
}

.fr-snap-spot-inner:hover svg line {
    stroke: #fff !important;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .fr-leaflet-map {
        height: 420px;
    }

    .fr-address-input {
        font-size: 0.82rem;
    }

    .fr-draw-instructions {
        font-size: 0.72rem;
    }

    .fr-panel-toolbar {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════
   CONTRACT CARDS (EMS stap)
   ═══════════════════════════════════════ */
.contract-card {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    border: 2px solid var(--card-border);
    background: rgba(0, 0, 0, 0.12);
    cursor: pointer;
    height: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    user-select: none;
}

.contract-card:hover {
    border-color: var(--cc-color, var(--primary));
    background: var(--cc-bg, rgba(0,170,255,0.06));
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.contract-card--active {
    border-color: var(--cc-color, var(--primary));
    background: var(--cc-bg, rgba(0,170,255,0.10));
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-color, #00aaff) 18%, transparent);
}

.contract-card--active .contract-card__label {
    color: var(--cc-color, var(--primary));
    font-weight: 700;
}

.contract-card__icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--cc-bg, rgba(0,170,255,0.12));
    border: 1px solid color-mix(in srgb, var(--cc-color, #00aaff) 30%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.contract-card__icon i,
.contract-card__icon svg {
    width: 18px;
    height: 18px;
    color: var(--cc-color, var(--primary));
}

.contract-card__text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.contract-card__label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.contract-card__hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Light theme */
[data-theme="light"] .contract-card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .contract-card:hover {
    background: var(--cc-bg, rgba(0,130,220,0.06));
}

[data-theme="light"] .contract-card--active {
    background: var(--cc-bg, rgba(0,130,220,0.08));
    border-color: var(--cc-color, #1d4ed8);
}

/* Responsive: stack vertically on small screens */
@media (max-width: 600px) {
    .contract-card {
        padding: 0.7rem 0.85rem;
        gap: 0.65rem;
    }
    .contract-card__icon {
        width: 32px;
        height: 32px;
    }
    .contract-card__label {
        font-size: 0.82rem;
    }
}
