/* ==========================================================================
   DESIGN SYSTEM — PREMIUM SOLAR WORKBENCH v2
   Next-Generation Light Theme with Glassmorphism & Futuristic Accents
   ========================================================================== */
:root {
    /* Core backgrounds */
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e8edf5;
    --bg-glass: rgba(255, 255, 255, 0.78);
    --bg-glass-strong: rgba(255, 255, 255, 0.92);
    --bg-dark-glass: rgba(15, 23, 42, 0.72);
    
    /* Borders */
    --border-color: rgba(226, 232, 240, 0.9);
    --border-subtle: rgba(241, 245, 249, 0.7);
    --border-focus: #3b82f6;
    --border-glass: rgba(255, 255, 255, 0.5);
    
    /* Text */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-on-dark: #f8fafc;
    
    /* Brand colors */
    --color-primary: #2563eb;
    --color-primary-hover: #1d4ed8;
    --color-primary-light: #eff6ff;
    --color-primary-glow: rgba(37, 99, 235, 0.18);
    --color-accent: #f97316;
    --color-accent-light: #fff7ed;
    --color-accent-glow: rgba(249, 115, 22, 0.15);
    --color-success: #10b981;
    --color-success-light: #ecfdf5;
    --color-danger: #ef4444;
    --color-danger-light: #fef2f2;
    --color-warning: #f59e0b;
    --color-purple: #8b5cf6;
    --color-teal: #0891b2;
    
    /* Advanced shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
    --shadow-xl: 0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.08);
    --shadow-glow-blue: 0 0 0 3px rgba(37, 99, 235, 0.15), 0 4px 12px rgba(37,99,235,0.12);
    --shadow-glow-orange: 0 0 0 3px rgba(249, 115, 22, 0.15), 0 4px 12px rgba(249,115,22,0.1);
    
    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* Typography */
    --font-heading: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Transitions */
    --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Sidebar width */
    --sidebar-width: 340px;
    --header-height: 58px;
}

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

html {
    height: 100%;
    overflow: hidden; /* NO main page scroll */
}

body {
    background: linear-gradient(135deg, #eef2f7 0%, #f0f4f8 50%, #e8eef5 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13.5px;
    line-height: 1.5;
    height: 100%;
    overflow: hidden; /* NO main page scroll */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Custom Scrollbar (for sidebar only) */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   WORKBENCH CONTAINER — Full Viewport, No Overflow
   ========================================================================== */
.workbench-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ==========================================================================
   TOP HEADER — Compact & Premium
   ========================================================================== */
.wb-header {
    height: var(--header-height);
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 200;
    flex-shrink: 0;
    box-shadow: 0 1px 0 rgba(255,255,255,0.8), var(--shadow-sm);
    position: relative;
}

/* Subtle gradient accent line at top */
.wb-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-success));
}

