/* ============================================
   components.css — Premium UI Component Styles
   Visual Redesign V3: Glass morphism, 3D depth, accent glow
   ============================================ */

/* ==========================================================================
   REUSABLE GLASS CARD BASE
   ========================================================================== */
.glass-card {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.glass-card::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    pointer-events: none; z-index: 2;
}
.glass-card::after {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.03), transparent 60%);
    pointer-events: none; z-index: 1;
}
.glass-card:hover {
    transform: translateY(-4px) rotateX(2deg);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-xl);
}

/* ==========================================================================
   1. HEADER
   ========================================================================== */
.header {
    text-align: center;
    margin-bottom: 24px;
}
.header h1 {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.05;
    margin-bottom: 4px;
    color: var(--white);
}
.header h1 span {
    color: var(--accent);
}
.header p {
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* --- Page Header (new) --- */
.page-header {
    margin-bottom: 36px;
    animation: fadeUp 0.6s ease-out;
}
.page-header h1 {
    font-size: 42px;
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1.05;
    color: var(--white);
}
.page-header h1 .dot {
    color: var(--accent);
}
.page-header .subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-top: 8px;
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* ==========================================================================
   2. SECTION HEADER (new)
   ========================================================================== */
.section-header {
    margin: 8px 0 28px;
    padding-top: 28px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: fadeUp 0.6s ease-out 0.15s both;
}
.section-header h3 {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
}
.section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--glass-border), transparent);
}

/* ==========================================================================
   3. NAVIGATION ROW
   ========================================================================== */
.nav-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* ==========================================================================
   4. TAB & YEAR BUTTONS
   ========================================================================== */
.tab-btn, .year-btn {
    padding: 9px 20px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s;
}
.tab-btn:hover, .year-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text);
}
.tab-btn.active, .year-btn.active {
    background: linear-gradient(145deg, var(--primary), var(--primary-light));
    border-color: rgba(255,255,255,0.12);
    color: var(--white);
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(30, 82, 87, 0.4), inset 0 1px 0 rgba(255,255,255,0.08);
}
.tab-btn .short-label { display: none; }
.tab-btn .full-label { display: inline; }

/* ==========================================================================
   5. KPI CARDS
   ========================================================================== */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 36px;
    perspective: 1200px;
    animation: fadeUp 0.6s ease-out 0.1s both;
}
.kpi-card {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.5), rgba(14, 42, 45, 0.6));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 24px 26px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
/* Top highlight reflection */
.kpi-card::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    pointer-events: none; z-index: 2;
}
/* Inner ambient light */
.kpi-card::after {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.03), transparent 60%);
    pointer-events: none; z-index: 1;
}
.kpi-card:hover {
    transform: translateY(-4px) rotateX(2deg);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-xl);
}
.kpi-card .label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}
.kpi-card .value {
    font-size: 44px;
    font-weight: 900;
    letter-spacing: -0.04em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    position: relative;
    z-index: 2;
}
.kpi-card .sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    position: relative;
    z-index: 2;
}

/* Accent underline bar for KPI cards */
.accent-bar {
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    border-radius: 2px 2px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}
.kpi-card:hover .accent-bar { opacity: 1; }
.kpi-card:nth-child(1) .accent-bar { background: linear-gradient(90deg, transparent, var(--accent), transparent); }
.kpi-card:nth-child(2) .accent-bar { background: linear-gradient(90deg, transparent, var(--white), transparent); opacity: 0.3; }
.kpi-card:nth-child(3) .accent-bar { background: linear-gradient(90deg, transparent, var(--text-secondary), transparent); }
.kpi-card:nth-child(4) .accent-bar { background: linear-gradient(90deg, transparent, var(--accent), transparent); }

/* ==========================================================================
   6. CHART GRID & CARDS
   ========================================================================== */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(500px, 100%), 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.chart-card {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 20px;
    overflow: hidden;
    position: relative;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    touch-action: pan-y;
}
.chart-card::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    pointer-events: none; z-index: 2;
}
.chart-card::after {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.03), transparent 60%);
    pointer-events: none; z-index: 1;
}
.chart-card:hover {
    transform: translateY(-4px) rotateX(2deg);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-xl);
}
.chart-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
    position: relative;
    z-index: 2;
}
.chart-card canvas {
    width: 100% !important;
    max-height: 320px;
    position: relative;
    z-index: 2;
    touch-action: pan-y;
}
.full-width { grid-column: 1 / -1; }

/* ==========================================================================
   7. COMPARISON SECTION
   ========================================================================== */
