/* --- APP MODULE WORKSPACE STANDARDS --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: #0a0603;
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* --- BACKGROUND DESIGN UNDERLAYS --- */
.workspace-bg {
    position: fixed;
    width: 100vw;
    height: 100vh;
    top: 0;
    left: 0;
    z-index: 1;
    background-image: 
        linear-gradient(rgba(255, 82, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 82, 0, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.ambient-glow {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(255, 82, 0, 0.05) 0%, transparent 70%);
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
}

/* --- APP CONTAINMENT WRAPPER --- */
.app-container {
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    z-index: 2;
    position: relative;
}

/* --- APPARATUS HEADER BRANDING --- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 82, 0, 0.1);
    margin-bottom: 40px;
}

.brand-logo {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.brand-logo span {
    color: #FF5200;
}

.system-badge {
    display: inline-flex;
    align-items: center;
    background: rgba(255, 82, 0, 0.03);
    border: 1px solid rgba(255, 82, 0, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #FF5200;
    letter-spacing: 1px;
}

.pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #FF5200;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 8px #FF5200;
    animation: pulseGlow 1.6s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 82, 0, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(255, 82, 0, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(255, 82, 0, 0); }
}

/* --- DUAL SEGMENTED THEME SWITCH (LIGHT / DARK) --- */
.theme-switch-wrapper {
    display: inline-flex;
    align-items: center;
    background: #1c1511;
    border: 1px solid rgba(255, 82, 0, 0.25);
    padding: 3px;
    border-radius: 999px;
    gap: 3px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: all 0.25s ease;
}

.theme-mode-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: #9ca3af;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.theme-mode-btn:hover {
    color: #ffffff;
}

.theme-mode-btn.active {
    background: #2b1e17;
    color: #ffffff;
    border-color: #FF5200;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6), 0 0 12px rgba(255, 82, 0, 0.25);
}

.theme-mode-btn.active .mode-icon {
    transform: scale(1.15);
}

.mode-icon {
    font-size: 0.92rem;
    line-height: 1;
    display: inline-block;
    transition: transform 0.2s ease;
}

.mode-label {
    letter-spacing: 0.2px;
}

/* --- MAIN INTERACTION CARD WORKSPACE --- */
.workspace-card {
    background: #110e0c;
    border: 1px solid rgba(255, 82, 0, 0.15);
    border-radius: 16px;
    padding: 30px 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    margin-bottom: 30px;
    max-width: 1480px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.db-schedule-card {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.grid-table-container {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    border-radius: 8px;
    scrollbar-width: thin;
}

.db-schedule-table-header,
.room-input-row,
.compliance-grid-row {
    width: 100%;
    max-width: 100%;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    box-sizing: border-box !important;
    gap: 5px;
    min-width: 0 !important;
}

.room-input-row > div,
.compliance-grid-row > div,
.db-schedule-table-header > div {
    min-width: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 1 !important;
}

.room-input-row select,
.room-input-row input,
.compliance-grid-row select,
.compliance-grid-row input,
.grid-cell {
    font-size: 0.76rem !important;
    height: 30px !important;
    padding: 3px 6px !important;
    border-radius: 6px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    text-overflow: ellipsis !important;
    background: #1a1613;
    border: 1px solid rgba(255, 82, 0, 0.15);
    color: #ffffff;
    outline: none;
    transition: border-color 0.2s;
}

.room-input-row select:focus,
.room-input-row input:focus,
.compliance-grid-row select:focus,
.compliance-grid-row input:focus,
.grid-cell:focus {
    border-color: #FF5200 !important;
}

.card-head h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #f3f4f6;
}

.card-head p {
    font-size: 0.95rem;
    color: #9ca3af;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* --- AI MODEL SELECTION CARD (SHIFTED TO TOP WITH SEPARATE BORDER DESIGN) --- */
.model-selection-card,
.model-selection-wrapper {
    background: linear-gradient(135deg, rgba(255, 82, 0, 0.05) 0%, rgba(22, 17, 15, 0.95) 100%);
    border: 1.5px solid rgba(255, 82, 0, 0.32);
    border-left: 5px solid #FF5200;
    border-radius: 14px;
    padding: 16px 20px;
    margin-bottom: 28px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.25s ease;
}

.model-selection-card:hover,
.model-selection-wrapper:hover {
    border-color: rgba(255, 82, 0, 0.48);
    box-shadow: 0 6px 24px rgba(255, 82, 0, 0.09), 0 2px 8px rgba(0, 0, 0, 0.4);
}

.model-selection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.model-selection-card .control-label,
.model-selection-wrapper .control-label {
    display: inline-flex; 
    align-items: center;
    gap: 7px;
    font-size: 0.78rem; 
    font-weight: 700; 
    text-transform: uppercase; 
    letter-spacing: 1.3px; 
    color: #e4e4e7; 
    margin-bottom: 0;
}

.mode-select-icon {
    font-size: 0.92rem;
    color: #FF5200;
}

.pro-status-badge-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: #FF5200;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 12px;
    border-radius: 20px;
    background: rgba(255, 82, 0, 0.08);
    border: 1px solid rgba(255, 82, 0, 0.28);
    transition: all 0.2s ease;
    text-decoration: none;
}

.pro-status-badge-link:hover {
    background: rgba(255, 82, 0, 0.16);
    border-color: rgba(255, 82, 0, 0.45);
    transform: translateY(-1px);
}

.pro-status-badge-link.pro-unlocked,
.pro-status-badge-link:has([style*="34d399"]) {
    background: rgba(52, 211, 153, 0.08) !important;
    border-color: rgba(52, 211, 153, 0.35) !important;
    color: #34d399 !important;
}

.model-select-control-box {
    position: relative;
    width: 100%;
}

.model-selection-card select,
.model-selection-wrapper select {
    width: 100%; 
    background: #14110f; 
    border: 1.5px solid rgba(255, 82, 0, 0.28); 
    color: #ffffff; 
    padding: 13px 18px; 
    border-radius: 9px; 
    font-weight: 600; 
    outline: none; 
    transition: all 0.25s ease; 
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.model-selection-card select:focus,
.model-selection-wrapper select:focus {
    border-color: #FF5200;
    box-shadow: 0 0 0 3px rgba(255, 82, 0, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.model-selection-card select option,
.model-selection-wrapper select option {
    background: #181412;
    color: #ffffff;
    padding: 10px;
}

/* --- DXF OPTIMIZATION GUIDELINES CARD --- */
.dxf-guidelines-card {
    background: #181412;
    border: 1px solid rgba(255, 82, 0, 0.25);
    border-left: 4px solid #FF5200;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.guidelines-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.guidelines-icon {
    font-size: 1.2rem;
}

.guidelines-header h4 {
    color: #FF5200;
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.guidelines-list {
    margin: 0;
    padding-left: 20px;
    color: #c9c7c5;
    font-size: 0.85rem;
    line-height: 1.6;
}

.guidelines-list li {
    margin-bottom: 8px;
}

.guidelines-list li:last-child {
    margin-bottom: 0;
}

.guidelines-list code {
    background: #0e0c0b;
    color: #FF5200;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8rem;
    border: 1px solid rgba(255, 82, 0, 0.2);
}

.guidelines-list strong {
    color: #ffffff;
}

/* --- DRAG & DROP ZONE DESIGN --- */
.drop-zone {
    width: 100%;
    min-height: 220px;
    border: 2px dashed rgba(255, 82, 0, 0.25);
    background: rgba(20, 17, 15, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.drop-zone:hover, .drop-zone.drag-active {
    border-color: #FF5200;
    background: rgba(255, 82, 0, 0.02);
    box-shadow: 0 0 20px rgba(255, 82, 0, 0.05);
}

.interactive-icon {
    font-size: 2.8rem;
    margin-bottom: 15px;
    display: inline-block;
    transition: transform 0.3s ease;
}

.drop-zone:hover .interactive-icon {
    transform: translateY(-4px);
}

.drop-zone h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e5e7eb;
    margin-bottom: 6px;
}

.drop-zone p {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 12px;
}

.browse-highlight {
    color: #FF5200;
    font-weight: 600;
}

.file-spec-hint {
    font-size: 0.75rem;
    color: #6b7280;
    display: block;
}

#fileInput {
    display: none;
}

/* --- MONITOR PANEL STATE VIEW --- */
.file-monitor-panel {
    display: none;
    background: #181412;
    border: 1px solid rgba(255, 82, 0, 0.1);
    border-radius: 8px;
    padding: 20px;
    margin-top: 25px;
}

.file-monitor-panel.panel-visible {
    display: block;
    animation: slideEmerge 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideEmerge {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.file-details {
    display: flex;
    align-items: center;
    gap: 14px;
}

.monitored-icon { font-size: 1.5rem; }

.file-details .meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.monitored-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f3f4f6;
}

.monitored-size {
    font-size: 0.75rem;
    color: #9ca3af;
}

/* --- PROCESSING STATES VISUAL METRICS --- */
.processing-core-wrapper {
    padding: 30px 0;
    text-align: center;
}

.processing-gear {
    font-size: 3.5rem;
    display: inline-block;
    animation: spinGear 3s infinite linear;
}

@keyframes spinGear {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.processing-core-wrapper h3 {
    margin-top: 20px;
    font-size: 1.4rem;
    color: #f3f4f6;
}

.processing-core-wrapper p {
    color: #9ca3af;
    font-size: 0.95rem;
    margin-top: 8px;
}

.progress-container {
    margin-top: 35px;
    background: #181412;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid rgba(255, 82, 0, 0.1);
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: #27211e;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #cc4200, #FF5200);
    border-radius: 4px;
}

.progress-meta-row {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 0.85rem;
    font-weight: 700;
}

#timerCountdown { color: #6b7280; }
#pipelineProgressPercent { color: #FF5200; }

/* --- CUSTOMIZATION MATRIX GRID CANVAS CONFIGURATIONS --- */
#customizationZone {
    margin-top: 10px;
    border: 1px solid rgba(255, 82, 0, 0.25);
    border-radius: 12px;
    padding: 30px;
    background: rgba(20, 17, 15, 0.8);
    animation: slideEmerge 0.5s ease-out;
}

.customization-head h3 {
    font-size: 1.3rem;
    margin-bottom: 6px;
    color: #f3f4f6;
}

.customization-head p {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-bottom: 25px;
    line-height: 1.5;
}

.room-input-row {
    animation: slideEmerge 0.3s ease-out;
}

.room-field-name { flex: 2; min-width: 0; }
.room-field-size { flex: 1; min-width: 0; }
.room-field-points { flex: 1; min-width: 0; }

.btn-remove-row {
    background: transparent;
    color: #f87171;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.btn-remove-row:hover {
    transform: scale(1.1);
    color: #ef4444;
}

.btn-append-row {
    background: transparent;
    color: #FF5200;
    border: 1px dashed #FF5200;
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.btn-append-row:hover {
    background: rgba(255, 82, 0, 0.03);
    box-shadow: 0 0 15px rgba(255, 82, 0, 0.1);
}

/* --- TRIGGER BUTTON CONTROLS --- */
.btn-process-submit {
    width: 100%;
    padding: 14px 28px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff;
    background: #FF5200;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(255, 82, 0, 0.2);
}

.btn-process-submit:hover:not([disabled]) {
    background: transparent;
    color: #FF5200;
    border-color: #FF5200;
    box-shadow: 0 0 25px rgba(255, 82, 0, 0.4);
    transform: translateY(-1px);
}

.btn-process-submit:active:not([disabled]) {
    transform: translateY(1px);
}

.btn-process-submit[disabled] {
    background: #25201d;
    color: #524742;
    cursor: not-allowed;
    box-shadow: none;
}

/* --- BANNERS AND FOOTERS INTERFACE --- */
.status-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.4;
}

.status-banner.success {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.banner-icon { font-weight: bold; font-size: 1.2rem; }
.completion-hint-text { color: #9ca3af; font-size: 0.9rem; margin-top: 15px; }

.app-footer {
    margin-top: auto;
    padding-top: 20px;
    font-size: 0.75rem;
    color: #4b5563;
    text-align: center;
    line-height: 1.5;
}

/* --- RESPONSIVE WORKSPACE TARGETS --- */
@media (min-width: 1024px) {
    .app-container {
        max-width: 1240px;
        padding: 35px 30px;
    }
    .workspace-card {
        padding: 45px 50px;
    }
    .card-head h2 {
        font-size: 2.1rem;
    }
    .card-head p {
        font-size: 1.05rem;
    }
    .upload-desktop-layout {
        display: grid;
        grid-template-columns: 1.15fr 1fr;
        gap: 30px;
        align-items: stretch;
    }
    .upload-col-primary {
        display: flex;
        flex-direction: column;
    }
    .upload-col-primary .drop-zone {
        flex: 1;
        min-height: 280px;
    }
    .upload-col-secondary {
        display: flex;
        flex-direction: column;
    }
    .upload-col-secondary .dxf-guidelines-card {
        margin-bottom: 0;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 26px;
    }
    #dynamicPanelsTelemetryDashboard {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
    }
}

/* --- SEPARATE DB SCHEDULE CARDS & 3-PHASE MATRIX STYLES --- */
.db-schedule-tabs-container {
    margin-bottom: 20px;
    background: #0f0b09;
    border: 1px solid rgba(255, 82, 0, 0.22);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.db-schedule-tabs-bar {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 2px 0;
}

/* If only 1 DB exists, keep it well proportioned */
.db-schedule-tabs-bar:has(> :only-child) {
    grid-template-columns: minmax(0, 360px);
}

/* If exactly 2 DBs exist, distribute them evenly in the row */
.db-schedule-tabs-bar:has(> :nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 992px) {
    .db-schedule-tabs-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .db-schedule-tabs-bar {
        grid-template-columns: 1fr !important;
    }
}

.db-schedule-tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.09);
    color: #9ca3af;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    min-height: 42px;
    box-sizing: border-box;
    width: 100%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.db-schedule-tab-btn:hover {
    background: rgba(255, 82, 0, 0.12);
    border-color: rgba(255, 82, 0, 0.35);
    color: #f3f4f6;
    transform: translateY(-1px);
}

.db-schedule-tab-btn.active {
    background: linear-gradient(135deg, rgba(255, 82, 0, 0.25), rgba(255, 82, 0, 0.12));
    border-color: #FF5200;
    color: #ffffff;
    box-shadow: 0 2px 14px rgba(255, 82, 0, 0.35);
}

.db-schedule-tab-btn .db-tab-icon {
    font-size: 0.95rem;
    color: #ff6b21;
    flex-shrink: 0;
}

.db-schedule-tab-btn .db-tab-name {
    font-weight: 800;
    letter-spacing: -0.2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.db-schedule-tab-btn .db-tab-framework-tag {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
    color: #d1d5db;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.db-schedule-tab-btn.active .db-tab-framework-tag {
    background: rgba(255, 82, 0, 0.25);
    color: #ff9800;
    border: 1px solid rgba(255, 82, 0, 0.35);
}

.db-schedule-tab-btn .db-tab-badge {
    font-size: 0.7rem;
    font-family: monospace;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.35);
    color: #9ca3af;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-left: auto;
    flex-shrink: 0;
    white-space: nowrap;
}

.db-schedule-tab-btn.active .db-tab-badge {
    background: rgba(0, 0, 0, 0.45);
    color: #f3f4f6;
    border-color: rgba(255, 82, 0, 0.35);
}

.db-schedule-tab-pane {
    display: none;
    flex-direction: column;
    gap: 24px;
    animation: fadeInDbTab 0.22s ease-in-out;
}

.db-schedule-tab-pane.active {
    display: flex;
}

@keyframes fadeInDbTab {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.db-panel-telemetry-slot {
    width: 100%;
}

.db-schedule-card {
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.db-schedule-card:hover {
    border-color: rgba(255, 82, 0, 0.45) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45) !important;
}

.vtpn-feeder-dropdown:focus {
    outline: none;
    border-color: #ff6b21 !important;
    box-shadow: 0 0 6px rgba(255, 82, 0, 0.3);
}

#btnRedownloadZip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 82, 0, 0.55) !important;
}

@media (min-width: 1366px) {
    .app-container {
        max-width: 1540px;
        padding: 40px 45px;
    }
    .workspace-card {
        padding: 50px 60px;
    }
    .drop-zone {
        min-height: 300px;
    }
}

@media (min-width: 1700px) {
    .app-container {
        max-width: 1720px;
        padding: 50px 60px;
    }
}

@media (max-width: 680px) {
    .workspace-card { padding: 25px 20px; }
    .card-head h2 { font-size: 1.5rem; }
    .app-header { flex-direction: column; gap: 15px; align-items: flex-start; }
    .room-input-row { gap: 10px; }
    .room-input-row input { flex: 1 1 100%; }
    .btn-remove-row { width: 100%; text-align: center; padding: 10px; border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 6px; }
    .dxf-guidelines-card { padding: 15px; }
}

/* SVG GA Breaker Interactive Layout */
.db-enclosure-diagram-panel svg {
    transition: transform 0.2s ease;
}
.mcb-slot {
    transition: opacity 0.2s ease, filter 0.2s ease;
}
.mcb-slot:hover rect:first-of-type {
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35));
}
.mcb-slot:hover text {
    font-weight: 900 !important;
}

/* =========================================================================
   GLOBAL WORKSPACE THEME TOGGLE BUTTON & LIGHT MODE SYSTEM
   ========================================================================= */
.workspace-theme-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 82, 0, 0.08);
    border: 1px solid rgba(255, 82, 0, 0.32);
    color: #ff6b21;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.workspace-theme-btn:hover {
    background: rgba(255, 82, 0, 0.18);
    border-color: #ff5200;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 82, 0, 0.25);
}

/* =========================================================================
   FULL WORKSPACE LIGHT MODE OVERRIDES
   ========================================================================= */
body.light-mode {
    background-color: #f4f6f9 !important;
    color: #0f172a !important;
}

body.light-mode .workspace-bg {
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px) !important;
}

body.light-mode .ambient-glow {
    background: radial-gradient(circle, rgba(234, 88, 12, 0.06) 0%, transparent 70%) !important;
}

body.light-mode .app-header {
    border-bottom-color: rgba(0, 0, 0, 0.09) !important;
}

body.light-mode .brand-logo {
    color: #0f172a !important;
}

body.light-mode .theme-switch-wrapper {
    background: #e2e8f0 !important;
    border-color: rgba(15, 23, 42, 0.1) !important;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .theme-mode-btn {
    color: #64748b !important;
}

body.light-mode .theme-mode-btn:hover {
    color: #0f172a !important;
}

body.light-mode .theme-mode-btn.active {
    background: #ffffff !important;
    color: #0f172a !important;
    border-color: rgba(15, 23, 42, 0.12) !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12) !important;
}

body.light-mode .workspace-theme-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
}

body.light-mode .workspace-theme-btn:hover {
    background: #fff7ed !important;
    border-color: #ea580c !important;
    color: #ea580c !important;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.16) !important;
}

body.light-mode .system-badge {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    color: #ea580c !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04) !important;
}

body.light-mode .workspace-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03) !important;
    color: #0f172a !important;
}

