        :root {
            --bg-grad-1: #0f172a;
            --bg-grad-2: #1e1b4b;
            --card-bg: rgba(255, 255, 255, 0.05);
            --card-border: rgba(255, 255, 255, 0.1);
            --text-primary: #f8fafc;
            --text-secondary: #94a3b8;
            --accent: #6366f1;
            --accent-glow: rgba(99, 102, 241, 0.4);
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: rgba(255, 255, 255, 0.02);
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb {
            background: rgba(99, 102, 241, 0.3);
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: rgba(99, 102, 241, 0.5);
        }

        body {
            margin: 0;
            padding: 0;
            font-family: 'Outfit', sans-serif;
            background: linear-gradient(135deg, var(--bg-grad-1), var(--bg-grad-2));
            color: var(--text-primary);
            overflow: hidden; /* Important for app layout */
        }

        .app-layout {
            display: flex;
            width: 100vw;
            height: 100vh;
        }

        /* Sidebar */
        .sidebar {
            width: 350px;
            height: 100vh;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            align-items: center;
            flex-shrink: 0;
            border-right: 1px solid var(--card-border);
            background: rgba(15, 23, 42, 0.3);
            backdrop-filter: blur(10px);
        }

        /* Detail Panel */
        .detail-panel {
            flex: 1;
            height: 100vh;
            overflow-y: auto;
            padding: 0 3rem 3rem 3rem;
            box-sizing: border-box;
            background: rgba(0, 0, 0, 0.2);
        }
        
        #detail-content {
            padding-top: 3rem;
            box-sizing: border-box;
            width: 100%;
        }

        @keyframes fadeIn {
            to { opacity: 1; }
        }

        header {
            width: 100%;
            padding: 2rem 0;
            text-align: center;
            background: rgba(15, 23, 42, 0.3);
            backdrop-filter: blur(10px);
            border-bottom: 1px solid var(--card-border);
            position: sticky;
            top: 0;
            z-index: 10;
        }

        h1 {
            margin: 0;
            font-size: 1.8rem;
            font-weight: 600;
            background: linear-gradient(to right, #a5b4fc, #e0e7ff);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 0 20px var(--accent-glow);
        }

        .container {
            width: 90%;
            display: flex;
            flex-direction: column;
            gap: 1rem;
            padding-top: 1.5rem;
            padding-bottom: 2rem;
        }

        /* Glassmorphism Card Style */
        .card {
            background: var(--card-bg);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 1px solid var(--card-border);
            border-radius: 12px;
            padding: 1.2rem 1.5rem;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            cursor: pointer;
        }

        .card:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4), 0 0 15px var(--accent-glow);
            border-color: rgba(99, 102, 241, 0.5);
        }

        .card.selected {
            border-color: var(--accent);
            background: rgba(99, 102, 241, 0.2);
            box-shadow: inset 0 0 20px rgba(99, 102, 241, 0.2), 0 0 15px var(--accent-glow);
        }

        .card-text {
            font-size: 1.1rem;
            font-weight: 400;
        }

        .card-list {
            width: 90%;
            margin: 1.5rem auto 2rem auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        /* Skeleton Loader */
        .skeleton {
            background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
            background-size: 200% 100%;
            animation: loading 1.5s infinite;
            border-radius: 12px;
            height: 60px;
            width: 100%;
        }
        
        /* Big skeleton for main panel */
        .skeleton-block {
            height: 120px;
            border-radius: 16px;
            margin-top: 2rem;
        }

        @keyframes loading {
            0% { background-position: 200% 0; }
            100% { background-position: -200% 0; }
        }

        /* Search Bar */
        .search-container {
            width: 90%;
            margin: 1rem auto 0;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 0.8rem 1.2rem;
            border-radius: 30px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
            font-size: 1rem;
            font-family: 'Outfit', sans-serif;
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
            box-sizing: border-box;
            outline: none;
        }

        .search-input:focus {
            background: rgba(15, 23, 42, 0.8);
            border-color: var(--accent);
            box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
        }

        .search-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .error {
            color: #ef4444;
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid rgba(239, 68, 68, 0.3);
            padding: 1rem;
            border-radius: 8px;
            text-align: center;
        }

        /* Hero Image Banner */
        .hero-banner {
            width: 100%;
            background-color: rgba(0, 0, 0, 0.4); 
            border-radius: 16px;
            border: 1px solid var(--card-border);
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(12px);
        }

        .hero-banner img {
            width: 100%;
            height: auto;
            max-height: 25vh;
            object-fit: contain;
            display: block;
        }

        .hero-placeholder {
            width: 80px;
            height: 80px;
            opacity: 0.2;
            fill: var(--text-primary);
        }

        /* Details View Grid */
        .detail-header-title {
            font-size: 2.2rem;
            margin: 0 0 0.5rem 0;
            color: #fff;
        }

        .detail-jobid-badge {
            display: inline-block;
            background: var(--card-bg);
            border: 1px solid var(--accent);
            color: #a5b4fc;
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            font-size: 0.9rem;
            margin-bottom: 2rem;
        }

        /* Editable Field Styling */
        .editable-field {
            cursor: pointer;
            position: relative;
            display: inline-block;
            border-bottom: 1px dashed rgba(255, 255, 255, 0.3);
            transition: all 0.2s;
        }
        .editable-field:hover {
            color: #a5b4fc !important;
            border-bottom-color: #a5b4fc;
        }
        
        .detail-card {
            background: var(--card-bg);
            backdrop-filter: blur(12px);
            border: 1px solid var(--card-border);
            border-radius: 16px;
            padding: 2rem;
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
        }

        .detail-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        .detail-grid.compact {
            grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
            gap: 1rem;
        }
        
        .detail-grid.compact .detail-value {
            font-size: 1rem;
        }

        .detail-grid.compact .detail-item {
            padding: 0.8rem;
        }

        /* Budget Table Styling */
        .budget-table {
            width: 100%;
            table-layout: fixed;
            border-collapse: separate;
            border-spacing: 0;
            text-align: left;
            font-family: 'Outfit', sans-serif;
            color: var(--text-primary);
        }
        
        .budget-table th {
            color: #94a3b8;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 1rem 0.5rem;
            border-bottom: 2px solid rgba(99, 102, 241, 0.4);
            background: #0f172a !important;
            position: sticky;
            top: 0;
            z-index: 100 !important;
            transform: translateZ(1px);
            -webkit-transform: translateZ(1px);
        }
        
        .budget-table th:first-child {
            border-top-left-radius: 16px;
            padding-left: 1.5rem;
        }
        
        .budget-table th:last-child {
            border-top-right-radius: 16px;
            padding-right: 1.5rem;
        }
        
        .budget-table td {
            padding: 1rem 0.5rem;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            font-size: 1rem;
        }
        
        .budget-table td:first-child {
            padding-left: 1.5rem;
        }
        
        .budget-table td:last-child {
            padding-right: 1.5rem;
        }
        
        .budget-table tr:hover:not(:last-child) {
            background: rgba(255,255,255,0.03);
            transition: background 0.2s;
        }
        
        /* Custom Tooltip */
        .has-tooltip {
            position: relative;
            cursor: help;
        }
        
        .has-tooltip .tooltip-content {
            visibility: hidden;
            opacity: 0;
            position: absolute;
            bottom: 100%;
            right: 0;
            transform: translateY(10px);
            background: rgba(15, 23, 42, 0.95);
            border: 1px solid rgba(255, 255, 255, 0.1);
            color: #e2e8f0;
            text-align: center;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            font-size: 0.85rem;
            font-weight: 300;
            white-space: normal;
            min-width: 250px;
            z-index: 50;
            transition: all 0.2s ease-in-out;
            pointer-events: none;
            box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(10px);
        }
        
        .has-tooltip .tooltip-content::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            height: 20px;
        }
        
        .has-tooltip:hover .tooltip-content {
            visibility: visible;
            opacity: 1;
            transform: translateY(-8px);
            pointer-events: auto;
        }
        
        .budget-table th {
            color: #94a3b8;
            font-size: 0.85rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            padding: 1rem;
            border-bottom: 2px solid rgba(255,255,255,0.1);
            background: rgba(0,0,0,0.2);
        }
        
        .budget-table td {
            padding: 1rem;
            border-bottom: 1px solid rgba(255,255,255,0.05);
            font-size: 1rem;
        }
        
        .budget-table tr:hover:not(:last-child) {
            background: rgba(255,255,255,0.03);
            transition: background 0.2s;
        }

        .detail-item {
            background: rgba(255,255,255,0.03);
            padding: 1.2rem;
            border-radius: 10px;
            border: 1px solid rgba(255,255,255,0.05);
            transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
        }
        
        .detail-item.editable-item {
            cursor: text;
        }

        .detail-item.editable-item:not(.editing):hover {
            background: rgba(255,255,255,0.08);
            border-color: rgba(99, 102, 241, 0.4);
            box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
        }
        
        .detail-item.editing {
            background: rgba(99, 102, 241, 0.1);
            border-color: var(--accent);
            box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
        }

        .inline-edit-input {
            width: 100%;
            background: rgba(0,0,0,0.3);
            border: 1px solid var(--accent);
            color: var(--text-primary);
            font-family: 'Outfit', sans-serif;
            font-size: 1.15rem;
            padding: 0.4rem 0.6rem;
            border-radius: 6px;
            outline: none;
            box-sizing: border-box;
            margin-top: 0.3rem;
            margin-bottom: 0.2rem;
        }
        
        .inline-edit-input:focus {
            box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
        }

        .inline-edit-hint {
            font-size: 0.75rem;
            color: #818cf8;
            opacity: 0.8;
            margin-top: 0.2rem;
        }

        .spinner-small {
            width: 16px;
            height: 16px;
            border: 2px solid rgba(255,255,255,0.1);
            border-top: 2px solid var(--accent);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .detail-label {
            font-size: 0.8rem;
            color: #818cf8;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

        .detail-value {
            font-size: 1.15rem;
            color: var(--text-primary);
            line-height: 1.4;
            word-wrap: break-word;
        }

        /* Responsive Mobile Layout Navigation */
        
        .sidebar-menu-content {
            display: flex;
            flex-direction: column;
            width: 100%;
            height: 100%;
            overflow-y: auto;
        }
        
        .mobile-selected-label {
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        /* Top Navigation Layout (Applied Globally) */
        .app-layout {
            flex-direction: column;
        }
        .sidebar {
            width: 100%;
            height: auto;
            border-right: none;
            border-bottom: 1px solid var(--card-border);
            position: relative;
            z-index: 50;
            overflow: visible;
        }
        header {
            padding: 0.5rem 0;
            position: relative;
        }
        .mobile-top-bar {
            display: flex;
            flex-direction: column;
            align-items: center;
            width: 100%;
        }
        .app-title {
            font-size: 1.5rem;
        }

        .sidebar-menu-content {
            display: none;
            position: absolute;
            top: calc(100% + 10px);
            left: 0;
            width: 100%;
            height: auto;
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border: 1px solid rgba(99, 102, 241, 0.3);
            border-radius: 12px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 30px rgba(99, 102, 241, 0.25);
            max-height: 60vh;
            z-index: 100;
            padding-top: 1rem;
            padding-bottom: 1rem;
            text-align: left;
        }
        .sidebar-menu-content.active {
            display: flex;
        }

        .card-list {
            width: 90%;
            margin: 0.5rem auto 1rem auto;
        }
        .detail-panel {
            width: 100%;
            padding: 0 1.5rem 1.5rem 1.5rem;
            max-width: 1600px;
            margin: 0 auto;
            flex: 1;
        }
        #detail-content {
            padding-top: 1.5rem;
        }
        .detail-header-title {
            font-size: 2rem;
        }
        #budget-header-stats .detail-card {
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
            gap: 1.5rem !important;
        }
        #budget-header-stats > div > div {
            border-right: 1px solid rgba(255,255,255,0.1) !important;
            padding-right: 1.5rem !important;
            border-bottom: none;
            padding-bottom: 0;
        }
        #budget-header-stats > div > div:last-child {
            border-right: none !important;
            padding-right: 0 !important;
        }

        @media (max-width: 900px) {
            .budget-table th {
                font-size: 0.75rem;
                padding: 0.8rem 0.5rem;
            }
            .budget-table td {
                font-size: 0.85rem;
                padding: 0.8rem 0.5rem;
            }
        }
        
        @media (max-width: 600px) {
            .budget-table th {
                font-size: 0.65rem;
                padding: 0.6rem 0.4rem;
            }
            .budget-table td {
                font-size: 0.75rem;
                padding: 0.6rem 0.4rem;
            }
            .budget-table th:first-child, .budget-table td:first-child {
                padding-left: 0.8rem;
            }
            .budget-table th:last-child, .budget-table td:last-child {
                padding-right: 0.8rem;
            }
        }
        
        @keyframes pulse {
            0%, 100% { opacity: 1; text-shadow: 0 0 8px rgba(165, 180, 252, 0.5); }
            50% { opacity: 0.4; }
        }
        
        .pulse-text {
            animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
            color: #a5b4fc;
        }

        .refresh-qb-btn {
            background: rgba(99, 102, 241, 0.2);
            border: 1px solid rgba(99, 102, 241, 0.4);
            color: #a5b4fc;
            padding: 0.3rem 0.6rem;
            border-radius: 4px;
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .refresh-qb-btn:hover {
            background: rgba(99, 102, 241, 0.4);
        }

        .map-action-btn {
            background: rgba(99, 102, 241, 0.2);
            border: 1px solid rgba(99, 102, 241, 0.4);
            color: #a5b4fc;
            padding: 0.4rem 0.8rem;
            border-radius: 8px;
            font-size: 0.85rem;
            font-weight: 500;
            font-family: 'Outfit', sans-serif;
            cursor: pointer;
            transition: all 0.2s ease;
            backdrop-filter: blur(8px);
            white-space: nowrap;
        }
        
        .map-action-btn:hover {
            background: rgba(99, 102, 241, 0.4);
            box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
        }

        .map-action-btn.btn-danger {
            background: rgba(239, 68, 68, 0.15);
            border-color: rgba(239, 68, 68, 0.4);
            color: #fca5a5;
        }

        .map-action-btn.btn-danger:hover {
            background: rgba(239, 68, 68, 0.35);
            box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
        }

        .map-action-btn.btn-success {
            background: rgba(16, 185, 129, 0.15);
            border-color: rgba(16, 185, 129, 0.4);
            color: #6ee7b7;
        }

        .map-action-btn.btn-success:hover {
            background: rgba(16, 185, 129, 0.35);
            box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
        }

        .is-final-row {
            background: rgba(16, 185, 129, 0.05);
        }
        
        .is-final-row td {
            border-bottom: 1px solid rgba(16, 185, 129, 0.1);
        }

        /* ── Per-Line-Item Preliminary Styles ─────────────────────────────── */
        .is-preliminary-row {
            background: rgba(245, 158, 11, 0.06);
        }

        .is-preliminary-row td {
            border-bottom: 1px solid rgba(245, 158, 11, 0.12);
        }

        .is-preliminary-row td:first-child {
            border-left: 3px solid #f59e0b;
        }

        /* Preliminary toggle button — mirrors .lock-btn */
        .prelim-btn {
            background: none;
            border: none;
            padding: 4px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s;
            outline: none;
        }

        .prelim-btn:hover {
            background: rgba(245, 158, 11, 0.15);
        }

        .prelim-btn:disabled,
        .prelim-btn[disabled] {
            cursor: not-allowed;
            opacity: 0.3;
        }
        
        .lock-cell {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .lock-btn {
            background: none;
            border: none;
            padding: 4px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: all 0.2s;
            outline: none;
        }

        .lock-btn:hover {
            background: rgba(255,255,255,0.1);
        }

        .item-lock.open-lock {
            color: rgba(255,255,255,0.3);
        }
        
        .item-lock.closed-lock {
            filter: drop-shadow(0 0 4px rgba(16, 185, 129, 0.5));
        }

        .lock-cell .code-text {
            flex-grow: 1;
        }
        @media print {
            @page {
                size: letter portrait;
                margin: 0.25in;
            }
            body, html {
                background: white !important;
                color: black !important;
                overflow: visible !important;
                font-family: Arial, Helvetica, sans-serif !important;
                height: auto !important;
            }
            /* Hide all interactive elements */
            .sidebar, header#sidebar-header, .refresh-qb-btn, .mobile-top-bar, #global-back-btn, button, .detail-jobid-badge, .lock-btn, .has-tooltip .tooltip-content, .print-hide {
                display: none !important;
            }
            .app-layout, .detail-panel {
                display: block !important;
                height: auto !important;
                overflow: visible !important;
                background: white !important;
            }
            .detail-panel[style*="display: none"],
            .detail-panel[style*="display:none"] {
                display: none !important;
            }
            .detail-panel {
                padding: 0 !important;
                width: 100% !important;
                max-width: 100% !important;
            }
            #detail-content {
                padding-top: 0 !important;
                display: block !important;
            }
            
            /* Header sizing */
            h2.detail-header-title {
                color: black !important;
                background: none !important;
                -webkit-text-fill-color: black !important;
                text-shadow: none !important;
                margin: 0 0 0.1rem 0 !important;
                font-size: 1.1rem !important;
                font-weight: bold !important;
            }
            .detail-builder {
                color: black !important;
                font-size: 1.1rem !important;
                font-weight: bold !important;
                margin-bottom: 0 !important;
            }
            .detail-neighborhood {
                color: #555 !important;
                font-size: 0.9rem !important;
            }
            .detail-subtitle {
                color: #333 !important;
                font-size: 0.85rem !important;
                margin: 0 0 0.5rem 0 !important;
            }

            /* Remove borders and padding for compact look */
            .detail-card {
                background: white !important;
                border: none !important;
                box-shadow: none !important;
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
                padding: 0 !important;
                margin-bottom: 1rem !important;
                break-inside: avoid;
            }
            #budget-header-wrapper {
                margin-bottom: 0 !important;
                float: left !important;
                width: 48% !important;
            }
            .detail-card * {
                color: black !important;
            }

            /* Editable fields should look like flat text */
            .editable-field {
                border-bottom: none !important;
                pointer-events: none !important;
                color: black !important;
            }

            /* Budget Header Grid Flattening */
            #budget-header-stats {
                float: right !important;
                width: 48% !important;
                margin: 0 !important;
            }
            #budget-header-stats * {
                font-size: 0.65rem !important;
            }
            .profit-row {
                border-top: 1px solid black !important;
                padding-top: 0.2rem !important;
                margin-top: 0.2rem !important;
            }
            #budget-header-stats .detail-card {
                display: flex !important;
                flex-direction: row !important;
                justify-content: flex-end !important;
                gap: 1.5rem !important;
            }
            #budget-header-stats > div > div:first-child {
                display: none !important;
            }
            #budget-header-stats > div > div {
                border-right: none !important;
                padding-right: 0 !important;
                flex: 0 0 auto !important;
                width: 180px !important;
            }

            #budget-container {
                clear: both !important;
                display: block !important;
                width: 100% !important;
                page-break-before: avoid !important;
                break-before: avoid !important;
                padding-top: 0.25rem !important; /* Move table physically closer to the page header block */
            }

            /* Compact Table Styling */
            .budget-table {
                clear: both !important;
                width: 100% !important;
                border: none !important;
                border-radius: 0 !important;
                border-collapse: collapse !important;
                border-spacing: 0 !important;
                page-break-inside: auto;
                color: black !important;
                table-layout: auto !important; /* Force natural column scaling */
                font-size: 7pt !important;
            }
            .budget-table tr {
                page-break-inside: avoid;
                page-break-after: auto;
                border: none !important;
            }
            .budget-table th {
                display: table-cell !important;
                position: static !important;
                background: #4F81BD !important; /* Excel default table blue */
                color: white !important;
                font-weight: bold !important;
                border: none !important;
                border-bottom: 2px solid #4F81BD !important;
                padding: 3px 4px !important;
                text-transform: uppercase !important;
                font-size: 8pt !important;
                border-radius: 0 !important;
                text-align: right !important;
                white-space: nowrap !important;
            }
            .budget-table th:first-child {
                text-align: left !important;
            }
            .budget-table td {
                display: table-cell !important;
                position: static !important;
                color: black !important;
                padding: 1px 4px !important;
                border: none !important;
                vertical-align: middle !important;
                white-space: nowrap !important;
                font-size: 7pt !important;
            }
            .lock-cell {
                display: table-cell !important;
            }
            /* Zebra striping for readability */
            .budget-table tbody tr:nth-child(even) td {
                background-color: #F2F2F2 !important;
            }
            .budget-table tbody tr:nth-child(odd) td {
                background-color: #ffffff !important;
            }
            .is-final-row td {
                background-color: #D9D9D9 !important;
                font-weight: normal !important;
                border-top: 2px solid #ccc !important;
                border-bottom: 2px solid #ccc !important;
            }
            .is-preliminary-row td {
                background-color: #FFF9C4 !important;
                font-style: italic !important;
                border-left: 3px solid #f59e0b !important;
            }
            .prelim-btn {
                display: none !important;
            }
            h2, h3, div, span, td, th {
                color: black !important;
            }
            * {
                -webkit-print-color-adjust: exact !important;
                print-color-adjust: exact !important;
            }
            .editable-field {
                border: none !important;
            }
        }