.header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12.5px;
    padding: 6px 11px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    letter-spacing: -0.01em;
}
.back-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(-1px);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.03em;
}
.brand-accent {
    background: linear-gradient(135deg, var(--color-primary), #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Version badge */
.brand-badge {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    background: linear-gradient(135deg, var(--color-primary), #06b6d4);
    color: white;
    border-radius: var(--radius-full);
    text-transform: uppercase;
}

.header-center {
    display: flex;
    align-items: center;
    gap: 6px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-chip {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    background: var(--color-primary-light);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 11px;
    color: var(--color-primary);
    letter-spacing: -0.01em;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

/* Header action buttons */
.header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}
.header-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: #cbd5e1;
}
.header-btn.btn-primary-outline {
    color: var(--color-primary);
    border-color: rgba(37, 99, 235, 0.3);
    background: var(--color-primary-light);
}
.header-btn.btn-primary-outline:hover {
    background: rgba(37, 99, 235, 0.12);
}

/* ==========================================================================
   MAIN WORKSPACE GRID — Fixed Height, No Overflow
   ========================================================================== */
.wb-workspace {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr var(--sidebar-width);
    overflow: hidden;
    height: calc(100vh - var(--header-height));
}

/* ==========================================================================
   MAIN PANEL — Left Side, No Scroll
   ========================================================================== */
.wb-main-panel {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    padding: 16px 16px 16px 20px;
    gap: 14px;
}

/* ==========================================================================
   RIGHT SIDEBAR — Scrollable Only
   ========================================================================== */
.wb-sidebar {
    background: var(--bg-glass-strong);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-left: 1px solid var(--border-color);
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Gradient mask at bottom to indicate scrollability */
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent 100%);
    mask-image: linear-gradient(to bottom, black calc(100% - 24px), transparent 100%);
}

.sidebar-inner {
    padding: 18px 18px 40px 18px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ==========================================================================
   TABS NAVIGATION
   ========================================================================== */
.tabs-header {
    display: flex;
    gap: 3px;
    padding: 3px;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    width: fit-content;
    box-shadow: var(--shadow-sm);
}

.tab-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 7px;
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
.tab-btn.active {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.tab-btn svg { flex-shrink: 0; }

.tab-content {
    display: none;
    flex-direction: column;
    gap: 14px;
    flex: 1;
    min-height: 0;
}
.tab-content.active {
    display: flex;
}

/* ==========================================================================
   VIEWPORTS STACK — Dual Split Side-by-Side
   ========================================================================== */
.viewports-stack {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 14px;
    flex: 1;
    min-height: 0;
}

.viewport-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    min-height: 0;
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.viewport-panel:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(203, 213, 225, 0.8);
}

/* Fullscreen expanded state */
.viewport-panel.fullscreen-mode {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9000 !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: none !important;
    width: 100vw !important;
    height: 100vh !important;
}

.panel-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #fafbfd 0%, #f8fafc 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    z-index: 1010;
}

.panel-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
}
.panel-title svg { color: var(--color-primary); }

.panel-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Panel icon button */
.panel-icon-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition-fast);
}
.panel-icon-btn:hover {
    background: var(--color-primary-light);
    border-color: rgba(37, 99, 235, 0.3);
    color: var(--color-primary);
}
.panel-icon-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: white;
}

.panel-body {
    flex: 1;
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 0;
    background: #f1f5f9;
}

#satelliteMap {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
#designerCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    outline: none;
}

/* ==========================================================================
   LOADING OVERLAYS
   ========================================================================== */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}
.loading-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 2.5px solid var(--border-color);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay p {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   HUD OVERLAYS ON VIEWPORTS
   ========================================================================== */
.hud-overlay {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: none;
}

.hud-chip {
    background: var(--bg-glass-strong);
    backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid var(--border-glass);
    padding: 5px 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    font-size: 10.5px;
    color: var(--text-secondary);
    pointer-events: auto;
    font-weight: 500;
    white-space: nowrap;
}
.hud-chip strong {
    color: var(--text-primary);
    font-weight: 700;
}

.hud-capacity-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--color-primary), #0284c7);
    color: white;
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
    font-weight: 800;
    font-size: 13px;
    z-index: 5;
    letter-spacing: -0.02em;
}

.viewport-hint {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark-glass);
    backdrop-filter: blur(8px);
    color: rgba(255,255,255,0.85);
    font-size: 10px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    pointer-events: none;
    z-index: 5;
    white-space: nowrap;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* Shadow Sim badge */
.sim-playing-badge {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--color-accent-light), #fff7ed);
    border: 1px solid rgba(249, 115, 22, 0.4);
    color: var(--color-accent);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    display: none;
    align-items: center;
    gap: 6px;
    z-index: 6;
    box-shadow: var(--shadow-glow-orange);
    white-space: nowrap;
    letter-spacing: -0.01em;
}
.sim-playing-badge.visible {
    display: flex;
    animation: fade-in-up 0.3s ease;
}
.sim-dot {
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    animation: pulse-dot 0.9s ease-in-out infinite;
}

/* ==========================================================================
   MAP DRAWING TOOLBAR
   ========================================================================== */
.map-draw-toolbar {
    display: flex;
    gap: 4px;
}

.map-tool-btn {
    width: 28px;
    height: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-fast);
    color: var(--text-secondary);
}
.map-tool-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: #cbd5e1;
}
.map-tool-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

/* ==========================================================================
   3D VIEWPORT CAMERA CONTROLS PANEL
   ========================================================================== */