.comparison-section {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.comparison-section::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    pointer-events: none;
}
.comparison-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}
.comp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}
.comp-item {
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.03);
    border-radius: 12px;
    padding: 16px;
}
.comp-item .comp-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.comp-item .comp-value {
    font-size: 22px;
    font-weight: 700;
}
.comp-item .comp-detail {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.savings { color: var(--accent); }
.cost { color: var(--text-secondary); }

/* ==========================================================================
   8. TABLE CARD & TABLE STYLES
   ========================================================================== */
.table-card {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 20px;
    margin-bottom: 28px;
    overflow-x: auto;
    position: relative;
}
.table-card::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    pointer-events: none;
}
.table-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--glass-border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--glass-highlight); }

/* ==========================================================================
   9. COP BADGES
   ========================================================================== */
.cop-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 12px;
}
.cop-excellent {
    background: rgba(241, 135, 21, 0.15);
    color: var(--accent);
}
.cop-good {
    background: rgba(30, 82, 87, 0.35);
    color: var(--primary-light);
}
.cop-ok {
    background: rgba(168, 191, 194, 0.12);
    color: var(--text-secondary);
}
.cop-low {
    background: rgba(94, 125, 128, 0.15);
    color: var(--text-muted);
}

/* ==========================================================================
   10. FORM GRID
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
}
.form-grid input, .form-grid select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    background: var(--primary-deeper);
    color: var(--text);
    font-size: 14px;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-grid input:focus, .form-grid select:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(38, 106, 112, 0.2);
}

/* ==========================================================================
   11. INTERPOLATION BADGE
   ========================================================================== */
.interp-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 6px;
    margin-left: 4px;
    vertical-align: middle;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ==========================================================================
   12. FOOTER
   ========================================================================== */
.footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    padding: 20px 0;
}

/* ==========================================================================
   13. PROGRESS BARS
   ========================================================================== */
.progress-section { margin: 16px 0; }
.progress-bar-outer {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 20px;
    margin: 8px 0;
    position: relative;
    overflow: hidden;
}
.progress-bar-outer::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    pointer-events: none;
}
.progress-bar-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-muted);
}
.progress-bar-track {
    height: 32px;
    background: rgba(14, 42, 45, 0.6);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    box-shadow: 0 0 16px rgba(241, 135, 21, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: var(--white);
    min-width: 40px;
}
.progress-bar-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: center;
}

/* ==========================================================================
   14. LIVE DOT & BADGE
   ========================================================================== */
.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(241, 135, 21, 0.6);
    margin-right: 6px;
    animation: pulse 2s ease-in-out infinite;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.live-badge.active {
    color: var(--accent);
}
.live-badge.active .live-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(241, 135, 21, 0.6);
    animation: pulse 2s ease-in-out infinite;
}
.live-badge.inactive {
    color: var(--text-muted);
}
.live-badge.inactive .live-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.4;
}

/* --- Live Pill (new) --- */
.live-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: var(--accent-soft);
    border: 1px solid rgba(241, 135, 21, 0.15);
}
.live-text {
    font-size: 10px;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: 0.1em;
}

/* --- REST fallback pill --- */
.rest-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(156, 163, 175, 0.1);
    border: 1px solid rgba(156, 163, 175, 0.15);
    font-size: 10px;
    color: var(--text-secondary);
}
.rest-pill .rest-dot {
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse-rest 3s ease-in-out infinite;
}
@keyframes pulse-rest {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* --- KPI update flash --- */
@keyframes kpi-flash {
    0% { box-shadow: 0 0 0 0 rgba(241, 135, 21, 0.4); }
    40% { box-shadow: 0 0 12px 2px rgba(241, 135, 21, 0.15); }
    100% { box-shadow: none; }
}
.kpi-card.kpi-updated {
    animation: kpi-flash 0.8s ease-out;
}

/* ==========================================================================
   15. HEATMAP
   ========================================================================== */
.heatmap-container { overflow-x: auto; margin: 12px 0; }
.heatmap-grid {
    display: grid;
    grid-template-columns: 70px repeat(24, 1fr);
    gap: 1px;
    font-size: 10px;
    min-width: 700px;
}
.heatmap-header {
    text-align: center;
    color: var(--text-muted);
    padding: 2px;
    font-weight: 700;
    font-size: 9px;
}
.heatmap-row-label {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    font-size: 10px;
    padding-right: 4px;
}
.heatmap-cell {
    aspect-ratio: 1;
    border-radius: 3px;
    min-height: 14px;
    transition: transform 0.15s;
}
.heatmap-cell:hover {
    transform: scale(1.8);
    z-index: 10;
    position: relative;
    box-shadow: var(--shadow-md);
}
.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-muted);
}
.heatmap-legend-block {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

/* ==========================================================================
   16. SEASON CARDS
   ========================================================================== */
.season-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin: 12px 0;
}
.season-card {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 18px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.season-card::before {
    content: ''; position: absolute; top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    pointer-events: none;
}
.season-card:hover {
    transform: translateY(-3px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg);
}
.season-card .season-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}
.season-card .season-value {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.season-card .season-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ==========================================================================
   17. PROGNOSE CARDS
   ========================================================================== */
.prognose-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 12px 0;
}
.prognose-card {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.prognose-card::before {
    content: ''; position: absolute; top: 0; left: 15%; right: 15%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    pointer-events: none;
}
.prognose-card:hover {
    transform: translateY(-3px);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg);
}
.prognose-card .prog-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
}
.prognose-card .prog-value {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}
.prognose-card .prog-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ==========================================================================
   18. EXPORT BUTTONS
   ========================================================================== */
