        :root {
            --bg-dark: #030712;
            --bg-surface: rgba(17, 24, 39, 0.7);
            --bg-card: rgba(31, 41, 55, 0.4);
            --primary: #6366f1;
            --primary-gradient: linear-gradient(135deg, #6366f1, #a855f7);
            --success: #10b981;
            --warning: #f59e0b;
            --danger: #ef4444;
            --border: rgba(255, 255, 255, 0.08);
            --text-main: #f3f4f6;
            --text-muted: #9ca3af;
            --radius-lg: 16px;
            --radius-md: 8px;
            --font-mono: 'JetBrains Mono', monospace;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-dark);
            color: var(--text-main);
            -webkit-font-smoothing: antialiased;
            overflow-x: hidden;
            display: flex;
            min-height: 100vh;
        }

        /* Sidebar Styling */
        .sidebar {
            width: 280px;
            background: rgba(17, 24, 39, 0.95);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            position: fixed;
            top: 0;
            bottom: 0;
            left: 0;
            z-index: 100;
            padding: 20px;
            transition: transform 0.3s ease;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 30px;
            padding-bottom: 15px;
            border-bottom: 1px solid var(--border);
        }

        .brand-icon {
            width: 40px;
            height: 40px;
            background: var(--primary-gradient);
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 800;
            font-size: 1.25rem;
            color: white;
            box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
        }

        .brand-text h1 {
            font-size: 1.05rem;
            font-weight: 800;
            letter-spacing: -0.3px;
            background: linear-gradient(135deg, #ffffff, #d1d5db);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .brand-text p {
            font-size: 0.72rem;
            color: var(--text-muted);
            margin-top: 1px;
        }

        .nav-section {
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex: 1;
            overflow-y: auto;
        }

        .nav-header {
            font-size: 0.68rem;
            text-transform: uppercase;
            letter-spacing: 1px;
            color: var(--text-muted);
            font-weight: 700;
            margin: 15px 0 8px 10px;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 14px;
            border-radius: var(--radius-md);
            color: var(--text-muted);
            text-decoration: none;
            font-size: 0.88rem;
            font-weight: 500;
            transition: all 0.2s ease;
            cursor: pointer;
        }

        .nav-item:hover {
            color: white;
            background: rgba(255, 255, 255, 0.03);
        }

        .nav-item.active {
            color: white;
            background: rgba(99, 102, 241, 0.15);
            border: 1px solid rgba(99, 102, 241, 0.3);
            box-shadow: inset 0 0 10px rgba(99, 102, 241, 0.1);
        }

        .nav-item i {
            font-size: 1.05rem;
            width: 20px;
            text-align: center;
        }

        /* Sidebar Footer Specifications Trigger */
        .sidebar-footer {
            border-top: 1px solid var(--border);
            padding-top: 15px;
            margin-top: auto;
        }

        .btn-specs {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            padding: 12px;
            border-radius: var(--radius-md);
            background: rgba(16, 185, 129, 0.15);
            border: 1px solid rgba(16, 185, 129, 0.3);
            color: var(--success);
            font-weight: 700;
            font-size: 0.82rem;
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            transition: all 0.2s;
        }

        .btn-specs:hover {
            background: var(--success);
            color: white;
            box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
        }

        /* Main Workspace Content */
        .main-content {
            flex: 1;
            margin-left: 280px;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            background-image: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.05), transparent 50%);
            max-width: 100%;
            box-sizing: border-box;
            overflow-x: hidden;
        }

        .header-bar {
            padding: 18px 30px;
            background: rgba(17, 24, 39, 0.7);
            backdrop-filter: blur(12px);
            border-bottom: 1px solid var(--border);
            display: flex;
            justify-content: space-between;
            align-items: center;
            position: sticky;
            top: 0;
            z-index: 90;
        }

        .header-title h2 {
            font-size: 1.15rem;
            font-weight: 700;
            color: white;
        }

        .header-title p {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 2px;
        }

        .mobile-toggle {
            display: none;
            background: none;
            border: none;
            color: white;
            font-size: 1.3rem;
            cursor: pointer;
        }

        .dashboard-body {
            padding: 30px;
            flex: 1;
            max-width: 100%;
            box-sizing: border-box;
            overflow-x: hidden;
        }

        /* Tab Panels */
        .tab-panel {
            display: none;
            animation: fadeIn 0.4s ease;
        }

        .tab-panel.active {
            display: block;
        }

        /* Glass Cards */
        .glass-card {
            background: var(--bg-surface);
            backdrop-filter: blur(16px);
            border: 1px solid var(--border);
            border-radius: var(--radius-lg);
            padding: 25px;
            margin-bottom: 25px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            max-width: 100%;
            box-sizing: border-box;
        }

        .glass-card h3 {
            font-size: 1.1rem;
            font-weight: 700;
            color: white;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .glass-card p.subtitle {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-top: -10px;
            margin-bottom: 20px;
            line-height: 1.4;
        }

        /* Grids & Forms */
        .grid-2 {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 25px;
        }

        .grid-3 {
            display: grid;
            grid-template-columns: 1fr 1fr 1fr;
            gap: 20px;
        }

        .form-group {
            margin-bottom: 18px;
        }

        .form-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-muted);
            font-size: 0.82rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        input[type="text"],
        input[type="number"],
        select,
        textarea {
            width: 100%;
            padding: 12px 16px;
            border-radius: var(--radius-md);
            background: rgba(3, 5, 10, 0.6);
            border: 1px solid var(--border);
            color: white;
            font-size: 0.9rem;
            transition: all 0.2s;
        }

        input[type="text"]:focus,
        input[type="number"]:focus,
        select:focus,
        textarea:focus {
            outline: none;
            border-color: var(--primary);
            box-shadow: 0 0 8px rgba(99, 102, 241, 0.4);
            background: rgba(3, 5, 10, 0.8);
        }

        /* Buttons */
        .btn-primary {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 14px 24px;
            border-radius: var(--radius-md);
            background: var(--primary-gradient);
            border: none;
            color: white;
            font-weight: 700;
            font-size: 0.92rem;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
        }

        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
        }

        .btn-primary:active {
            transform: translateY(0);
        }

        /* Before/After Split Slider */
        .slider-container {
            width: 100%;
            position: relative;
            overflow: hidden;
            border-radius: var(--radius-md);
            aspect-ratio: 16/10;
            background: #000;
            border: 1px solid var(--border);
        }

        .slider-img {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }

        .slider-img img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            pointer-events: none;
            display: block;
        }

        .slider-after {
            z-index: 2;
            width: 50%;
        }

        .slider-before {
            z-index: 1;
        }

        .slider-handle {
            position: absolute;
            top: 0;
            bottom: 0;
            left: 50%;
            width: 4px;
            background: white;
            z-index: 3;
            cursor: ew-resize;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
            transform: translateX(-50%);
        }

        .slider-handle-button {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 40px;
            height: 40px;
            background: white;
            color: var(--bg-dark);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
            border: 2px solid var(--primary);
            font-size: 0.9rem;
        }

        .slider-label {
            position: absolute;
            bottom: 15px;
            padding: 4px 10px;
            background: rgba(0, 0, 0, 0.6);
            border-radius: 4px;
            font-size: 0.72rem;
            text-transform: uppercase;
            font-weight: 700;
            letter-spacing: 0.5px;
            z-index: 5;
        }

        .label-after {
            left: 15px;
            color: var(--success);
            border: 1px solid rgba(16, 185, 129, 0.4);
        }

        .label-before {
            right: 15px;
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.4);
        }

        /* Canvas Workspace for Measuring */
        .canvas-workspace {
            position: relative;
            background: #090d16;
            border-radius: var(--radius-md);
            border: 1px solid var(--border);
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            aspect-ratio: 16/10;
        }

        #measure-canvas {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            cursor: crosshair;
        }

        .laser-grid-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: linear-gradient(rgba(16, 185, 129, 0.03) 1px, transparent 1px),
                        linear-gradient(90deg, rgba(16, 185, 129, 0.03) 1px, transparent 1px);
            background-size: 20px 20px;
            pointer-events: none;
            z-index: 1;
        }

        .laser-scanner-line {
            position: absolute;
            left: 0;
            right: 0;
            height: 2px;
            background: var(--success);
            box-shadow: 0 0 10px var(--success);
            animation: scan 3s linear infinite;
            pointer-events: none;
            z-index: 2;
            display: none;
        }

        @keyframes scan {
            0% { top: 0%; }
            50% { top: 100%; }
            100% { top: 0%; }
        }

        /* Plant Spec Table */
        .plants-table, .calc-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 0.85rem;
            margin-top: 10px;
        }

        .plants-table th, .calc-table th {
            text-align: left;
            padding: 10px 12px;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border);
            text-transform: uppercase;
            font-size: 0.72rem;
            font-weight: 700;
        }

        .plants-table td, .calc-table td {
            padding: 12px;
            border-bottom: 1px dashed rgba(255, 255, 255, 0.04);
            color: var(--text-main);
        }

        .plants-table tr:hover, .calc-table tr:hover {
            background: rgba(255, 255, 255, 0.01);
        }

        .plant-badge {
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 0.7rem;
            font-weight: bold;
        }
        
        .badge-canopy { background: rgba(99, 102, 241, 0.15); color: #818cf8; border: 1px solid rgba(99, 102, 241, 0.3); }
        .badge-shrub { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
        .badge-ground { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
        .badge-flower { background: rgba(217, 70, 239, 0.15); color: #f472b6; border: 1px solid rgba(217, 70, 239, 0.3); }

        /* Floating Capture Controls */
        .capture-controls {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 10px;
            z-index: 10;
        }

        .btn-capture {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background: var(--primary-gradient);
            border: 2px solid white;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.15rem;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(99, 102, 241, 0.5);
            transition: all 0.2s;
        }

        .btn-capture:hover {
            transform: scale(1.08);
        }

        /* SVG Wireframe Container */
        .svg-container {
            width: 100%;
            height: 320px;
            background: rgba(3, 5, 10, 0.5);
            border: 1px solid var(--border);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .svg-container svg {
            width: 100%;
            height: 100%;
        }

        /* Modal Overlay */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(3, 7, 18, 0.85);
            backdrop-filter: blur(8px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: rgba(17, 24, 39, 0.95);
            border: 1px solid var(--border);
            width: 100%;
            max-width: 900px;
            max-height: 85vh;
            border-radius: var(--radius-lg);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow: 0 25px 50px rgba(0,0,0,0.5);
            animation: scaleUp 0.3s ease;
        }

        @keyframes scaleUp {
            from { transform: scale(0.95); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }

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

        .modal-header h3 {
            color: white;
            font-size: 1.15rem;
            font-weight: 700;
        }

        .btn-close {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 1.25rem;
            cursor: pointer;
        }

        .btn-close:hover {
            color: white;
        }

        .modal-body {
            padding: 25px;
            overflow-y: auto;
            flex: 1;
            font-family: var(--font-mono);
            font-size: 0.85rem;
            background: #050811;
            color: #93c5fd;
            line-height: 1.5;
        }

        .modal-footer {
            padding: 15px 25px;
            border-top: 1px solid var(--border);
            display: flex;
            justify-content: flex-end;
            gap: 12px;
        }

        .spec-section {
            margin-bottom: 25px;
            border-left: 2px solid var(--primary);
            padding-left: 15px;
        }

        .spec-section h4 {
            color: white;
            font-size: 0.9rem;
            margin-bottom: 10px;
            text-transform: uppercase;
        }

        /* Responsive Design */
        @media (max-width: 1024px) {
            .sidebar {
                transform: translateX(-100%);
            }
            .sidebar.open {
                transform: translateX(0);
            }
            .main-content {
                margin-left: 0;
            }
            .mobile-toggle {
                display: block;
            }
            .grid-2 {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .dashboard-body {
                padding: 12px;
            }
            .glass-card {
                padding: 16px;
                margin-bottom: 16px;
            }
            .header-bar {
                padding: 12px 16px;
            }
            .mobile-flex-col {
                flex-direction: column !important;
            }
        }

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

        /* Visual Presets Carousel & Categories */
        .preset-categories {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-top: 15px;
            margin-bottom: 12px;
            border-bottom: 1px solid var(--border);
            padding-bottom: 8px;
        }

        .category-tab-btn {
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid var(--border);
            color: var(--text-muted);
            padding: 8px 16px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .category-tab-btn:hover {
            color: white;
            background: rgba(99, 102, 241, 0.1);
            border-color: rgba(99, 102, 241, 0.3);
        }

        .category-tab-btn.active {
            background: var(--primary-gradient);
            color: white;
            border-color: transparent;
            box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
        }

        .presets-carousel-container {
            position: relative;
            margin-top: 5px;
        }

        .presets-carousel {
            display: flex;
            gap: 12px;
            overflow-x: auto;
            padding: 5px 2px 12px 2px;
            scroll-behavior: smooth;
            scrollbar-width: thin;
            scrollbar-color: var(--border) transparent;
        }

        .presets-carousel::-webkit-scrollbar {
            height: 6px;
        }

        .presets-carousel::-webkit-scrollbar-track {
            background: transparent;
        }

        .presets-carousel::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 3px;
        }

        .presets-carousel::-webkit-scrollbar-thumb:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .preset-card {
            flex: 0 0 125px;
            height: 125px;
            position: relative;
            border-radius: var(--radius-md);
            overflow: hidden;
            border: 2px solid var(--border);
            cursor: pointer;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
        }

        .preset-card:hover {
            transform: translateY(-3px);
            border-color: rgba(255, 255, 255, 0.3);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        }

        .preset-card:hover img {
            transform: scale(1.08);
        }

        .preset-card.active {
            border-color: #a855f7;
            box-shadow: 0 0 15px rgba(168, 85, 247, 0.6);
        }

        .preset-card img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .preset-card-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(to top, rgba(3, 7, 18, 0.95) 0%, rgba(3, 7, 18, 0.7) 60%, transparent 100%);
            padding: 8px;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            height: 60%;
        }

        .preset-card-title {
            font-size: 0.75rem;
            font-weight: 700;
            color: white;
            line-height: 1.2;
            margin-bottom: 2px;
        }

        .preset-card-desc {
            font-size: 0.6rem;
            color: var(--text-muted);
            line-height: 1.1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        @keyframes arScan {
            0% { top: 10%; }
            50% { top: 90%; }
            100% { top: 10%; }
        }