.camera-controls-panel {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cam-btn-group {
    display: flex;
    flex-direction: column;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cam-btn {
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 9px;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    transition: all var(--transition-fast);
    letter-spacing: 0;
}
.cam-btn:last-child { border-bottom: none; }
.cam-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ==========================================================================
   EFFICIENCY HEATMAP LEGEND
   ========================================================================== */
.viewport-legend {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 10px;
    color: var(--text-secondary);
    min-width: 100px;
}

.legend-title {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
.legend-swatch.blue { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
.legend-swatch.red { background: #ef4444; }
.legend-swatch.gray { background: #64748b; }
.legend-swatch.green { background: linear-gradient(135deg, #10b981, #059669); }
.legend-swatch.orange { background: #f59e0b; }

/* ==========================================================================
   METRICS DASHBOARD
   ========================================================================== */
.wb-metrics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    flex-shrink: 0;
}

@media (max-width: 1400px) {
    .wb-metrics-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.metric-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 13px 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}
.metric-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.5) 0%, transparent 60%);
    pointer-events: none;
}
.metric-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.metric-card.accent-blue { border-left: 3px solid var(--color-primary); }
.metric-card.accent-orange { border-left: 3px solid var(--color-accent); }
.metric-card.accent-green { border-left: 3px solid var(--color-success); }
.metric-card.accent-purple { border-left: 3px solid var(--color-purple); }
.metric-card.accent-teal { border-left: 3px solid var(--color-teal); }

.metric-label {
    font-size: 9.5px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
}

.metric-value-wrapper {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.metric-number {
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-family: var(--font-heading);
}

.metric-unit {
    font-size: 10.5px;
    color: var(--text-secondary);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.metric-desc {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.metric-desc.success { color: var(--color-success); font-weight: 600; }
.metric-desc.danger { color: var(--color-danger); font-weight: 600; }
.metric-desc.warning { color: var(--color-warning); font-weight: 600; }

/* ==========================================================================
   SIDEBAR SECTIONS
   ========================================================================== */
.sb-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 0;
    border-bottom: 1px solid var(--border-color);
}
.sb-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sb-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 7px;
}
.sb-title-icon {
    width: 18px;
    height: 18px;
    border-radius: var(--radius-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.sb-title-icon.blue { background: var(--color-primary-light); color: var(--color-primary); }
.sb-title-icon.orange { background: var(--color-accent-light); color: var(--color-accent); }
.sb-title-icon.green { background: var(--color-success-light); color: var(--color-success); }
.sb-title-icon.purple { background: #f3f0ff; color: var(--color-purple); }
.sb-title-icon.teal { background: #e0f2fe; color: var(--color-teal); }

/* ==========================================================================
   FORM COMPONENTS
   ========================================================================== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
    letter-spacing: -0.01em;
}

.form-select, .form-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 8.5px 11px;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    outline: none;
    transition: all var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
}
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.form-select:focus, .form-input:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    background: var(--bg-secondary);
}

.coordinate-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.address-search-wrapper {
    display: flex;
    gap: 6px;
}

/* ==========================================================================
   ROOF TYPE VISUAL SELECTOR
   ========================================================================== */
.roof-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
}

.roof-type-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 8px 7px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: var(--bg-primary);
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.roof-type-card:hover {
    border-color: rgba(37, 99, 235, 0.4);
    background: var(--color-primary-light);
}
.roof-type-card.selected {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}
.roof-type-card.selected::after {
    content: '✓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 9px;
    font-weight: 800;
    color: var(--color-primary);
}

.roof-type-img {
    width: 100%;
    height: 52px;
    object-fit: contain;
    border-radius: var(--radius-xs);
}

.roof-type-svg {
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.roof-type-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: center;
    letter-spacing: -0.01em;
}
.roof-type-card.selected .roof-type-label {
    color: var(--color-primary);
}

/* ==========================================================================
   SLIDERS
   ========================================================================== */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}
.slider-value {
    font-weight: 700;
    font-size: 12px;
    color: var(--color-primary);
    background: var(--color-primary-light);
    padding: 2px 7px;
    border-radius: var(--radius-full);
    letter-spacing: -0.01em;
}

.timeline-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--color-primary) 0%, var(--color-primary) 50%, #e2e8f0 50%, #e2e8f0 100%);
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
    margin: 5px 0;
}
.timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2.5px solid var(--color-primary);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(37,99,235,0.3);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.timeline-slider::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 2px 8px rgba(37,99,235,0.4);
}
.timeline-slider:active::-webkit-slider-thumb {
    transform: scale(1.2);
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 9.5px;
    color: var(--text-muted);
    padding: 0 3px;
    margin-top: 3px;
}

/* ==========================================================================
   TOGGLE SWITCH
   ========================================================================== */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}
.toggle-group:has(input:checked) {
    background: var(--color-primary-light);
    border-color: rgba(37, 99, 235, 0.3);
}

.toggle-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.toggle-label-main {
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
}
.toggle-label-sub {
    font-size: 10px;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }

.slider-switch {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    transition: all var(--transition-normal);
    border-radius: 22px;
}
.slider-switch::before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 3px;
    top: 3px;
    background: white;
    transition: transform var(--transition-spring);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input:checked + .slider-switch {
    background: var(--color-primary);
}
input:checked + .slider-switch::before {
    transform: translateX(18px);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 13px;
    padding: 9px 16px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    letter-spacing: -0.01em;
    position: relative;
    overflow: hidden;
}
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%);
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary) 0%, #1e40af 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-primary-hover) 0%, #1e3a8a 100%);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: #cbd5e1;
}

.btn-accent {
    background: linear-gradient(135deg, var(--color-accent) 0%, #ea580c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}
.btn-accent:hover {
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.btn-full { width: 100%; }
.btn-lg { padding: 11px 18px; font-size: 14px; }
.btn-sm { padding: 6px 11px; font-size: 11.5px; }

/* ==========================================================================
   PROPOSAL TAB
   ========================================================================== */
.proposal-editor-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
    flex: 1;
}

.proposal-preview-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 820px;
    margin: 0 auto;
    width: 100%;
    padding: 44px 48px;
    font-family: 'Inter', system-ui, sans-serif;
    color: #1e293b;
    position: relative;
    overflow: hidden;
}

.proposal-preview-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent), var(--color-success));
}