.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-secondary);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.25s;
}
.export-btn:hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--accent-soft);
    box-shadow: 0 2px 12px rgba(241, 135, 21, 0.1);
}
.export-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* ==========================================================================
   19. TIMENAV
   ========================================================================== */
#year-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

.timenav-units {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.timenav-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    position: relative;
}

.timenav-label {
    min-width: 140px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--white);
    cursor: pointer;
    text-decoration: underline dotted rgba(255,255,255,0.2);
    text-underline-offset: 4px;
    user-select: none;
    white-space: nowrap;
    transition: color 0.2s;
}
.timenav-label:hover {
    color: var(--accent);
}

.timenav-picker-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.85), rgba(14, 42, 45, 0.95));
    backdrop-filter: blur(32px) saturate(180%);
    -webkit-backdrop-filter: blur(32px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 14px;
    z-index: 100;
    box-shadow: var(--shadow-xl);
    min-width: 220px;
}
.timenav-picker-dropdown.hidden { display: none; }

.timenav-year-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.timenav-month-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.timenav-month-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.timenav-pick-btn {
    padding: 8px 14px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}
.timenav-pick-btn:hover {
    border-color: var(--glass-border-hover);
    color: var(--text);
    background: rgba(255,255,255,0.06);
}
.timenav-pick-btn.active {
    background: linear-gradient(145deg, var(--primary), var(--primary-light));
    border-color: rgba(255,255,255,0.12);
    color: var(--white);
    font-weight: 700;
    box-shadow: 0 4px 20px rgba(30, 82, 87, 0.4), inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ==========================================================================
   20. EFFICIENCY COMPONENTS
   ========================================================================== */

/* --- 20a. Efficiency Strip (Live bars for landing tiles) --- */
.efficiency-strip {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--glass-border);
}
.efficiency-strip-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}
.efficiency-strip-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}
.efficiency-strip-track {
    flex: 1;
    height: 6px;
    background: rgba(14, 42, 45, 0.6);
    border-radius: 3px;
    overflow: hidden;
}
.efficiency-strip-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    box-shadow: 0 0 8px rgba(241, 135, 21, 0.15);
    transition: width 1s ease-out;
}
.efficiency-strip-watt {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    min-width: 50px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.efficiency-strip-text {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}
.efficiency-strip-text .live-value {
    color: var(--accent);
    font-weight: 700;
}
.efficiency-strip-avg {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    opacity: 0.7;
}

/* --- 20b. Comparison Grid (Your house vs. conventional) --- */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.comparison-col {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.comparison-col:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg);
}
.comparison-col.yours {
    border-left: 3px solid var(--accent);
}
.comparison-col.conventional {
    border-left: 3px solid var(--text-muted);
}

.comparison-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.comparison-col-body {
    padding: 16px 20px;
}

.comparison-category {
    margin-bottom: 16px;
}
.comparison-category:last-child {
    margin-bottom: 0;
}
.comparison-category-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}
.comparison-category-value {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
    font-variant-numeric: tabular-nums;
}
.comparison-category-bar {
    height: 4px;
    background: rgba(14, 42, 45, 0.6);
    border-radius: 2px;
    overflow: hidden;
}
.comparison-category-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.8s ease;
}
.comparison-col.yours .comparison-category-bar-fill {
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    box-shadow: 0 0 8px rgba(241, 135, 21, 0.15);
}
.comparison-col.conventional .comparison-category-bar-fill {
    background: var(--text-muted);
}