/* WIP Matrix Styles */
#wip-matrix-container {
    font-family: 'Inter', sans-serif;
}
.wip-table-wrapper {
    background: rgba(30, 41, 59, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    min-width: 100%;
    width: max-content;
    box-sizing: border-box;
    margin-bottom: 1rem;
    flex-shrink: 0;
}
.wip-group-header {
    padding: 16px 20px;
    height: 56px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: -1px; /* -1px to prevent any sub-pixel gap at the top */
    z-index: 20;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.wip-group-title {
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
    margin: 0;
}
.wip-group-actions button {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
}
.wip-group-actions button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}
.wip-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
}
.wip-table th {
    color: #94a3b8;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem;
    border-bottom: 2px solid rgba(99, 102, 241, 0.4);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    white-space: nowrap;
    position: sticky;
    top: 55px;
    z-index: 15;
}
.wip-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    font-size: 1rem;
    white-space: nowrap;
}
.wip-table tr {
    transition: background 0.2s;
}
.wip-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}
.wip-row-drag-handle, .wip-group-drag-handle {
    cursor: grab;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    border-radius: 4px;
    color: #64748b;
    transition: background 0.2s, color 0.2s;
}
.wip-row-drag-handle:hover, .wip-group-drag-handle:hover {
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
}
.wip-row-drag-handle:active, .wip-group-drag-handle:active {
    cursor: grabbing;
}
.wip-job-row-remove {
    background: transparent;
    border: none;
    color: #ef4444;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 1.2rem;
    padding: 2px 6px;
    border-radius: 4px;
}
.wip-table tbody tr:hover .wip-job-row-remove {
    opacity: 0.7;
}
.wip-job-row-remove:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.1);
}
.wip-sortable-ghost {
    opacity: 0.4;
    background: rgba(99, 102, 241, 0.2);
}