.prop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1.5px solid var(--border-color);
}

.prop-logo-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.prop-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-primary);
    font-family: var(--font-heading);
    letter-spacing: -0.04em;
}
.prop-logo-sub {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.01em;
}

.prop-meta-block {
    text-align: right;
}
.prop-meta-block h2 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}
.prop-meta-block div {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 3px;
}

.prop-address-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
    padding: 18px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}
.prop-address-col h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 8px;
}
.prop-address-col p {
    font-size: 13px;
    margin-bottom: 4px;
    color: var(--text-secondary);
}
.prop-address-col p strong {
    color: var(--text-primary);
}

.prop-specs-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}
.prop-specs-table thead th {
    background: var(--color-primary);
    color: white;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
}
.prop-specs-table tbody tr:nth-child(even) td {
    background: var(--bg-tertiary);
}
.prop-specs-table tbody td {
    padding: 9px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}
.prop-specs-table tbody tr:last-child td { border-bottom: none; }
.prop-specs-table tbody td strong { color: var(--text-primary); font-weight: 700; }

.prop-visuals-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 24px;
}
.prop-visual-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.prop-visual-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}
.prop-canvas-chart {
    width: 100%;
    height: auto;
    display: block;
}

.prop-bom-section {
    margin-bottom: 24px;
}
.prop-bom-section h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.bom-grid { display: flex; flex-direction: column; gap: 0; }
.bom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-top: none;
    background: var(--bg-secondary);
}
.bom-row:first-child { border-top: 1px solid var(--border-color); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.bom-row:last-child { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
.bom-row:nth-child(even) { background: var(--bg-tertiary); }
.bom-row span { color: var(--text-secondary); }
.bom-row strong { color: var(--text-primary); font-weight: 700; }

.prop-financial-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    padding: 18px;
    background: linear-gradient(135deg, #eef9f5, #e0f2fe);
    border-radius: var(--radius-md);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.prop-fin-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: center;
}
.prop-fin-label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.prop-fin-val {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.03em;
    font-family: var(--font-heading);
}
.prop-fin-desc {
    font-size: 10px;
    color: var(--text-secondary);
}

.prop-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 11px;
    color: var(--text-muted);
}
.pdf-stamp-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--color-success-light);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: 800;
    color: var(--color-success);
    letter-spacing: 0.05em;
}