.comparison-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 16px 20px;
    border-top: 1px solid var(--glass-border);
    font-size: 18px;
    font-weight: 800;
}
.comparison-total-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.comparison-savings {
    background: linear-gradient(145deg, rgba(241, 135, 21, 0.1), rgba(241, 135, 21, 0.04));
    border: 1px solid rgba(241, 135, 21, 0.18);
    border-radius: 14px;
    padding: 16px 24px;
    text-align: center;
    color: var(--accent);
    font-size: 18px;
    font-weight: 800;
    grid-column: 1 / -1;
    box-shadow: 0 2px 12px rgba(241, 135, 21, 0.06);
}
.comparison-savings .savings-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    opacity: 0.8;
}

/* --- 20c. Autarkie Ring (SVG ring for independence) --- */
.autarkie-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.autarkie-ring-svg {
    position: relative;
    width: 200px;
    height: 200px;
}
.autarkie-ring-svg svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}
.autarkie-ring-svg circle {
    fill: none;
    stroke-width: 10;
}
.autarkie-ring-bg {
    stroke: var(--glass-border);
}
.autarkie-ring-fill {
    stroke: var(--accent);
    stroke-linecap: round;
    transition: stroke-dasharray 1.2s ease-out;
    filter: drop-shadow(0 0 6px rgba(241, 135, 21, 0.3));
}
.autarkie-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.autarkie-ring-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
}
.autarkie-ring-percent {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--accent);
    opacity: 0.7;
}
.autarkie-ring-text {
    margin-top: 12px;
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
}

/* --- 20d. Independence Bars --- */
.independence-bars {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.independence-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.independence-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.independence-bar-label {
    font-size: 13px;
    color: var(--text-muted);
}
.independence-bar-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.independence-bar-track {
    height: 8px;
    background: rgba(14, 42, 45, 0.6);
    border-radius: 4px;
    overflow: hidden;
}
.independence-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    box-shadow: 0 0 8px rgba(241, 135, 21, 0.15);
    transition: width 1s ease-out;
}

/* --- 20e. Live Badge (pulsing indicator) --- */
/* (shared with section 14 above) */

/* --- 20f. Efficiency Section (container for /effizienz page) --- */
.efficiency-section {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.efficiency-section::before {
    content: ''; position: absolute; top: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
    pointer-events: none;
}
.efficiency-section h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   21. CATEGORY CARDS (new — from mockup)
   ========================================================================== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
    perspective: 1200px;
}

.cat-card {
    background: linear-gradient(165deg, rgba(30, 82, 87, 0.4), rgba(14, 42, 45, 0.5));
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
    animation: fadeUp 0.6s ease-out both;
}
.cat-card:nth-child(1) { animation-delay: 0.2s; }
.cat-card:nth-child(2) { animation-delay: 0.25s; }
.cat-card:nth-child(3) { animation-delay: 0.3s; }
.cat-card:nth-child(4) { animation-delay: 0.35s; }

/* Top reflection line */
.cat-card::before {
    content: ''; position: absolute; top: 0; left: 15%; right: 15%;
    height: 1px; z-index: 2;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
}
/* Inner ambient light */
.cat-card::after {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
    pointer-events: none; z-index: 1;
}
/* 3D hover */
.cat-card:hover {
    transform: translateY(-6px) rotateX(2deg);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-xl);
}
.cat-card:hover .cat-glow { opacity: 1; }
.cat-card:hover .cat-arrow { transform: translateX(4px); opacity: 1; }

.cat-glow {
    position: absolute; top: -20px; left: 20%; right: 20%; height: 100px;
    opacity: 0; transition: opacity 0.5s; pointer-events: none; z-index: 0;
    background: radial-gradient(ellipse, var(--accent-glow), transparent 70%);
}

.cat-inner {
    padding: 30px 30px 24px;
    position: relative;
    z-index: 2;
}

.cat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.cat-head-left {
    display: flex;
    align-items: center;
    gap: 16px;
}
.cat-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, rgba(30, 82, 87, 0.6), rgba(14, 42, 45, 0.8));
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
    position: relative;
    flex-shrink: 0;
}
.cat-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cat-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--white);
}
.cat-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
    font-weight: 400;
}
.cat-arrow {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
    transition: all 0.3s;
    flex-shrink: 0;
}
.cat-arrow svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
    fill: none;
    stroke-width: 2;
}

/* --- Category Metrics --- */
.cat-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    text-align: center;
}
.cm-wrap {
    padding: 14px 8px;
    border-radius: 12px;
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.03);
}
.cm-label {
    font-size: 9.5px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}
.cm-value {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    color: var(--white);
}
.cm-value .hi { color: var(--accent); }
.cm-unit {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.35;
}