body.light-mode .card-head h2 {
    color: #0f172a !important;
}

body.light-mode .card-head p {
    color: #475569 !important;
}

/* Light Mode Support for Top Model Selection Card with Separate Border */
body.light-mode .model-selection-card,
body.light-mode .model-selection-wrapper {
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 100%) !important;
    border: 1.5px solid #fed7aa !important;
    border-left: 5px solid #ea580c !important;
    box-shadow: 0 4px 18px rgba(234, 88, 12, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .model-selection-card:hover,
body.light-mode .model-selection-wrapper:hover {
    border-color: #fdba74 !important;
    box-shadow: 0 6px 22px rgba(234, 88, 12, 0.12), 0 2px 6px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .model-selection-card .control-label,
body.light-mode .model-selection-wrapper .control-label {
    color: #334155 !important;
}

body.light-mode .model-selection-card .pro-status-badge-link {
    background: rgba(234, 88, 12, 0.08) !important;
    border-color: rgba(234, 88, 12, 0.25) !important;
    color: #ea580c !important;
}

body.light-mode .model-selection-card .pro-status-badge-link:hover {
    background: rgba(234, 88, 12, 0.15) !important;
}

body.light-mode .model-selection-card .pro-status-badge-link.pro-unlocked,
body.light-mode .model-selection-card .pro-status-badge-link:has([style*="34d399"]) {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #059669 !important;
}

body.light-mode .model-selection-card select,
body.light-mode .model-selection-wrapper select {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

body.light-mode .model-selection-card select:focus,
body.light-mode .model-selection-wrapper select:focus {
    border-color: #ea580c !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15), inset 0 1px 2px rgba(0, 0, 0, 0.03) !important;
}

body.light-mode .model-selection-card select option,
body.light-mode .model-selection-wrapper select option {
    background: #ffffff !important;
    color: #0f172a !important;
}

body.light-mode .dxf-guidelines-card {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    border-left-color: #ea580c !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .guidelines-list {
    color: #334155 !important;
}

body.light-mode .guidelines-list strong {
    color: #0f172a !important;
}

body.light-mode .guidelines-list code {
    background: #e2e8f0 !important;
    color: #c2410c !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .drop-zone {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .drop-zone:hover, 
body.light-mode .drop-zone.drag-active {
    background: #fff7ed !important;
    border-color: #ea580c !important;
    box-shadow: 0 0 20px rgba(234, 88, 12, 0.1) !important;
}

body.light-mode .drop-zone h3 {
    color: #0f172a !important;
}

body.light-mode .drop-zone p {
    color: #64748b !important;
}

body.light-mode .file-monitor-panel {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .monitored-name {
    color: #0f172a !important;
}

body.light-mode .monitored-size {
    color: #64748b !important;
}

body.light-mode .progress-container {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .progress-bar-track {
    background: #e2e8f0 !important;
}

body.light-mode #customizationZone {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .customization-head h3 {
    color: #0f172a !important;
}

body.light-mode .customization-head p {
    color: #475569 !important;
}

/* INPUTS & SELECT FIELDS IN LIGHT MODE */
body.light-mode .room-input-row input,
body.light-mode .grid-cell,
body.light-mode select.grid-cell,
body.light-mode input.grid-cell,
body.light-mode .db-panel-name-input,
body.light-mode .db-panel-framework-select,
body.light-mode .db-panel-ways-select,
body.light-mode .db-panel-purpose-select {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

body.light-mode .room-input-row input:focus,
body.light-mode .grid-cell:focus,
body.light-mode select.grid-cell:focus,
body.light-mode input.grid-cell:focus {
    border-color: #ea580c !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15) !important;
}

body.light-mode .vtpn-feeder-dropdown {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #b45309 !important;
}

/* DB DIRECTORY PANEL IN LIGHT MODE */
body.light-mode div[style*="background: rgba(26, 21, 18"] {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-mode div[style*="background: #110e0c"] {
    background: #e2e8f0 !important;
    color: #334155 !important;
}

/* DB SCHEDULE CARDS IN LIGHT MODE */
body.light-mode .db-schedule-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .db-schedule-card:hover {
    border-color: #ea580c !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .db-schedule-header {
    border-bottom-color: #e2e8f0 !important;
}

body.light-mode .db-schedule-header span[style*="color: #f3f4f6"] {
    color: #0f172a !important;
}

body.light-mode .db-badge-ways {
    background: #f1f5f9 !important;
    border-color: #e2e8f0 !important;
    color: #334155 !important;
}

body.light-mode .db-enclosure-diagram-panel {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .db-svg-render-area {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-mode .db-schedule-table-header,
body.light-mode div[style*="background: #1a1512"] {
    background: #f1f5f9 !important;
    color: #334155 !important;
}

body.light-mode .db-live-summary-stats {
    color: #64748b !important;
}

/* EMPTY DB STATE PLACEHOLDER */
body.light-mode #masterDbSchedulesWrapper div[style*="dashed"] {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #64748b !important;
}

body.light-mode div[style*="background: rgba(18,14,12,0.5)"],
body.light-mode div[style*="background: rgba(18, 14, 12, 0.5)"] {
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
}

/* DB TABS IN LIGHT MODE */
body.light-mode .db-schedule-tabs-container {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode .db-schedule-tab-btn {
    background: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #64748b !important;
}

body.light-mode .db-schedule-tab-btn:hover {
    background: #fff7ed !important;
    border-color: #fdba74 !important;
    color: #ea580c !important;
}

body.light-mode .db-schedule-tab-btn.active {
    background: linear-gradient(135deg, #fff7ed, #ffedd5) !important;
    border-color: #ea580c !important;
    color: #c2410c !important;
    box-shadow: 0 2px 10px rgba(234, 88, 12, 0.18) !important;
}

body.light-mode .db-schedule-tab-btn .db-tab-framework-tag {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

body.light-mode .db-schedule-tab-btn.active .db-tab-framework-tag {
    background: #ffedd5 !important;
    color: #ea580c !important;
    border-color: #fdba74 !important;
}

body.light-mode .db-schedule-tab-btn .db-tab-badge {
    background: #f1f5f9 !important;
    color: #64748b !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .db-schedule-tab-btn.active .db-tab-badge {
    background: #ffffff !important;
    color: #ea580c !important;
    border-color: #fdba74 !important;
}

/* TELEMETRY DASHBOARD & TAB SLOTS IN LIGHT MODE */
body.light-mode #dynamicPanelsTelemetryDashboard > div,
body.light-mode .db-panel-telemetry-slot > div {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:#14100e"],
body.light-mode .db-panel-telemetry-slot div[style*="background:#14100e"],
body.light-mode .db-panel-telemetry-slot div[style*="background: #14100e"] {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05) !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard [style*="color:#fff"],
body.light-mode #dynamicPanelsTelemetryDashboard [style*="color: #fff"],
body.light-mode #dynamicPanelsTelemetryDashboard [style*="color:#ffffff"],
body.light-mode #dynamicPanelsTelemetryDashboard [style*="color: #ffffff"],
body.light-mode .db-panel-telemetry-slot [style*="color:#fff"],
body.light-mode .db-panel-telemetry-slot [style*="color: #fff"],
body.light-mode .db-panel-telemetry-slot [style*="color:#ffffff"],
body.light-mode .db-panel-telemetry-slot [style*="color: #ffffff"] {
    color: #0f172a !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard [style*="color:#e5e7eb"],
body.light-mode #dynamicPanelsTelemetryDashboard [style*="color: #e5e7eb"],
body.light-mode .db-panel-telemetry-slot [style*="color:#e5e7eb"],
body.light-mode .db-panel-telemetry-slot [style*="color: #e5e7eb"] {
    color: #1e293b !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:rgba(0,0,0,0.3)"],
body.light-mode #dynamicPanelsTelemetryDashboard span[style*="background:rgba(0,0,0,0.3)"],
body.light-mode .db-panel-telemetry-slot div[style*="background:rgba(0,0,0,0.3)"],
body.light-mode .db-panel-telemetry-slot span[style*="background:rgba(0,0,0,0.3)"] {
    background: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:#0e0a09"],
body.light-mode .db-panel-telemetry-slot div[style*="background:#0e0a09"] {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:#1c1613"],
body.light-mode .db-panel-telemetry-slot div[style*="background:#1c1613"] {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:#120e0c"],
body.light-mode .db-panel-telemetry-slot div[style*="background:#120e0c"] {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:#1a1411"],
body.light-mode .db-panel-telemetry-slot div[style*="background:#1a1411"] {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:rgba(255,82,0,0.04)"],
body.light-mode .db-panel-telemetry-slot div[style*="background:rgba(255,82,0,0.04)"] {
    background: #fff7ed !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:rgba(20,16,14"],
body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background: rgba(20, 16, 14"],
body.light-mode .db-panel-telemetry-slot div[style*="background:rgba(20,16,14"],
body.light-mode .db-panel-telemetry-slot div[style*="background: rgba(20, 16, 14"] {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:rgba(30, 30, 30, 0.2)"],
body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background: rgba(30, 30, 30, 0.2)"],
body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:rgba(30,30,30,0.18)"],
body.light-mode #dynamicPanelsTelemetryDashboard div[style*="background:rgba(30,30,30,0.15)"],
body.light-mode .db-panel-telemetry-slot div[style*="background:rgba(30, 30, 30, 0.2)"],
body.light-mode .db-panel-telemetry-slot div[style*="background: rgba(30, 30, 30, 0.2)"],
body.light-mode .db-panel-telemetry-slot div[style*="background:rgba(30,30,30,0.18)"],
body.light-mode .db-panel-telemetry-slot div[style*="background:rgba(30,30,30,0.15)"] {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

body.light-mode #dynamicPanelsTelemetryDashboard span[style*="background:rgba(255,255,255,0.08)"],
body.light-mode #dynamicPanelsTelemetryDashboard span[style*="background:rgba(255,255,255,0.05)"],
body.light-mode .db-panel-telemetry-slot span[style*="background:rgba(255,255,255,0.08)"],
body.light-mode .db-panel-telemetry-slot span[style*="background:rgba(255,255,255,0.05)"] {
    background: #e2e8f0 !important;
    color: #475569 !important;
}

/* BUTTONS IN LIGHT MODE */
body.light-mode .btn-append-row {
    background: #fff7ed !important;
    border-color: #ea580c !important;
    color: #ea580c !important;
}

body.light-mode .btn-append-row:hover {
    background: #ffedd5 !important;
    box-shadow: 0 0 15px rgba(234, 88, 12, 0.15) !important;
}

/* COMPLETION DELIVERABLES ZONE IN LIGHT MODE */
body.light-mode #completionZone {
    background: #ffffff !important;
    border-color: rgba(16, 185, 129, 0.35) !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.08) !important;
}

body.light-mode #completionZone .completion-hint-text {
    color: #475569 !important;
}

body.light-mode #completionZone button[onclick="returnToWorkspaceEdit()"] {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

body.light-mode #completionZone button[onclick="returnToWorkspaceEdit()"]:hover {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

/* MODALS IN LIGHT MODE */
body.light-mode .modal-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
    color: #0f172a !important;
}

body.light-mode .modal-card h3 {
    color: #0f172a !important;
}

body.light-mode .modal-desc {
    color: #475569 !important;
}

body.light-mode .modal-highlight-box {
    background: #fff7ed !important;
    border-color: #fdba74 !important;
}

body.light-mode .modal-highlight-box p {
    color: #1e293b !important;
}

body.light-mode .btn-modal-secondary {
    color: #475569 !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .btn-modal-secondary:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

/* COMPLIANCE WARNING NOTICES IN LIGHT MODE */
body.light-mode div[style*="background: rgba(239, 68, 68, 0.05)"] {
    background: #fef2f2 !important;
    border-color: #fca5a5 !important;
    color: #b91c1c !important;
}

/* FOOTER IN LIGHT MODE */
body.light-mode .app-footer {
    color: #64748b !important;
}

/* =========================================================================
   PROJECT MANAGEMENT NAVIGATION TABS & CONTROLS (RED AREA FROM USER SPECS)
   ========================================================================= */
.workspace-project-tabs-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: rgba(18, 14, 12, 0.85);
    border: 1px solid rgba(255, 82, 0, 0.25);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.workspace-tabs-group {
    display: inline-flex;
    align-items: center;
    background: rgba(10, 6, 3, 0.7);
    padding: 4px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    gap: 4px;
}

.workspace-project-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #9ca3af;
    background: transparent;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.workspace-project-tab-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.workspace-project-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(255, 82, 0, 0.9), rgba(204, 66, 0, 0.95));
    box-shadow: 0 4px 14px rgba(255, 82, 0, 0.4);
}

.workspace-tab-count-badge {
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.workspace-project-tab-btn.active .workspace-tab-count-badge {
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
}

/* Active Project Header Info & Save Bar */
.active-project-bar-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.active-project-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 82, 0, 0.08);
    border: 1px solid rgba(255, 82, 0, 0.25);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
}

.project-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff5200;
    box-shadow: 0 0 8px #ff5200;
    transition: all 0.2s ease;
}

.project-status-dot.saved {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

.project-name-text {
    font-weight: 700;
    color: #f3f4f6;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-inline-rename-project {
    background: transparent;
    border: none;
    color: #ff6b21;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.btn-inline-rename-project:hover {
    opacity: 1;
}

.btn-quick-save-project {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(90deg, #10b981, #059669);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.82rem;
    border: none;
    border-radius: 7px;
    padding: 7px 14px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}

.btn-quick-save-project:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.45);
}

.btn-quick-save-project.btn-needs-save {
    background: linear-gradient(90deg, #cc4200, #ff5200);
    box-shadow: 0 4px 12px rgba(255, 82, 0, 0.35);
}

/* SAVED PROJECTS CONTAINER CARD */
.saved-projects-card {
    background: rgba(18, 14, 12, 0.98);
    border: 1px solid rgba(255, 82, 0, 0.3);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
    margin-bottom: 30px;
    animation: proModalFadeIn 0.2s ease-out;
}

.saved-projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
    border-bottom: 1px solid rgba(255, 82, 0, 0.15);
    padding-bottom: 20px;
}

.saved-projects-title-box h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.saved-projects-title-box p {
    font-size: 0.88rem;
    color: #9ca3af;
    line-height: 1.5;
}

.saved-projects-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.saved-projects-search-input {
    background: rgba(10, 6, 3, 0.8);
    border: 1px solid rgba(255, 82, 0, 0.25);
    border-radius: 8px;
    padding: 8px 14px;
    color: #ffffff;
    font-size: 0.85rem;
    min-width: 220px;
    outline: none;
    transition: border-color 0.2s ease;
}

.saved-projects-search-input:focus {
    border-color: #ff5200;
    box-shadow: 0 0 0 3px rgba(255, 82, 0, 0.15);
}

.btn-start-fresh-project {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(90deg, #cc4200, #ff5200);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    border: none;
    border-radius: 8px;
    padding: 9px 18px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(255, 82, 0, 0.3);
    transition: all 0.2s ease;
}

.btn-start-fresh-project:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(255, 82, 0, 0.45);
}

/* SAVED PROJECTS TABLE & CARDS */
.saved-projects-table-wrapper {
    overflow-x: auto;
}

.saved-projects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.saved-projects-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.saved-projects-table td {
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
}

.saved-project-row:hover {
    background: rgba(255, 82, 0, 0.03);
}

.saved-project-name-cell {
    font-weight: 700;
    color: #ffffff;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-project-date-cell {
    color: #9ca3af;
    font-size: 0.82rem;
    white-space: nowrap;
}

.saved-project-badge-cell {
    font-size: 0.78rem;
    color: #ff6b21;
    background: rgba(255, 82, 0, 0.08);
    border: 1px solid rgba(255, 82, 0, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.saved-project-actions-cell {
    text-align: right;
    white-space: nowrap;
}

.btn-open-saved-project {
    background: linear-gradient(90deg, #cc4200, #ff5200);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    cursor: pointer;
    margin-right: 6px;
    transition: all 0.15s ease;
}

.btn-open-saved-project:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 82, 0, 0.35);
}

.btn-delete-saved-project {
    background: transparent;
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-delete-saved-project:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: #ef4444;
}

/* EMPTY SAVED PROJECTS STATE */
.saved-projects-empty-state {
    padding: 50px 20px;
    text-align: center;
    color: #9ca3af;
}

.saved-projects-empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

/* LIGHT MODE OVERRIDES FOR PROJECT TABS & SAVED PROJECTS */
body.light-mode .workspace-project-tabs-nav {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

body.light-mode .workspace-tabs-group {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

body.light-mode .workspace-project-tab-btn {
    color: #475569;
}

body.light-mode .workspace-project-tab-btn:hover {
    color: #0f172a;
    background: #e2e8f0;
}

body.light-mode .workspace-project-tab-btn.active {
    color: #ffffff;
    background: linear-gradient(135deg, #ff5200, #ea580c);
}

body.light-mode .active-project-pill {
    background: #fff7ed;
    border-color: #fed7aa;
}

body.light-mode .project-name-text {
    color: #0f172a;
}

body.light-mode .saved-projects-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

body.light-mode .saved-projects-header {
    border-bottom-color: #f1f5f9;
}

body.light-mode .saved-projects-title-box h2 {
    color: #0f172a;
}

body.light-mode .saved-projects-title-box p {
    color: #64748b;
}

body.light-mode .saved-projects-search-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

body.light-mode .saved-projects-search-input:focus {
    background: #ffffff;
    border-color: #ff5200;
}

body.light-mode .saved-projects-table th {
    color: #64748b;
    border-bottom-color: #e2e8f0;
}

body.light-mode .saved-projects-table td {
    border-bottom-color: #f1f5f9;
}

body.light-mode .saved-project-name-cell {
    color: #0f172a;
}

body.light-mode .saved-project-date-cell {
    color: #64748b;
}

body.light-mode .saved-project-row:hover {
    background: #fff7ed;
}

body.light-mode .saved-project-badge-cell {
    background: #fff7ed;
    border-color: #fdba74;
    color: #ea580c;
}
/* --- DELIVERABLES & PANEL SCHEDULE TAB BUTTONS (3 IN A ROW) --- */

<!-- PREMIER ENGINEERING DELIVERABLES TABS STYLING -->

.panel-deliverables-wrapper {
    margin-top: 20px !important;
    margin-bottom: 24px !important;
    width: 100% !important;
}

.panel-deliverables-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 82, 0, 0.08);
    border: 1px solid rgba(255, 82, 0, 0.22);
    border-radius: 9999px;
    font-size: 0.76rem;
    font-weight: 700;
    color: #ff6b21;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}

.panel-deliverables-tabs-bar {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
    margin-bottom: 18px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

@media (max-width: 860px) {
    .panel-deliverables-tabs-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}
@media (max-width: 520px) {
    .panel-deliverables-tabs-bar {
        grid-template-columns: 1fr !important;
    }
}

.panel-deliverable-tab-btn {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 13px 16px !important;
    min-height: 54px !important;
    background: linear-gradient(145deg, #181412 0%, #100d0b 100%) !important;
    border: 1.5px solid rgba(255, 82, 0, 0.20) !important;
    border-radius: 12px !important;
    color: #e2e8f0 !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
    font-size: 0.90rem !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
    user-select: none !important;
    outline: none !important;
    box-sizing: border-box !important;
    text-align: left !important;
    text-decoration: none !important;
}

.panel-deliverable-tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.panel-deliverable-tab-btn:hover {
    background: linear-gradient(145deg, #241c18 0%, #16120f 100%) !important;
    border-color: rgba(255, 82, 0, 0.55) !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 22px rgba(255, 82, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}

.panel-deliverable-tab-btn:active {
    transform: translateY(0) scale(0.985) !important;
}

/* ACTIVE STATE */
.panel-deliverable-tab-btn.active {
    background: linear-gradient(135deg, #ff5200 0%, #ff7315 50%, #e04500 100%) !important;
    border-color: #ffa166 !important;
    color: #ffffff !important;
    box-shadow: 0 8px 26px rgba(255, 82, 0, 0.45), 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4) !important;
    transform: translateY(-1px) !important;
}

.panel-deliverable-tab-btn.active::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

/* Icon Container */
.panel-deliverable-tab-btn .p-tab-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 8px !important;
    background: rgba(255, 82, 0, 0.14) !important;
    border: 1px solid rgba(255, 82, 0, 0.30) !important;
    font-size: 1.1rem !important;
    line-height: 1 !important;
    transition: all 0.22s ease !important;
    flex-shrink: 0 !important;
}

.panel-deliverable-tab-btn:hover .p-tab-icon {
    background: rgba(255, 82, 0, 0.26) !important;
    border-color: rgba(255, 82, 0, 0.6) !important;
    transform: scale(1.08) !important;
}

.panel-deliverable-tab-btn.active .p-tab-icon {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
    transform: scale(1.05) !important;
}

/* Text Wrapper */
.panel-deliverable-tab-btn .p-tab-text-wrap {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    overflow: hidden !important;
    flex: 1 !important;
}

.panel-deliverable-tab-btn .p-tab-label {
    font-size: 0.92rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.2px !important;
    line-height: 1.2 !important;
    color: inherit !important;
    white-space: nowrap !important;
}

.panel-deliverable-tab-btn .p-tab-sub {
    font-size: 0.70rem !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.4px !important;
    line-height: 1 !important;
    opacity: 0.85;
    transition: color 0.2s ease;
}

.panel-deliverable-tab-btn.active .p-tab-sub {
    color: rgba(255, 255, 255, 0.90) !important;
    opacity: 1;
}

/* Active Indicator dot */
.panel-deliverable-tab-btn .p-tab-dot {
    margin-left: auto !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    border-radius: 50% !important;
    background: transparent !important;
    transition: all 0.22s ease !important;
}

.panel-deliverable-tab-btn.active .p-tab-dot {
    background: #ffffff !important;
    box-shadow: 0 0 10px #ffffff, 0 0 4px #ffffff !important;
}

/* ==========================================================
   LIGHT MODE AESTHETICS (Matches Qudraw light theme)
   ========================================================== */
body.light-mode .panel-deliverable-tab-btn {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1.5px solid #e2e8f0 !important;
    color: #1e293b !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body.light-mode .panel-deliverable-tab-btn::before {
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent) !important;
}

body.light-mode .panel-deliverable-tab-btn:hover {
    background: #fff7ed !important;
    border-color: #ff5200 !important;
    color: #ea580c !important;
    box-shadow: 0 6px 16px rgba(255, 82, 0, 0.16) !important;
}

body.light-mode .panel-deliverable-tab-btn .p-tab-icon {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

body.light-mode .panel-deliverable-tab-btn:hover .p-tab-icon {
    background: rgba(255, 82, 0, 0.14) !important;
    border-color: rgba(255, 82, 0, 0.4) !important;
}

body.light-mode .panel-deliverable-tab-btn .p-tab-sub {
    color: #64748b !important;
}

body.light-mode .panel-deliverable-tab-btn.active {
    background: linear-gradient(135deg, #ff5200 0%, #ea580c 100%) !important;
    border-color: #c2410c !important;
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(234, 88, 12, 0.38) !important;
}

body.light-mode .panel-deliverable-tab-btn.active .p-tab-icon {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.45) !important;
}

body.light-mode .panel-deliverable-tab-btn.active .p-tab-sub {
    color: rgba(255, 255, 255, 0.92) !important;
}

body.light-mode .panel-deliverables-header-badge {
    background: #fff7ed !important;
    border-color: #fed7aa !important;
    color: #c2410c !important;
}