/* ==========================================================================
   FULLSCREEN OVERLAY & BUTTON
   ========================================================================== */
.fs-overlay-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 400;
    width: 30px;
    height: 30px;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-xs);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
}
.fs-overlay-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: rgba(37, 99, 235, 0.3);
}

.fullscreen-exit-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9001;
    height: 44px;
    background: var(--bg-dark-glass);
    backdrop-filter: blur(12px);
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    color: rgba(255,255,255,0.9);
    font-size: 12px;
    font-weight: 600;
}
.fullscreen-exit-bar.visible {
    display: flex;
}
.fullscreen-exit-bar button {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: background var(--transition-fast);
}
.fullscreen-exit-bar button:hover {
    background: rgba(255,255,255,0.2);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse-dot {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   PRINT STYLES (PDF Export)
   ========================================================================== */
@media print {
    .wb-header,
    .wb-sidebar,
    .tabs-header,
    .wb-metrics-grid,
    .map-draw-toolbar,
    .hud-overlay,
    .viewport-hint,
    .camera-controls-panel,
    .viewport-legend,
    .sim-playing-badge,
    .hud-capacity-overlay,
    .panel-header-actions,
    .fs-overlay-btn,
    .fullscreen-exit-bar,
    #btnTabModel,
    #btnTabProposal,
    #modelTab {
        display: none !important;
    }

    html, body {
        overflow: visible !important;
        height: auto !important;
        background: white !important;
    }

    .workbench-container {
        height: auto !important;
    }

    .wb-workspace {
        display: block !important;
        height: auto !important;
        overflow: visible !important;
    }

    .wb-main-panel {
        overflow: visible !important;
        padding: 0 !important;
        height: auto !important;
    }

    #proposalTab {
        display: flex !important;
    }

    .tab-content {
        display: flex !important;
        height: auto !important;
    }

    .proposal-preview-card {
        box-shadow: none !important;
        border: none !important;
        max-width: 100% !important;
        padding: 20px !important;
        height: auto !important;
        overflow: visible !important;
    }

    .proposal-editor-grid {
        overflow: visible !important;
        overflow-y: visible !important;
        height: auto !important;
        display: block !important;
        flex: none !important;
    }

    .prop-header,
    .prop-address-grid,
    .prop-specs-table,
    .prop-visuals-row,
    .prop-bom-section,
    .prop-financial-summary,
    .prop-footer {
        page-break-inside: avoid !important;
    }
}

/* ========================================================================
   LOCATE ME BUTTON — GPS Geolocation Control
   ======================================================================== */
.btn-locate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #0f766e, #0d9488);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-main);
    cursor: pointer;
    transition: all 0.22s ease;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
    position: relative;
    overflow: hidden;
}

.btn-locate::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0d9488, #14b8a6);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn-locate:hover::before { opacity: 1; }
.btn-locate:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(13, 148, 136, 0.45); }
.btn-locate:active { transform: translateY(0); }

.btn-locate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.locate-icon {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* Pulsing animation while locating */
.btn-locate.locating .locate-icon {
    animation: locatePulse 1s ease-in-out infinite;
}

@keyframes locatePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.7; }
}

/* Radiate ring effect on locating */
.btn-locate.locating::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    animation: locateRing 1.4s ease-out infinite;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
}

@keyframes locateRing {
    0% { transform: translateY(-50%) scale(1); opacity: 0.8; }
    100% { transform: translateY(-50%) scale(2.5); opacity: 0; }
}

/* ========================================================================
   ENVIRONMENT TREE LEGEND SWATCH
   ======================================================================== */
.legend-swatch.green {
    background: #15803d;
}

/* ========================================================================
   SUN SIMULATION — Enhanced Viewport Styles
   ======================================================================== */
.sim-playing-badge {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(251, 146, 60, 0.92);
    color: #fff;
    border-radius: 20px;
    padding: 4px 14px;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.25);
    z-index: 10;
    white-space: nowrap;
}

.sim-playing-badge.visible { opacity: 1; }

.sim-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff;
    animation: simBlink 0.9s ease-in-out infinite;
}

@keyframes simBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

.map-panel-marker {
    background: transparent !important;
    border: none !important;
}

/* ========================================================================
   TOOLBAR DROPDOWN MENU
   ======================================================================== */