/* --- DATA POINT SELECTOR MODAL --- */
.dp-item {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255,255,255,0.1);
    color: #f8fafc;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    cursor: grab;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s, background 0.2s;
}
.dp-item:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(30, 41, 59, 1);
}
.dp-item:active {
    cursor: grabbing;
}
.dp-item-tooltip {
    color: #94a3b8;
    font-size: 0.75rem;
    margin-left: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}
.dp-sortable-ghost {
    opacity: 0.4;
    background: #475569;
    border: 1px dashed rgba(99, 102, 241, 0.8);
}
#dp-available-list .dp-format-gear { display: none !important; }

/* Premium Popup Styles */
.premium-popup .leaflet-popup-content-wrapper {
    padding: 0;
    background: #111622;
    border: 1px solid #c2a66b;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
}
.premium-popup .leaflet-popup-content {
    margin: 0;
    width: 240px !important;
}
.premium-popup .leaflet-popup-tip {
    background: #111622;
    border: 1px solid #c2a66b;
    border-top: none;
    border-left: none;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.5);
}

/* Leaflet Premium Tooltip styling */
.leaflet-tooltip.premium-tooltip {
    background: #111622;
    color: #ffffff;
    border: 1px solid #c2a66b;
    border-radius: 8px;
    padding: 10px;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    white-space: nowrap;
}
.leaflet-tooltip.premium-tooltip::before {
    border-top-color: #c2a66b;
}