/* --- Category Summary --- */
.cat-summary {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid var(--glass-border);
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.savings-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(241, 135, 21, 0.12), rgba(241, 135, 21, 0.05));
    border: 1px solid rgba(241, 135, 21, 0.18);
    font-size: 13px;
    font-weight: 800;
    color: var(--accent);
    box-shadow: 0 2px 8px rgba(241, 135, 21, 0.08);
}
.savings-badge svg {
    width: 14px;
    height: 14px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 2.5;
}

/* --- Category Strip (live bar at bottom) --- */
.cat-strip {
    padding: 18px 30px 22px;
    border-top: 1px solid var(--glass-border);
    background: rgba(0,0,0,0.1);
}
.strip-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}
.strip-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 9.5px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}
.strip-badge.on { color: var(--accent); }
.strip-badge.off { color: var(--text-muted); opacity: 0.4; }
.strip-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}
.strip-badge.on .strip-dot {
    background: var(--accent);
    box-shadow: 0 0 8px rgba(241, 135, 21, 0.6);
    animation: pulse 2s infinite;
}
.strip-badge.off .strip-dot { background: var(--text-muted); }
.strip-watts {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}
.strip-bar {
    height: 3px;
    background: rgba(255,255,255,0.04);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 10px;
}
.strip-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    box-shadow: 0 0 10px rgba(241, 135, 21, 0.15);
    transition: width 1.2s ease-out;
}
.strip-info {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}
.strip-info .val {
    color: var(--accent);
    font-weight: 700;
}
.strip-avg {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ==========================================================================
   22. BATTERY (new)
   ========================================================================== */
.battery-wrap {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}
.battery-track {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.battery-fill {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--primary-light), var(--accent));
    box-shadow: 0 0 10px rgba(241, 135, 21, 0.2);
    transition: width 1s ease-out;
}
.battery-pct {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   23. PRINT STYLES
   ========================================================================== */
@media print {
    body { background: #fff !important; color: #000 !important; }
    .sidebar, .hamburger, #sidebar-overlay, #year-bar, #live-strip,
    .export-btn, #share-banner, .chart-grid, .chart-card, #vehicleFilterBar { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 12px !important; }

    .kpi-card {
        background: #f8f8f8 !important; border: 1px solid #ddd !important;
        backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
        box-shadow: none !important; transform: none !important;
        -webkit-print-color-adjust: exact; print-color-adjust: exact;
    }
    .kpi-card::before, .kpi-card::after { display: none !important; }
    .kpi-card .label { color: #666 !important; }
    .kpi-card .value { color: #000 !important; font-size: 24px !important; }
    .kpi-card .sub { color: #666 !important; }

    .table-card {
        background: #fff !important; border: 1px solid #ddd !important;
        backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
    }
    table { border: none !important; }
    th { color: #666 !important; border-bottom: 2px solid #ddd !important; }
    td { border-bottom: 1px solid #eee !important; }
    tr:hover td { background: none !important; }

    .chart-card, .comparison-section, .season-card, .prognose-card,
    .efficiency-section, .glass-card, .cat-card {
        background: #f8f8f8 !important; border: 1px solid #ddd !important;
        backdrop-filter: none !important; -webkit-backdrop-filter: none !important;
        box-shadow: none !important; transform: none !important;
    }
    .cat-card::before, .cat-card::after,
    .chart-card::before, .chart-card::after,
    .glass-card::before, .glass-card::after { display: none !important; }

    h2 { font-size: 18px !important; }
}

/* ==========================================================================
   24. RESPONSIVE
   ========================================================================== */
@media (max-width: 1000px) {
    .category-grid { grid-template-columns: 1fr; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .page-header h1 { font-size: 30px; }
}

@media (max-width: 768px) {
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    .kpi-row {
        grid-template-columns: 1fr;
    }
    .cat-metrics {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .tab-btn .short-label { display: inline; }
    .tab-btn .full-label { display: none; }

    .autarkie-ring-svg {
        width: 160px;
        height: 160px;
    }
    .autarkie-ring-number {
        font-size: 2rem;
    }
    .comparison-total {
        font-size: 16px;
        padding: 12px 16px;
    }
    .comparison-col-header {
        padding: 12px 16px;
    }
    .comparison-col-body {
        padding: 12px 16px;
    }
    .efficiency-section {
        padding: 16px;
    }
    .cat-inner {
        padding: 20px 18px 16px;
    }
    .cat-strip {
        padding: 14px 18px 18px;
    }
    .cat-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
    }
    .cat-icon svg {
        width: 20px;
        height: 20px;
    }
    .cat-title {
        font-size: 18px;
    }
    .cm-value {
        font-size: 22px;
    }
}