.toolbar-dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-heading);
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    height: 28px;
    box-shadow: var(--shadow-xs);
}

.dropdown-toggle-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.dropdown-toggle-btn.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-color: rgba(37, 99, 235, 0.3);
}

.dropdown-menu-content {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--bg-glass-strong);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    min-width: 140px;
    padding: 4px 0;
    animation: fadeInDropdown 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.toolbar-dropdown:hover .dropdown-menu-content,
.toolbar-dropdown.open .dropdown-menu-content {
    display: block;
}

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

.dropdown-item-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 12px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.dropdown-item-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.dropdown-item-btn.active {
    background: var(--color-primary);
    color: white !important;
}

/* ========================================================================
   UNDO/REDO STYLES & DIVIDERS
   ======================================================================== */
.panel-icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed !important;
    background: var(--bg-primary) !important;
    color: var(--text-muted) !important;
    border-color: var(--border-color) !important;
}

.toolbar-divider {
    display: inline-block;
    width: 1px;
    height: 16px;
    background: var(--border-color);
    margin: 0 4px;
}

/* ========================================================================
   CUSTOM LEAFLET ICON BADGES
   ======================================================================== */
.custom-leaflet-icon {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass-strong) !important;
    border-radius: 50% !important;
    box-shadow: var(--shadow-sm), 0 2px 8px rgba(0,0,0,0.12) !important;
    font-size: 14px;
    transition: all var(--transition-spring);
    border: 2px solid #ef4444 !important;
}

.custom-leaflet-icon:hover {
    transform: scale(1.2) !important;
    box-shadow: var(--shadow-md), 0 4px 12px rgba(0,0,0,0.2) !important;
    z-index: 1000 !important;
}

/* Specific borders based on object types */
.custom-leaflet-icon.tree-icon { border-color: #10b981 !important; }
.custom-leaflet-icon.watertank-icon { border-color: #06b6d4 !important; }
.custom-leaflet-icon.ac-icon { border-color: #64748b !important; }
.custom-leaflet-icon.acduct-icon { border-color: #94a3b8 !important; }
.custom-leaflet-icon.chimney-icon { border-color: #ef4444 !important; }
.custom-leaflet-icon.building-icon { border-color: #475569 !important; }
.custom-leaflet-icon.dish-icon { border-color: #fbbf24 !important; }
.custom-leaflet-icon.windmill-icon { border-color: #8b5cf6 !important; }
.custom-leaflet-icon.elevator-icon { border-color: #b45309 !important; }
.custom-leaflet-icon.inverter-icon { border-color: #eab308 !important; }

/* ========================================================================
   EXPANDED LEGEND SWATCHES
   ======================================================================== */
.legend-swatch.cyan { background: #06b6d4; }
.legend-swatch.slate { background: #64748b; }
.legend-swatch.silver { background: #cbd5e1; border: 1px solid #94a3b8; }
.legend-swatch.brick { background: #ef4444; }
.legend-swatch.darkgray { background: #475569; }
.legend-swatch.gold { background: #fbbf24; }
.legend-swatch.violet { background: #8b5cf6; }
.legend-swatch.bronze { background: #b45309; }
.legend-swatch.yellow { background: #eab308; }

/* ========================================================================
   RECORDING OVERLAY & PROGRESS HUD
   ======================================================================== */
.recording-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: all var(--transition-normal);
}

.recording-card {
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-glass);
    padding: 32px 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl), 0 10px 50px rgba(0, 0, 0, 0.2);
    width: 420px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleUp {
    from {
        transform: scale(0.9) translateY(10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.recording-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.rec-dot {
    width: 12px;
    height: 12px;
    background: var(--color-danger);
    border-radius: 50%;
    animation: blinkRed 1.2s infinite alternate;
}

@keyframes blinkRed {
    0% { opacity: 0.2; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 10px var(--color-danger); }
}

.recording-header h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.recording-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.recording-progress-container {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: 12px;
}

.recording-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-purple) 50%, var(--color-accent) 100%);
    border-radius: var(--radius-full);
    transition: width 0.1s linear;
}

.recording-status {
    width: 100%;
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
}

.recording-percentage {
    color: var(--color-primary);
}

.recording-meta {
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

