/* Submission table styles */
.submission-checkbox {
    cursor: pointer;
}

#bulk-actions {
    transition: all 0.3s ease;
}

.reference-link {
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: inline-block;
}

.reference-link:hover {
    transform: scale(1.05);
}

.reference-link .badge {
    transition: background-color 0.2s ease;
}

.reference-link:hover .badge {
    background-color: var(--primary-color) !important;
}

/* Fix for dropdowns to appear on top of other elements */
.dropdown-menu {
    z-index: 1050 !important;
    position: absolute !important;
}

/* Ensure action buttons and their dropdowns are always on top */
.table .btn-group {
    position: relative;
    z-index: 100;
}

.column-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    cursor: col-resize;
    background-color: transparent;
}

.column-resize-handle:hover {
    background-color: rgba(0, 0, 0, 0.1);
}


/* Tab dragging styling - simplified to maintain functionality */
.tab-placeholder {
    opacity: 0.7;
}

/* Dark mode button close styling for alerts and toasts */
[data-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Toast styling for dark mode */
[data-theme="dark"] .toast {
    background-color: #212529;
    color: #fff;
}

[data-theme="dark"] .alert-success, 
[data-theme="dark"] .bg-success {
    background-color: #0d6832 !important;
}

[data-theme="dark"] .alert-danger, 
[data-theme="dark"] .bg-danger {
    background-color: #842029 !important;
}

[data-theme="dark"] .alert-warning, 
[data-theme="dark"] .bg-warning {
    background-color: #664d03 !important;
}

[data-theme="dark"] .alert-info, 
[data-theme="dark"] .bg-info {
    background-color: #055160 !important;
}

/* Mobile responsiveness enhancements */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Remove default container spacing for BOQ page */
.container-fluid {
    padding: 0 !important;
    margin: 0 !important;
}

/* BOQ specific container adjustments */
.tab-content {
    margin: 0 !important;
    padding: 0 !important;
}

.tab-pane {
    padding: 0 !important;
    margin: 0 !important;

    .card {
        margin-bottom: 1rem;
    }

    .btn {
        white-space: normal;
        word-wrap: break-word;
    }

    /* Improved form controls for mobile */
    .form-control, .form-select, .input-group {
        font-size: 16px; /* Prevents iOS zoom on focus */
    }

    /* Responsive table handling */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }

    /* Smaller padding to save space */
    .card-body {
        padding: 1rem;
    }

    /* Stacked form layout on mobile */
    .d-flex {
        flex-direction: column;
    }

    /* Adjust modal sizing for mobile */
    .modal-dialog {
        margin: 0.5rem;
    }

    /* Ensure buttons are large enough for touch targets */
    .btn {
        padding: 0.5rem 0.75rem;
        min-height: 44px; /* Minimum height for touch targets */
    }

    /* Improve toast positioning on mobile */
    .toast-container {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* Improve touch targets for mobile */
@media (max-width: 576px) {
    /* Larger form controls for better touch */
    .form-control, .btn, .input-group, .form-select {
        min-height: 44px;
        font-size: 16px;
    }

    /* Stack buttons on small screens */
    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group > .btn {
        margin-bottom: 0.5rem;
        border-radius: 0.25rem !important;
    }
}

/* Style active tabs consistently */
.nav-tabs .nav-item .nav-link.active {
    background-color: var(--primary-color) !important;
    color: var(--dark-bg) !important;
    border-color: var(--primary-color) !important;
}

/* Ensure no color bleeding */
#boqTabs.nav-tabs {
    border-bottom: 1px solid var(--border-color);
}

#boqTabs.nav-tabs .nav-item {
    margin-bottom: -1px;
}

#boqTabs.nav-tabs .nav-link {
    border: 1px solid transparent;
}

/* Always keep the active state styling consistent */
#boqTabs.nav-tabs .nav-link.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--dark-bg);
}

/* Hide all action buttons and set proper table column widths */
.btn-edit, .btn-delete {
    display: none !important;
}

/* Ensure proper table layout */
#catalogTable {
    table-layout: fixed;
    width: 100%;
}

#catalogTable th:nth-child(2),
#catalogTable td:nth-child(2) {
    width: 200px;
    max-width: 200px;
}

#catalogTable th:nth-child(3),
#catalogTable td:nth-child(3) {
    width: auto;
}

#catalogTable th:nth-child(4),
#catalogTable td:nth-child(4) {
    width: 100px;
    max-width: 100px;
}

#catalogTable th:nth-child(5),
#catalogTable td:nth-child(5) {
    width: 150px;
    max-width: 150px;
    text-align: right;
}

.phase-row.selected {
    background-color: #e8f4ff !important;
}

.editable-input {
    position: absolute;
    z-index: 1000;
    margin: -2px;
    padding: 2px;
    width: calc(100% - 4px);
    height: calc(100% + 4px);
    border: 2px solid var(--primary-color);
    background: var(--dark-bg);
    color: var(--text-light);
}

.editable {
    position: relative;
    min-height: 1.2em;
    padding: 2px 4px;
    cursor: text;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.editable:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

:root {
    --primary-color: #D18501;
    --dark-bg: #1C1C1C;
    --darker-bg: #141414;
    --text-light: #FFFFFF;
    --text-dark: #333333;
    --border-color: rgba(245, 179, 1, 0.2);
    --primary-color-rgb: 245, 179, 1;
    --input-bg-dark: #2a2a2a;
    --input-bg-light: #ffffff;
    --phase-bg-dark: #2d1b0d;
    --phase-bg-light: #ffeaa7;
    --cc-bg-dark: #34495e;
    --cc-bg-light: #f8f9fa;
}

:root[data-theme="light"] {
    --dark-bg: #FFFFFF;
    --darker-bg: #F8F9FA;
    --text-light: #000000;
    --text-dark: #000000;
    --primary-color: #B35F00;
    --border-color: rgba(179, 95, 0, 0.8);
    --primary-color-rgb: 179, 95, 0;
    --input-bg-dark: #ffffff;
    --input-bg-light: #f0f0f0;
    --phase-bg-light: #ffeaa7;
    --phase-bg-dark: #2d1b0d;
    --cc-bg-light: #f8f9fa;
    --cc-bg-dark: #34495e;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

/* ENHANCED THEME TOGGLEBUTTON - MAXIMUM VISIBILITY */
.theme-toggle {
    background: rgba(245, 179, 1, 0.15) !important;
    border: 2px solid rgba(245, 179, 1, 0.4) !important;
    border-radius: 50% !important;
    color: #d39e10 !important;
    width: 40px !important;
    height: 40px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(245, 179, 1, 0.2) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
    z-index: 1000 !important;
}

/* LIGHT MODE - High contrast orange button */
[data-theme="light"] .theme-toggle {
    background: linear-gradient(135deg, #d39e10, #FF8C00) !important;
    border: 2px solid #D18501 !important;
    color: #000000 !important;
    box-shadow: 0 3px 12px rgba(245, 179, 1, 0.4) !important;
    text-shadow: none !important;
}

[data-theme="light"] .theme-toggle:hover {
    background: linear-gradient(135deg, #FF8C00, #E5A801) !important;
    border-color: #B35F00 !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 16px rgba(245, 179, 1, 0.6) !important;
    color: #000000 !important;
}

/* DARK MODE - Glowing orange button */
[data-theme="dark"] .theme-toggle {
    background: rgba(245, 179, 1, 0.2) !important;
    border: 2px solid rgba(245, 179, 1, 0.6) !important;
    color: #d39e10 !important;
    box-shadow: 
        0 0 12px rgba(245, 179, 1, 0.3),
        0 4px 16px rgba(245, 179, 1, 0.2) !important;
    text-shadow: 0 0 8px rgba(245, 179, 1, 0.4) !important;
}

[data-theme="dark"] .theme-toggle:hover {
    background: rgba(245, 179, 1, 0.25) !important;
    border-color: rgba(245, 179, 1, 0.8) !important;
    transform: scale(1.1) !important;
    box-shadow: 
        0 0 16px rgba(245, 179, 1, 0.5),
        0 6px 20px rgba(245, 179, 1, 0.3) !important;
    color: #FFD700 !important;
}

/* ENSURE ICON VISIBILITY */
.theme-toggle i {
    font-size: 18px !important;
    line-height: 1 !important;
    display: block !important;
    opacity: 1 !important;
}

[data-theme="light"] .theme-toggle i {
    color: #000000 !important;
    filter: none !important;
    text-shadow: none !important;
}

[data-theme="dark"] .theme-toggle i {
    color: #d39e10 !important;
    filter: drop-shadow(0 0 4px rgba(245, 179, 1, 0.4)) !important;
    text-shadow: 0 0 6px rgba(245, 179, 1, 0.3) !important;
}

body {
    background-color: var(--dark-bg);
    color: var(--text-light) !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Navigation Styles */
.navbar {
    background-color: var(--darker-bg) !important;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
}

/*Navbar toggler icon styling for better visibility */
.navbar-toggler {
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 4px 8px;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-color-rgb), 0.25);
}

/* Light mode: Make hamburger menu visible with dark lines */
[data-theme="light"] .navbar-toggler {
    border-color: rgba(0, 0, 0, 0.3);
}

[data-theme="light"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2833, 37, 41, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Dark mode: Ensure hamburger menu is visible with light lines */
[data-theme="dark"] .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.75%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 600;
    font-size: 1.4rem;
    letter-spacing: 0.5px;
}

/* Light mode navbar brand */
[data-theme="light"] .navbar-brand {
    color: #B35F00 !important;
}

/* Navigation links - different colors for light and dark modes */
.nav-link {
    color: #d39e10 !important;
    margin-left: 1.5rem;
    transition: color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    color: #FF8C00 !important;
}

/* Light mode navigation - use darker orange for better contrast */
[data-theme="light"] .nav-link {
    color: #B35F00 !important;
}

[data-theme="light"] .nav-link:hover {
    color: #D18501 !important;
}

/* Navigation breadcrumb and arrow styling */
.navbar .nav-link::before,
.navbar .nav-link::after,
.breadcrumb-item::before,
.breadcrumb-item::after,
.nav-arrow,
.arrow-text {
    color: #d39e10 !important;
}

/* Dropdown arrows and navigation elements */
.dropdown-toggle::after,
.nav-item .dropdown-toggle::after {
    color: #d39e10 !important;
    border-color: #d39e10 transparent transparent transparent !important;
}

/* Navigation text with arrows */
.nav-text-arrow,
.nav-link-arrow,
.breadcrumb-arrow {
    color: #d39e10 !important;
}

/* Light mode navigation elements */
[data-theme="light"] .navbar .nav-link::before,
[data-theme="light"] .navbar .nav-link::after,
[data-theme="light"] .breadcrumb-item::before,
[data-theme="light"] .breadcrumb-item::after,
[data-theme="light"] .nav-arrow,
[data-theme="light"] .arrow-text,
[data-theme="light"] .nav-text-arrow,
[data-theme="light"] .nav-link-arrow,
[data-theme="light"] .breadcrumb-arrow {
    color: #B35F00 !important;
}

[data-theme="light"] .dropdown-toggle::after,
[data-theme="light"] .nav-item .dropdown-toggle::after {
    color: #B35F00 !important;
    border-color: #B35F00 transparent transparent transparent !important;
}

/* Compare BOQs button styling */
.btn-compare-boqs {
    background-color: #d39e10 !important;
    border-color: #d39e10 !important;
    color: #000 !important;
}

[data-theme="light"] .btn-compare-boqs {
    background-color: #d39e10 !important;
    border-color: #d39e10 !important;
    color: #000 !important;
}

[data-theme="dark"] .btn-compare-boqs {
    background-color: #d39e10 !important;
    border-color: #d39e10 !important;
    color: #000 !important;
}

/* Card and Container Styles */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--darker-bg);
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
}

/* Subscription Card Styles */
.subscription-card {
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    position: relative;
    border: 2px solid transparent;
    background: var(--darker-bg);
}

.subscription-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.subscription-card-basic {
    border-color: #d39e10;
}

.subscription-card-basic:hover {
    border-color: #FF8C00;
    box-shadow: 0 20px 40px rgba(245, 179, 1, 0.3);
}

.subscription-card-premium {
    border-color: #d39e10;
    position: relative;
}

.subscription-card-premium:hover {
    border-color: #FF8C00;
    box-shadow: 0 20px 40px rgba(245, 179, 1, 0.4);
}

.subscription-card-enterprise {
    border-color: #d39e10;
}

.subscription-card-enterprise:hover {
    border-color: #FF8C00;
    box-shadow: 0 20px 40px rgba(245, 179, 1, 0.3);
}

.current-plan {
    border-color: var(--primary-color) !important;
    background: rgba(var(--primary-color-rgb), 0.05);
}

/* Current Plan button styling - make text bold white */
.current-plan .btn-secondary {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5) !important;
}

/* Dark mode headers - orange theme matching application */
.subscription-header-basic {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    border-radius: 14px 14px 0 0;
    padding: 1.5rem 1rem;
    box-shadow: 0 2px 8px rgba(245, 179, 1, 0.4);
    font-weight: 700;
}

.subscription-header-premium {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    border-radius: 14px 14px 0 0;
    padding: 1.5rem 1rem;
    box-shadow: 0 2px 8px rgba(245, 179, 1, 0.5);
    font-weight: 700;
}

.subscription-header-enterprise {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    border-radius: 14px 14px 0 0;
    padding: 1.5rem 1rem;
    box-shadow: 0 2px 8px rgba(245, 179, 1, 0.4);
    font-weight: 700;
}

/* Light mode card adjustments - orange theme */
[data-theme="light"] .subscription-card {
    background: #ffffff;
    border: 2px solid #e0e0e0;
}

[data-theme="light"] .subscription-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .subscription-header-basic {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    box-shadow: 0 2px 8px rgba(245, 179, 1, 0.3);
    font-weight: 700;
}

[data-theme="light"] .subscription-header-premium {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    box-shadow: 0 2px 8px rgba(245, 179, 1, 0.3);
    font-weight: 700;
}

[data-theme="light"] .subscription-header-enterprise {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    box-shadow: 0 2px 8px rgba(245, 179, 1, 0.3);
    font-weight: 700;
}

/* Ensure better contrast in auth containers */
[data-theme="light"] .auth-container {
    background: #ffffff;
    color: #333333;
    border: 1px solid #dddddd;
}

[data-theme="dark"] .auth-container {
    background: #1a1a1a;
    color: #ffffff;
}

/* Subscription plan text visibility fixes - UPDATED FOR WHITE TEXT */
[data-theme="dark"] .subscription-card .card-body {
    color: #ffffff !important;
}

[data-theme="dark"] .subscription-card .card-body li {
    color: #ffffff !important;
}

[data-theme="dark"] .subscription-card .card-body span {
    color: #ffffff !important;
}

[data-theme="dark"] .subscription-card .card-body strong {
    color: #ffffff !important;
}

[data-theme="dark"] .subscription-card .card-body p {
    color: #ffffff !important;
}

[data-theme="dark"] .subscription-card .card-body div {
    color: #ffffff !important;
}

[data-theme="dark"] .subscription-header-basic h6,
[data-theme="dark"] .subscription-header-basic h4,
[data-theme="dark"] .subscription-header-basic small {
    color: #000000 !important;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .subscription-header-premium h6,
[data-theme="dark"] .subscription-header-premium h4,
[data-theme="dark"] .subscription-header-premium small {
    color: #000000 !important;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .subscription-header-enterprise h6,
[data-theme="dark"] .subscription-header-enterprise h4,
[data-theme="dark"] .subscription-header-enterprise small {
    color: #000000 !important;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

/* Light mode text visibility - ensure black text for all elements */
[data-theme="light"] .subscription-card .card-body {
    color: #000000 !important;
}

[data-theme="light"] .subscription-card .card-body li {
    color: #000000 !important;
}

[data-theme="light"] .subscription-card .card-body span {
    color: #000000 !important;
}

[data-theme="light"] .subscription-card .card-body strong {
    color: #000000 !important;
}

[data-theme="light"] .subscription-card .card-body p {
    color: #000000 !important;
}

[data-theme="light"] .subscription-card .card-body div {
    color: #000000 !important;
}

/* Override any inherited text colors for subscription features - COMPREHENSIVE */
[data-theme="light"] .subscription-card .card-body *,
[data-theme="light"] .subscription-card .card-body *:before,
[data-theme="light"] .subscription-card .card-body *:after {
    color: #000000 !important;
}

/* Ensure all text elements in subscription cards are black in light mode */
[data-theme="light"] .subscription-card ul,
[data-theme="light"] .subscription-card ul li,
[data-theme="light"] .subscription-card .card-body ul li,
[data-theme="light"] .subscription-card .list-unstyled,
[data-theme="light"] .subscription-card .list-unstyled li,
[data-theme="light"] .subscription-card .list-unstyled li span,
[data-theme="light"] .subscription-card .list-unstyled li strong {
    color: #000000 !important;
}

/* Target specific Bootstrap classes that might override colors */
[data-theme="light"] .subscription-card .text-muted,
[data-theme="light"] .subscription-card .text-secondary,
[data-theme="light"] .subscription-card .text-light,
[data-theme="light"] .subscription-card .text-white {
    color: #000000 !important;
}

/* Force all icons and text in subscription cards to be black */
[data-theme="light"] .subscription-card i,
[data-theme="light"] .subscription-card .fas,
[data-theme="light"] .subscription-card .bi {
    color: #000000 !important;
}

/* Specific classes for subscription feature text */
.feature-text {
    color: inherit;
}

.unavailable-text {
    color: #6c757d;
}

.unavailable-icon {
    color: #6c757d;
}

.ads-warning {
    color: #dc3545;
}

/* Light mode overrides for feature text */
[data-theme="light"] .feature-text {
    color: #000000 !important;
}

[data-theme="light"] .unavailable-text {
    color: #6c757d !important;
}

[data-theme="light"] .unavailable-icon {
    color: #6c757d !important;
}

[data-theme="light"] .ads-warning {
    color: #dc3545 !important;
}

/* Dark mode styling for feature text */
[data-theme="dark"] .feature-text {
    color: #ffffff !important;
}

[data-theme="dark"] .unavailable-text {
    color: #6c757d !important;
}

[data-theme="dark"] .unavailable-icon {
    color: #6c757d !important;
}

[data-theme="dark"] .ads-warning {
    color: #ffffff !important;
}

/* COMPREHENSIVE DARK MODE TEXT FIX FOR SUBSCRIPTION CARDS */
[data-theme="dark"] .subscription-card .card-body,
[data-theme="dark"] .subscription-card .card-body *,
[data-theme="dark"] .subscription-card .card-body li,
[data-theme="dark"] .subscription-card .card-body span,
[data-theme="dark"] .subscription-card .card-body strong,
[data-theme="dark"] .subscription-card .card-body p,
[data-theme="dark"] .subscription-card .card-body div,
[data-theme="dark"] .subscription-card .card-body ul,
[data-theme="dark"] .subscription-card .card-body ul li,
[data-theme="dark"] .subscription-card .list-unstyled,
[data-theme="dark"] .subscription-card .list-unstyled li,
[data-theme="dark"] .subscription-card .list-unstyled li span,
[data-theme="dark"] .subscription-card .list-unstyled li strong {
    color: #ffffff !important;
}

/* Storage section text fix for dark mode */
[data-theme="dark"] .storage-upgrade-section .card-body,
[data-theme="dark"] .storage-upgrade-section .card-body *,
[data-theme="dark"] .storage-option-card,
[data-theme="dark"] .storage-option-card *,
[data-theme="dark"] .storage-section,
[data-theme="dark"] .storage-section *,
[data-theme="dark"] .need-additional-storage-section,
[data-theme="dark"] .need-additional-storage-section * {
    color: #ffffff !important;
}

/* Override any inherited dark colors in dark mode */
[data-theme="dark"] .card-body:not(.subscription-header-basic):not(.subscription-header-premium):not(.subscription-header-enterprise) {
    color: #ffffff !important;
}

[data-theme="dark"] .card-body:not(.subscription-header-basic):not(.subscription-header-premium):not(.subscription-header-enterprise) * {
    color: #ffffff !important;
}

[data-theme="light"] .subscription-header-basic h6,
[data-theme="light"] .subscription-header-basic h4,
[data-theme="light"] .subscription-header-basic small {
    color: #000000 !important;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .subscription-header-premium h6,
[data-theme="light"] .subscription-header-premium h4,
[data-theme="light"] .subscription-header-premium small {
    color: #000000 !important;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

[data-theme="light"] .subscription-header-enterprise h6,
[data-theme="light"] .subscription-header-enterprise h4,
[data-theme="light"] .subscription-header-enterprise small {
    color: #000000 !important;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.stat-card {
    background: var(--darker-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

/* Ensure stat card icons retain their colors and are vibrant in dark mode */
.stat-card .stats-icon {
    filter: none !important;
}

[data-theme="dark"] .stat-card .stats-icon {
    filter: none !important;
}

/* ULTIMATE ICON COLOR FIX FOR DARK MODE - Maximum specificity and coverage */

/* FORCE ALL ICON COLORS WITH MAXIMUM SPECIFICITY */
[data-theme="dark"] body .sortable-stat-container .stat-icon i,
[data-theme="dark"] body .overview-card .stat-icon i,
[data-theme="dark"] body .sortable-stat-container i,
[data-theme="dark"] body .overview-card i,
[data-theme="dark"] body [data-stat-id] i,
[data-theme="dark"] body [data-stat-id] .stat-icon i,
[data-theme="dark"] html[data-theme="dark"] .sortable-stat-container i,
[data-theme="dark"] html[data-theme="dark"] .overview-card i,
[data-theme="dark"] html[data-theme="dark"] [data-stat-id] i {
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
}

/* SPECIFIC ICON COLORS WITH ULTRA HIGH SPECIFICITY */
[data-theme="dark"] body .sortable-stat-container[data-stat-id="tender-projects"] i,
[data-theme="dark"] html[data-theme="dark"] .sortable-stat-container[data-stat-id="tender-projects"] i,
[data-theme="dark"] .sortable-stat-container[data-stat-id="tender-projects"] .bi-file-earmark-text,
[data-theme="dark"] .sortable-stat-container[data-stat-id="tender-projects"] i.bi-file-earmark-text,
[data-theme="dark"] [data-stat-id="tender-projects"] i.text-primary {
    color: #4FC3F7 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

[data-theme="dark"] body .sortable-stat-container[data-stat-id="production-projects"] i,
[data-theme="dark"] html[data-theme="dark"] .sortable-stat-container[data-stat-id="production-projects"] i,
[data-theme="dark"] .sortable-stat-container[data-stat-id="production-projects"] .bi-building,
[data-theme="dark"] .sortable-stat-container[data-stat-id="production-projects"] i.bi-building,
[data-theme="dark"] [data-stat-id="production-projects"] i.text-primary {
    color: #66BB6A !important;
    filter: none !important;
    -webkit-filter: none !important;
}

[data-theme="dark"] body .sortable-stat-container[data-stat-id="tenders-value"] i,
[data-theme="dark"] html[data-theme="dark"] .sortable-stat-container[data-stat-id="tenders-value"] i,
[data-theme="dark"] .sortable-stat-container[data-stat-id="tenders-value"] .bi-currency-dollar,
[data-theme="dark"] .sortable-stat-container[data-stat-id="tenders-value"] i.bi-currency-dollar,
[data-theme="dark"] [data-stat-id="tenders-value"] i.text-primary {
    color: #FFD54F !important;
    filter: none !important;
    -webkit-filter: none !important;
}

[data-theme="dark"] body .sortable-stat-container[data-stat-id="high-priority"] i,
[data-theme="dark"] html[data-theme="dark"] .sortable-stat-container[data-stat-id="high-priority"] i,
[data-theme="dark"] .sortable-stat-container[data-stat-id="high-priority"] .bi-exclamation-triangle,
[data-theme="dark"] .sortable-stat-container[data-stat-id="high-priority"] i.bi-exclamation-triangle,
[data-theme="dark"] [data-stat-id="high-priority"] i.text-danger {
    color: #FF5722 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

[data-theme="dark"] body .sortable-stat-container[data-stat-id="medium-priority"] i,
[data-theme="dark"] html[data-theme="dark"] .sortable-stat-container[data-stat-id="medium-priority"] i,
[data-theme="dark"] .sortable-stat-container[data-stat-id="medium-priority"] .bi-exclamation,
[data-theme="dark"] .sortable-stat-container[data-stat-id="medium-priority"] i.bi-exclamation,
[data-theme="dark"] [data-stat-id="medium-priority"] i.text-warning {
    color: #FF9800 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

[data-theme="dark"] body .sortable-stat-container[data-stat-id="low-priority"] i,
[data-theme="dark"] html[data-theme="dark"] .sortable-stat-container[data-stat-id="low-priority"] i,
[data-theme="dark"] .sortable-stat-container[data-stat-id="low-priority"] .bi-arrow-down-circle,
[data-theme="dark"] .sortable-stat-container[data-stat-id="low-priority"] i.bi-arrow-down-circle,
[data-theme="dark"] [data-stat-id="low-priority"] i.text-info {
    color: #2196F3 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

[data-theme="dark"] body .sortable-stat-container[data-stat-id="production-value"] i,
[data-theme="dark"] html[data-theme="dark"] .sortable-stat-container[data-stat-id="production-value"] i,
[data-theme="dark"] .sortable-stat-container[data-stat-id="production-value"] .bi-currency-dollar,
[data-theme="dark"] .sortable-stat-container[data-stat-id="production-value"] i.bi-currency-dollar,
[data-theme="dark"] [data-stat-id="production-value"] i.text-success {
    color: #4CAF50 !important;
    filter: none !important;
    -webkit-filter: none !important;
}

/* OVERRIDE ANY BOOTSTRAP TEXTCLASSES IN DARK MODE */
[data-theme="dark"] .text-primary,
[data-theme="dark"] .text-danger,
[data-theme="dark"] .text-warning,
[data-theme="dark"] .text-info,
[data-theme="dark"] .text-success {
    filter: none !important;
    -webkit-filter: none !important;
}

/* NUCLEAR OPTION: Override ALL icon styling in stats containers */
[data-theme="dark"] .sortable-stat-container i[class*="bi-"],
[data-theme="dark"] .overview-card i[class*="bi-"],
[data-theme="dark"] [data-stat-id] i[class*="bi-"] {
    filter: none !important;
    -webkit-filter: none !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* GLOBAL ICON COLOR RESET FOR STATS */
[data-theme="dark"] .sortable-stat-container .bi-file-earmark-text { color: #4FC3F7 !important; }
[data-theme="dark"] .sortable-stat-container .bi-building { color: #66BB6A !important; }
[data-theme="dark"] .sortable-stat-container .bi-currency-dollar { color: #FFD54F !important; }
[data-theme="dark"] .sortable-stat-container .bi-exclamation-triangle { color: #FF5722 !important; }
[data-theme="dark"] .sortable-stat-container .bi-exclamation { color: #FF9800 !important; }
[data-theme="dark"] .sortable-stat-container .bi-arrow-down-circle { color: #2196F3 !important; }

/* Light mode - keep existing behavior but ensure colors are visible */
[data-theme="light"] [data-stat-id="tender-projects"] .stats-icon,
[data-theme="light"] [data-stat-id="tender-projects"] .bi-file-earmark-text {
    color: #1976D2 !important; /* Darker blue for light mode */
}

[data-theme="light"] [data-stat-id="production-projects"] .stats-icon,
[data-theme="light"] [data-stat-id="production-projects"] .bi-building {
    color: #388E3C !important; /* Darker green for light mode */
}

[data-theme="light"] [data-stat-id="tenders-value"] .stats-icon,
[data-theme="light"] [data-stat-id="tenders-value"] .bi-currency-dollar {
    color: #F57C00 !important; /* Darker yellow/orange for light mode */
}

[data-theme="light"] [data-stat-id="high-priority"] .stats-icon,
[data-theme="light"] [data-stat-id="high-priority"] .bi-exclamation-triangle {
    color: #D32F2F !important; /* Red for high priority in light mode */
}

[data-theme="light"] [data-stat-id="medium-priority"] .stats-icon,
[data-theme="light"] [data-stat-id="medium-priority"] .bi-exclamation {
    color: #F57C00 !important; /* Orange for medium priority in light mode */
}

[data-theme="light"] [data-stat-id="low-priority"] .stats-icon,
[data-theme="light"] [data-stat-id="low-priority"] .bi-arrow-down-circle {
    color: #1976D2 !important; /* Blue for low priority in light mode */
}

[data-theme="light"] [data-stat-id="production-value"] .stats-icon,
[data-theme="light"] [data-stat-id="production-value"] .bi-currency-dollar {
    color: #388E3C !important; /* Green for production value in light mode */
}

/* TEMPLATE-SPECIFIC ICON TARGETING - Based on actual HTML structure */
[data-theme="dark"] .stat-icon.me-2 i.bi-file-earmark-text.text-primary {
    color: #4FC3F7 !important;
}

[data-theme="dark"] .stat-icon.me-2 i.bi-building.text-primary {
    color: #66BB6A !important;
}

[data-theme="dark"] .stat-icon.me-2 i.bi-currency-dollar.text-primary {
    color: #FFD54F !important;
}

[data-theme="dark"] .stat-icon.me-2 i.bi-exclamation-triangle.text-danger {
    color: #FF5722 !important;
}

[data-theme="dark"] .stat-icon.me-2 i.bi-exclamation.text-warning {
    color: #FF9800 !important;
}

[data-theme="dark"] .stat-icon.me-2 i.bi-arrow-down-circle.text-info {
    color: #2196F3 !important;
}

[data-theme="dark"] .stat-icon.me-2 i.bi-currency-dollar.text-success {
    color: #4CAF50 !important;
}

/* FORCE OVERRIDE BOOTSTRAP COLOR CLASSES IN DARK MODE STATS */
[data-theme="dark"] .sortable-stat-container .text-primary,
[data-theme="dark"] .overview-card .text-primary {
    color: #4FC3F7 !important;
}

[data-theme="dark"] .sortable-stat-container .text-danger,
[data-theme="dark"] .overview-card .text-danger {
    color: #FF5722 !important;
}

[data-theme="dark"] .sortable-stat-container .text-warning,
[data-theme="dark"] .overview-card .text-warning {
    color: #FF9800 !important;
}

[data-theme="dark"] .sortable-stat-container .text-info,
[data-theme="dark"] .overview-card .text-info {
    color: #2196F3 !important;
}

[data-theme="dark"] .sortable-stat-container .text-success,
[data-theme="dark"] .overview-card .text-success {
    color: #4CAF50 !important;
}

/* DARK MODE TEXT VISIBILITY FIX FOR DASHBOARD STATISTICS CARDS */
/* Ensure all text in overview cards is visible on white/light backgrounds in dark mode */
[data-theme="dark"] .overview-card,
[data-theme="dark"] .overview-card .card-body,
[data-theme="dark"] .sortable-stat-container .card,
[data-theme="dark"] .sortable-stat-container .card-body {
    background-color: #ffffff !important;
    color: #000000 !important;
}

[data-theme="dark"] .overview-card h5,
[data-theme="dark"] .overview-card h6,
[data-theme="dark"] .overview-card .card-title,
[data-theme="dark"] .overview-card .mb-0,
[data-theme="dark"] .sortable-stat-container h5,
[data-theme="dark"] .sortable-stat-container h6,
[data-theme="dark"] .sortable-stat-container .card-title,
[data-theme="dark"] .sortable-stat-container .mb-0 {
    color: #000000 !important;
}

/* Ensure all text elements inside statistics cards are dark/black in dark mode */
[data-theme="dark"] .overview-card *:not(i):not(.stat-icon):not(.text-primary):not(.text-danger):not(.text-warning):not(.text-info):not(.text-success),
[data-theme="dark"] .sortable-stat-container *:not(i):not(.stat-icon):not(.text-primary):not(.text-danger):not(.text-warning):not(.text-info):not(.text-success) {
    color: #000000 !important;
}

/* Light mode - ensure cards have proper styling */
[data-theme="light"] .overview-card,
[data-theme="light"] .overview-card .card-body,
[data-theme="light"] .sortable-stat-container .card,
[data-theme="light"] .sortable-stat-container .card-body {
    background-color: #ffffff !important;
    color: #000000 !important;
}

[data-theme="light"] .overview-card h5,
[data-theme="light"] .overview-card h6,
[data-theme="light"] .overview-card .card-title,
[data-theme="light"] .overview-card .mb-0,
[data-theme="light"] .sortable-stat-container h5,
[data-theme="light"] .sortable-stat-container h6,
[data-theme="light"] .sortable-stat-container .card-title,
[data-theme="light"] .sortable-stat-container .mb-0 {
    color: #000000 !important;
}

/* DARK MODE FIX: Projects page "My Projects" section text visibility */
/* Strategy: Set default black text for card-body, let components use their own colors */

/* Set white background and default black text for the card */
[data-theme="dark"] .projects-table-card {
    background-color: #ffffff !important;
}

[data-theme="dark"] .projects-table-card .card-body {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Fix all text elements in the projects card header section */
[data-theme="dark"] .projects-table-card h2,
[data-theme="dark"] .projects-table-card h1,
[data-theme="dark"] .projects-table-card h3,
[data-theme="dark"] .projects-table-card h4,
[data-theme="dark"] .projects-table-card h5,
[data-theme="dark"] .projects-table-card h6,
[data-theme="dark"] .projects-table-card .d-flex,
[data-theme="dark"] .projects-table-card small {
    color: #000000 !important;
}

/* Fix text-muted elements in the projects card to use dark gray in dark mode */
[data-theme="dark"] .projects-table-card .text-muted {
    color: #6c757d !important;
}

/* Project numbers/links should be orange in dark mode - override the black text rule */
[data-theme="dark"] .projects-table-card .constructions-pilot-theme,
[data-theme="dark"] .projects-table-card a.constructions-pilot-theme,
[data-theme="dark"] .projects-table-card .table tbody td a.constructions-pilot-theme,
[data-theme="dark"] .projects-table-card .table tbody tr td a.constructions-pilot-theme,
[data-theme="dark"] .projects-table-card tbody td a.constructions-pilot-theme,
[data-theme="dark"] .projects-table-card tbody tr td a.constructions-pilot-theme {
    color: #d39e10 !important;
}

/* Additional specificity for project number links */
[data-theme="dark"] .table tbody td:first-child a,
[data-theme="dark"] .projects-table-card .table tbody td:first-child a {
    color: #d39e10 !important;
}

/* Fix Info column text to be black in dark mode - Enhanced targeting */
[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5),
[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5) *,
[data-theme="dark"] .projects-table-card .table tbody tr td:nth-child(5),
[data-theme="dark"] .projects-table-card .table tbody tr td:nth-child(5) *,
[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5) .dropdown-toggle,
[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5) .btn,
[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5) button,
[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5) a {
    color: #000000 !important;
    background-color: transparent !important;
}

/* Restore dark theme for the table section only - be specific to avoid affecting components */
[data-theme="dark"] .projects-table-card .table-responsive {
    background-color: var(--dark-bg) !important;
}

[data-theme="dark"] .projects-table-card .table {
    background-color: var(--dark-bg) !important;
    color: var(--text-light) !important;
}

/* Only target actual table structure elements, not all descendants */
/* Removed duplicate rules - consolidated below after global .table styles for proper precedence */

/* Light mode - ensure consistency */
[data-theme="light"] .projects-table-card {
    background-color: #ffffff !important;
}

[data-theme="light"] .projects-table-card .card-body {
    background-color: #ffffff !important;
    color: #000000;
}

/* ULTIMATE INFO COLUMN TEXT FIX - Maximum specificity */
.projects-table-card .table tbody td:nth-child(5),
.projects-table-card .table tbody td:nth-child(5) *,
.projects-table-card .table tbody td:nth-child(5) .dropdown-toggle,
.projects-table-card .table tbody td:nth-child(5) .btn,
.projects-table-card .table tbody td:nth-child(5) button,
.projects-table-card .table tbody td:nth-child(5) a,
.projects-table-card .table tbody td:nth-child(5) .dropdown-item,
html .projects-table-card .table tbody td:nth-child(5),
html .projects-table-card .table tbody td:nth-child(5) *,
body .projects-table-card .table tbody td:nth-child(5),
body .projects-table-card .table tbody td:nth-child(5) * {
    color: #000000 !important;
    background-color: transparent !important;
}

/* Force text color for all themes in Info column */
[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5),
[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5) *,
[data-theme="light"] .projects-table-card .table tbody td:nth-child(5),
[data-theme="light"] .projects-table-card .table tbody td:nth-child(5) *,
html[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5),
html[data-theme="dark"] .projects-table-card .table tbody td:nth-child(5) *,
html[data-theme="light"] .projects-table-card .table tbody td:nth-child(5),
html[data-theme="light"] .projects-table-card .table tbody td:nth-child(5) * {
    color: #000000 !important;
}

/* Ensure Info column text is black in light mode too - Enhanced targeting */
[data-theme="light"] .projects-table-card .table tbody td:nth-child(5),
[data-theme="light"] .projects-table-card .table tbody td:nth-child(5) *,
[data-theme="light"] .projects-table-card .table tbody tr td:nth-child(5),
[data-theme="light"] .projects-table-card .table tbody tr td:nth-child(5) *,
[data-theme="light"] .projects-table-card .table tbody td:nth-child(5) .dropdown-toggle,
[data-theme="light"] .projects-table-card .table tbody td:nth-child(5) .btn,
[data-theme="light"] .projects-table-card .table tbody td:nth-child(5) button,
[data-theme="light"] .projects-table-card .table tbody td:nth-child(5) a {
    color: #000000 !important;
    background-color: transparent !important;
}

/* Table Styles */
.table {
    background: var(--dark-bg);
    color: var(--text-light);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
}

.table th {
    background-color: var(--darker-bg);
    border-bottom: 2px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    padding: 1rem;
    position: relative;
    position: sticky;
    top: 0;
    z-index: 1;
}

.table td {
    background-color: var(--dark-bg);
    color: var(--text-light) !important;
    vertical-align: middle;
    padding: 0.5rem;
}

/* Table arrow elements and sort indicators */
.table th::before,
.table th::after,
.table-arrow,
.sort-arrow,
.table-sort-arrow {
    color: #d39e10 !important;
}

/* Form arrow elements */
.form-arrow,
.input-arrow,
.select-arrow,
.form-control::before,
.form-control::after {
    color: #d39e10 !important;
}

.table td,
.table td * {
    color: var(--text-light) !important;
}

.column-resize-handle {
    position: absolute;
    right: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: rgba(245, 179, 1, 0.2);
    cursor: col-resize;
    z-index: 1;
    transition: background-color 0.2s;
}

/* ===================================================================
   PROJECTS TABLE DARK MODE OVERRIDES
   Note: The authoritative dark mode styles for .projects-table-card
   are defined inline in templates/projects.html to ensure they load
   last and override all global dark mode CSS rules.
   =================================================================== */

.column-resize-handle:hover {
    background-color: var(--primary-color);
    width: 4px;
}

th {
    position: relative;
    padding-right: 10px !important;
}

.table td {
    padding: 1px 2px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.75rem;
}

.table th {
    padding: 1px 2px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.form-control-sm {
    padding: 2px 4px;
    font-size: 0.85rem;
}

.unit-select {
    padding: 2px;
    font-size: 0.85rem;
}

/* Button Styles */
.btn-primary {
    background-color: var(--primary-color);
    border: none;
    color: var(--dark-bg);
    font-weight: 600;
    padding: 0.25rem 0.625rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-primary:hover {
    background-color: #e5a801;
    transform: translateY(-1px);
}

/* Button arrows and text elements */
.btn::before,
.btn::after,
.btn-arrow,
.button-arrow-text {
    color: #d39e10 !important;
}

/* Header arrow elements */
.header-arrow,
.header-arrow-text,
.title-arrow {
    color: #d39e10 !important;
}

/* Subscription Plan Buttons - Orange theme matching application */
.btn-plan-basic {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    border: 2px solid transparent;
    color: #000000 !important;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(245, 179, 1, 0.4);
    position: relative;
    overflow: hidden;
    text-shadow: none;
}

.btn-plan-basic:hover {
    background: linear-gradient(135deg, #FF8C00 0%, #E5A801 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 179, 1, 0.5);
    color: #000000 !important;
}

.btn-plan-basic:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(245, 179, 1, 0.4);
    color: #000000 !important;
}

.btn-plan-premium {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    border: 2px solid transparent;
    color: #000000 !important;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(245, 179, 1, 0.5);
    position: relative;
    overflow: hidden;
    text-shadow: none;
}

.btn-plan-premium:hover {
    background: linear-gradient(135deg, #FF8C00 0%, #E5A801 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 179, 1, 0.6);
    color: #000000 !important;
}

.btn-plan-premium:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(245, 179, 1, 0.5);
    color: #000000 !important;
}

.btn-plan-enterprise {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    border: 2px solid transparent;
    color: #000000 !important;
    font-weight: 800;
    font-size: 1rem;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(245, 179, 1, 0.5);
    position: relative;
    overflow: hidden;
    text-shadow: none;
}

.btn-plan-enterprise:hover {
    background: linear-gradient(135deg, #FF8C00 0%, #E5A801 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 179, 1, 0.6);
    color: #000000 !important;
}

.btn-plan-enterprise:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(245, 179, 1, 0.5);
    color: #000000 !important;
}

/* Dark mode specific overrides */
[data-theme="dark"] .btn-plan-basic,
[data-theme="dark"] .btn-plan-premium,
[data-theme="dark"] .btn-plan-enterprise {
    color: #000000 !important;
    text-shadow: none;
}

[data-theme="dark"] .btn-plan-basic:hover,
[data-theme="dark"] .btn-plan-basic:active,
[data-theme="dark"] .btn-plan-premium:hover,
[data-theme="dark"] .btn-plan-premium:active,
[data-theme="dark"] .btn-plan-enterprise:hover,
[data-theme="dark"] .btn-plan-enterprise:active {
    color: #000000 !important;
}

/* Light mode overrides - same orange theme */
[data-theme="light"] .btn-plan-basic {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(245, 179, 1, 0.3);
    text-shadow: none;
}

[data-theme="light"] .btn-plan-basic:hover {
    background: linear-gradient(135deg, #FF8C00 0%, #E5A801 100%);
    color: #000000 !important;
    box-shadow: 0 8px 25px rgba(245, 179, 1, 0.4);
}

[data-theme="light"] .btn-plan-premium {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(245, 179, 1, 0.3);
    text-shadow: none;
}

[data-theme="light"] .btn-plan-premium:hover {
    background: linear-gradient(135deg, #FF8C00 0%, #E5A801 100%);
    color: #000000 !important;
    box-shadow: 0 8px 25px rgba(245, 179, 1, 0.4);
}

[data-theme="light"] .btn-plan-enterprise {
    background: linear-gradient(135deg, #d39e10 0%, #FF8C00 100%);
    color: #000000 !important;
    box-shadow: 0 4px 15px rgba(245, 179, 1, 0.3);
    text-shadow: none;
}

[data-theme="light"] .btn-plan-enterprise:hover {
    background: linear-gradient(135deg, #FF8C00 0%, #E5A801 100%);
    color: #000000 !important;
    box-shadow: 0 8px 25px rgba(245, 179, 1, 0.4);
}

/* Button shimmer effect for premium plans */
.btn-plan-premium::before,
.btn-plan-enterprise::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.btn-plan-premium:hover::before,
.btn-plan-enterprise:hover::before {
    left: 100%;
}

.btn-outline-primary {
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    transition: all 0.3s ease;
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
    padding: 0.25rem 0.625rem;
    font-size: 0.875rem;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #000000;
}

/* Form Styles */
.form-control {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    transition: all 0.3s ease;
}

.form-control:focus {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(245, 179, 1, 0.25);
    color: var(--text-light);
}

/* Ensure better contrast in light mode */
[data-theme="light"] .form-control {
    background-color: #ffffff;
    color: #333333;
    border: 1px solid #cccccc;
}

[data-theme="light"] .form-control:focus {
    background-color: #ffffff;
    color: #333333;
}

/* Form select and dropdown styles */
.form-select {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    color: var(--text-light) !important;
    padding: 0.375rem 2.25rem 0.375rem 0.75rem;
}

.form-select option {
    background-color: var(--darker-bg) !important;
    color: var(--text-light) !important;
    padding: 8px;
}

/* Dark mode specific styles */
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-select option {
    background-color: var(--darker-bg) !important;
    color: var(--text-light) !important;
}

/* Light mode specific styles */
[data-theme="light"] .form-select {
    background-color: #ffffff !important;
    color: #333333 !important;
    border: 1px solid #cccccc;
}

[data-theme="light"] .form-select option {
    background-color: #ffffff !important;
    color: #333333 !important;
}

/* Dropdown hover states */
.form-select option:hover,
.form-select option:focus {
    background-color: var(--primary-color);
    color: var(--text-dark);
}

/* Modal form styles */
.modal-content .form-select,
.modal-content .form-control {
    background-color: var(--input-bg-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

.modal-content .form-select option {
    background-color: var(--input-bg-dark);
    color: var(--text-light);
    padding: 8px;
}

[data-theme="light"] .modal-content .form-select,
[data-theme="light"] .modal-content .form-control {
    background-color: var(--input-bg-light);
    color: var(--text-dark);
}

[data-theme="light"] .modal-content .form-select option {
    background-color: var(--input-bg-light);
    color: var(--text-dark);
}

/* Modal Styles */
.modal-content {
    background-color: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-light) !important;
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

/* Dark mode modal backdrop */
[data-theme="dark"] .modal {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

/* Alert and Toast Styles */
.alert {
    background-color: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

/* Toast container and message styles */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1070;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.toast {
    min-width: 300px;
    margin-bottom: 10px;
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
    display: block;
    pointer-events: auto;
    background-color: var(--darker-bg);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #28a745;
    color: white;
    border: 1px solid #1e7e34;
}

.toast.error {
    background-color: #dc3545;
    color: white;
    border: 1px solid #bd2130;
}

.toast.warning {
    background-color: #ffc107;
    color: #333;
    border: 1px solid #d39e00;
}

[data-theme="light"] {
    --darker-bg: #f8f9fa;
    --dark-bg: #ffffff;
    --text-light: #000000;
}

[data-theme="light"] .toast {
    color: #000;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .form-control,
[data-theme="light"] .form-select {
    background-color: #fff;
    color: #000;
    border: 1px solid #ced4da;
}

[data-theme="light"] .modal-content {
    background-color: #fff;
    color: #000;
}

[data-theme="light"] .table th {
    background-color: #f8f9fa;
    color: #000;
}

/* Ad Styles - Bootstrap-based layout */
.ad-sidebar-col {
    width: 180px; /* A bit wider than the ad for padding */
    background-color: var(--darker-bg);
    border-right: 1px solid var(--border-color);
    padding: 10px;
    z-index: 10;
}

.ad-container {
    position: sticky;
    top: 20px;
    height: 600px; /* Standard size for vertical banner ads */
    width: 160px;
    margin: 0 auto;
    overflow: hidden;
}

.mobile-ad-container {
    padding: 10px 0;
    background-color: var(--darker-bg);
    border-bottom: 1px solid var(--border-color);
}

/* Ad placeholder styling for visual representation */
.ad-placeholder, .ad-placeholder-mobile {
    width: 100%;
    height: 100%;
    background: rgba(var(--primary-color-rgb), 0.2);
    border: 2px dashed rgba(var(--primary-color-rgb), 0.7);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    animation: pulse 2s infinite;
}

.ad-placeholder-mobile {
    height: 90px; /* Standard mobile leaderboard height */
    max-width: 728px;
    margin: 0 auto;
}

@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

.ad-placeholder-text {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    transform: rotate(-90deg);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ad-placeholder-text-mobile {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .ad-placeholder,
[data-theme="light"] .ad-placeholder-mobile {
    background: rgba(var(--primary-color-rgb), 0.1);
    border: 2px dashed rgba(var(--primary-color-rgb), 0.5);
}

/* Ensure ads display correctly in both light and dark themes */
[data-theme="light"] .ad-sidebar-col,
[data-theme="light"] .mobile-ad-container {
    background-color: #f8f9fa;
    border-right-color: #dee2e6;
    border-bottom-color: #dee2e6;
}

[data-theme="dark"] .ad-sidebar-col,
[data-theme="dark"] .mobile-ad-container {
    background-color: var(--darker-bg);
    border-right-color: var(--border-color);
    border-bottom-color: var(--border-color);
}

/* BOQ Phase Row Styling - Reference Color #474747 - ULTIMATE OVERRIDE */
html body .phase-row,
html body #boqTable .phase-row,
html body #boq-table .phase-row,
html body .boq-table .phase-row,
html body tr.phase-row,
html body tr[data-level="phase"],
html body tr[data-type="phase"] {
    background-color: #474747 !important;
    font-weight: 600 !important;
    border-left: 4px solid #ff8f00 !important;
    padding: 0.5rem !important;
    color: #ebb012 !important;
}

html body .phase-row td, 
html body .phase-row th,
html body #boqTable .phase-row td, 
html body #boqTable .phase-row th,
html body #boq-table .phase-row td, 
html body #boq-table .phase-row th,
html body .boq-table .phase-row td, 
html body .boq-table .phase-row th,
html body tr.phase-row td, 
html body tr.phase-row th,
html body tr[data-level="phase"] td, 
html body tr[data-level="phase"] th,
html body tr[data-type="phase"] td, 
html body tr[data-type="phase"] th {
    background-color: #474747 !important;
    font-weight: 700 !important;
    color: #ebb012 !important;
}

/* Dark mode phase row styling */
[data-theme="dark"] html body .phase-row,
[data-theme="dark"] html body #boqTable .phase-row,
[data-theme="dark"] html body #boq-table .phase-row,
[data-theme="dark"] html body .boq-table .phase-row,
[data-theme="dark"] html body tr.phase-row,
[data-theme="dark"] html body tr[data-level="phase"],
[data-theme="dark"] html body tr[data-type="phase"] {
    background-color: #474747 !important;
}

[data-theme="dark"] html body .phase-row td, 
[data-theme="dark"] html body .phase-row th,
[data-theme="dark"] html body #boqTable .phase-row td, 
[data-theme="dark"] html body #boqTable .phase-row th,
[data-theme="dark"] html body #boq-table .phase-row td, 
[data-theme="dark"] html body #boq-table .phase-row th,
[data-theme="dark"] html body .boq-table .phase-row td, 
[data-theme="dark"] html body .boq-table .phase-row th,
[data-theme="dark"] html body tr.phase-row td, 
[data-theme="dark"] html body tr.phase-row th,
[data-theme="dark"] html body tr[data-level="phase"] td, 
[data-theme="dark"] html body tr[data-level="phase"] th,
[data-theme="dark"] html body tr[data-type="phase"] td, 
[data-theme="dark"] html body tr[data-type="phase"] th {
    background-color: #474747 !important;
    color: #ebb012 !important;
}

/* Light mode phase row styling */
[data-theme="light"] html body .phase-row,
[data-theme="light"] html body #boqTable .phase-row,
[data-theme="light"] html body #boq-table .phase-row,
[data-theme="light"] html body .boq-table .phase-row,
[data-theme="light"] html body tr.phase-row,
[data-theme="light"] html body tr[data-level="phase"],
[data-theme="light"] html body tr[data-type="phase"] {
    background-color: #cc5200 !important;
    border-left: 4px solid #cc5200 !important;
    color: #ffffff !important;
}

[data-theme="light"] html body .phase-row td, 
[data-theme="light"] html body .phase-row th,
[data-theme="light"] html body #boqTable .phase-row td, 
[data-theme="light"] html body #boqTable .phase-row th,
[data-theme="light"] html body #boq-table .phase-row td, 
[data-theme="light"] html body #boq-table .phase-row th,
[data-theme="light"] html body .boq-table .phase-row td, 
[data-theme="light"] html body .boq-table .phase-row th,
[data-theme="light"] html body tr.phase-row td, 
[data-theme="light"] html body tr.phase-row th,
[data-theme="light"] html body tr[data-level="phase"] td, 
[data-theme="light"] html body tr[data-level="phase"] th,
[data-theme="light"] html body tr[data-type="phase"] td, 
[data-theme="light"] html body tr[data-type="phase"] th {
    background-color: #cc5200 !important;
    color: #ffffff !important;
}

/* CC Row Styling - Reference Color #707070 - ULTIMATE OVERRIDE */
html body .cc-row,
html body #boqTable .cc-row,
html body #boq-table .cc-row,
html body .boq-table .cc-row,
html body tr.cc-row,
html body tr[data-level="cc"],
html body tr[data-type="cc"] {
    background-color: #707070 !important;
    font-weight: 500 !important;
    color: #ebb012 !important;
}

html body .cc-row td, 
html body .cc-row th,
html body #boqTable .cc-row td, 
html body #boqTable .cc-row th,
html body #boq-table .cc-row td, 
html body #boq-table .cc-row th,
html body .boq-table .cc-row td, 
html body .boq-table .cc-row th,
html body tr.cc-row td, 
html body tr.cc-row th,
html body tr[data-level="cc"] td, 
html body tr[data-level="cc"] th,
html body tr[data-type="cc"] td, 
html body tr[data-type="cc"] th {
    background-color: #707070 !important;
    font-weight: 700 !important;
    color: #ebb012 !important;
}

/* Dark mode CC row styling */
[data-theme="dark"] html body .cc-row,
[data-theme="dark"] html body #boqTable .cc-row,
[data-theme="dark"] html body #boq-table .cc-row,
[data-theme="dark"] html body .boq-table .cc-row,
[data-theme="dark"] html body tr.cc-row,
[data-theme="dark"] html body tr[data-level="cc"],
[data-theme="dark"] html body tr[data-type="cc"] {
    background-color: #707070 !important;
    color: #ebb012 !important;
}

[data-theme="dark"] html body .cc-row td, 
[data-theme="dark"] html body .cc-row th,
[data-theme="dark"] html body #boqTable .cc-row td, 
[data-theme="dark"] html body #boqTable .cc-row th,
[data-theme="dark"] html body #boq-table .cc-row td, 
[data-theme="dark"] html body #boq-table .cc-row th,
[data-theme="dark"] html body .boq-table .cc-row td, 
[data-theme="dark"] html body .boq-table .cc-row th,
[data-theme="dark"] html body tr.cc-row td, 
[data-theme="dark"] html body tr.cc-row th,
[data-theme="dark"] html body tr[data-level="cc"] td, 
[data-theme="dark"] html body tr[data-level="cc"] th,
[data-theme="dark"] html body tr[data-type="cc"] td, 
[data-theme="dark"] html body tr[data-type="cc"] th {
    background-color: #707070 !important;
    color: #ebb012 !important;
}

/* Light mode CC row styling */
[data-theme="light"] html body .cc-row,
[data-theme="light"] html body #boqTable .cc-row,
[data-theme="light"] html body #boq-table .cc-row,
[data-theme="light"] html body .boq-table .cc-row,
[data-theme="light"] html body tr.cc-row,
[data-theme="light"] html body tr[data-level="cc"],
[data-theme="light"] html body tr[data-type="cc"] {
    background-color: #707070 !important;
    color: #ebb012 !important;
}

[data-theme="light"] html body .cc-row td, 
[data-theme="light"] html body .cc-row th,
[data-theme="light"] html body #boqTable .cc-row td, 
[data-theme="light"] html body #boqTable .cc-row th,
[data-theme="light"] html body #boq-table .cc-row td, 
[data-theme="light"] html body #boq-table .cc-row th,
[data-theme="light"] html body .boq-table .cc-row td, 
[data-theme="light"] html body .boq-table .cc-row th,
[data-theme="light"] html body tr.cc-row td, 
[data-theme="light"] html body tr.cc-row th,
[data-theme="light"] html body tr[data-level="cc"] td, 
[data-theme="light"] html body tr[data-level="cc"] th,
[data-theme="light"] html body tr[data-type="cc"]td, 
[data-theme="light"] html body tr[data-type="cc"] th {
    background-color: #707070 !important;
    color: #ebb012 !important;
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .navbar {
        padding: 0.5rem 1rem;
    }

    .stat-card {
        margin-bottom: 1rem;
    }

    .ad-placeholder-mobile {
        height: 50px; /* Smaller mobile banner height */
        max-width: 320px; /* Mobile banner width */
    }
}

/* Print Styles - Keep existing print styles */
@media print {
    .page-number::before {
        content: counter(page);
        color: black !important;
    }

    @page {
        size: landscape;
        margin: 1cm 0.5cm;
        counter-increment: page;
    }

    /* Hide ad containers when printing */
    .ad-sidebar-col, 
    .mobile-ad-container,
    .ad-container,
    .ad-placeholder,
    .ad-placeholder-mobile {
        display: none !important;
    }

    /* BOQ Print Specific Styles */
    .boq-action-buttons, .btn-group, .form-control, .form-select, 
    #selectAll, .row-select, .item-drag-handle, .toggle-btn, 
    .item-note-btn, .bi-grip-vertical, .bi-pencil-square {
        display: none !important;
    }

    /* Hide first two columns in BOQ table (toggle and checkbox) */
    .boq-table thead th:nth-child(1), .boq-table thead th:nth-child(2),
    .boq-table tbody td:nth-child(1), .boq-table tbody td:nth-child(2) {
        display: none !important;
    }

    /* Print header styling */
    .print-header {
        text-align: center;
        margin-bottom: 15px;
        border-bottom: 1px solid #000;
        padding-bottom: 10px;
        font-size: 14pt;
    }

    .print-header h2 {
        margin-bottom: 5px;
        font-size: 18pt;
    }

    .print-header p {
        margin: 2px 0;
        font-size: 10pt;
    }

    /* Table styling for print */
    .boq-table {
        width: 100%;
        table-layout: fixed !important;
        border-collapse: collapse;
        border: 1px solid #000;
    }

    .boq-table th, .boq-table td {
        border: 1px solid #000;
        padding: 4px 6px;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        white-space: normal !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Fixed column widths for print */
    .boq-table th.number-col, .boq-table td.number-col {
        width: 12% !important;
    }

    .boq-table th.description-col, .boq-table td.description-col {
        width: 40% !important;
    }

    .boq-table th.takeoff-col, .boq-table td.takeoff-col {
        width: 12% !important;
    }

    .boq-table th.unit-col, .boq-table td.unit-col {
        width: 8% !important;
    }

    .boq-table th.price-col, .boq-table td.price-col {
        width: 12% !important;
    }

    .boq-table th.total-col, .boq-table td.total-col {
        width: 16% !important;
    }

    /* Row styling */
    .boq-table tr.phase-row {
        background-color: #f0f0f0 !important;
        font-weight: bold;
    }

    .boq-table tr.cc-row {
        background-color: #e6e6e6 !important;
    }

    /* Project total styling */
    .boq-table tfoot tr {
        font-weight: bold;
        font-size: 12pt;
        background-color: #f0f0f0 !important;
        border-top: 2px solid #000;
    }

    /* Prevent page breaks inside items */
    .boq-table tr { 
        page-break-inside: avoid; 
    }

    .project-header {
        position: fixed;
        top: 0.3cm;
        left: 0;
        width: 100%;
        text-align: center;
        font-size: 9pt !important;
        font-weight: bold;
        color: black !important;
        background-color: white !important;
        padding: 0.2cm 0;
        margin-bottom: 0.5cm;
        z-index: 1000;
        font-family: Arial, sans-serif;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    .header-text {
        color: black !important;
        display: inline-block;
        background: white !important;
        padding: 0 1cm;
    }

    body * {
        visibility: hidden;
        margin: 0;
        padding: 0;
        font-size: 7pt !important;
        line-height: 1 !important;
    }

    .print-container {
        display: block !important;
        margin-bottom: 1cm;
    }

    @media print {
        .print-header {
            position: fixed;
            bottom: 0.5cm;
            left: 0.5cm;
            font-size: 8pt !important;
            font-weight: bold;
            color: black !important;
            font-family: Arial, sans-serif;
        }

        .project-total-container {
            display: none;
            page-break-before: avoid;
            page-break-inside: avoid;
        }

        .project-total-container:last-of-type {
            display: block;
        }

        tr {
            page-break-inside: avoid;
        }

        thead {
            display: table-header-group;
        }

        tfoot {
            display: table-footer-group;
        }
    }

    .page-number::before {
        content: counter(page);
        color: black !important;
    }

    @page {
        @top-left {
            content: element(project-info);
        }
    }

    .table {
        color: black !important;
        background: white !important;
        width: 100% !important;
        border-collapse: collapse;
        table-layout: fixed !important;
    }

    .table td,
    .table th {
        color: black !important;
        background: white !important;
        border: 1px solid #ddd !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        white-space: normal !important;
        max-width: 100% !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .phase-row,
    .cc-row {
        color: black !important;
        background: white !important;
        border: 2px solid #000 !important;
        background-color: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
    }

    .btn,
    .header-container button,
    #optionsMenu,
    .toggle-btn {
        display: none !important;
    }

    .form-control,
    .form-select {
        border: none !important;
        background: white !important;
        color: black !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    input[type="checkbox"] {
        display: none !important;
    }

    .d-none {
        display: table-row !important;
    }

    .table-container {
        max-height: none !important;
        overflow: visible !important;
    }

    .header-container {
        position: static !important;
        padding: 0 !important;
        border: none !important;
    }

    .table:empty,
    tbody:empty,
    tr:empty {
        display: none !important;
    }

    .table-container:empty {
        display: none !important;
        page-break-after: avoid !important;
    }

    /* Fix for long numbers wrapping */
    .table td, .number-col, .takeoff-col, .price-col, .total-col {
        font-family: monospace !important;
        font-size: 6.5pt !important;
        white-space: normal !important;
        word-break: break-all !important;
    }

    /* Adjust font size for very long content */
    td:has(> :first-child:not(:empty):nth-last-child(1)) {
        font-size: 6pt !important;
    }
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.modal-title {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-light);
}

.form-label {
    color: var(--text-light);
}

[data-theme="light"] .form-label {
    color: #000000;
}

input[type="date"].form-control {
    color: var(--text-light);
    background-color: var(--input-bg-dark);
}

input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: invert(1);
}

[data-theme="light"] input[type="date"].form-control {
    color: var(--text-dark);
    background-color: var(--input-bg-light);
}

[data-theme="light"] input[type="date"].form-control::-webkit-calendar-picker-indicator {
    filter: invert(0);
}

/* Main search box - WHITE text in dark mode */
body[data-theme="dark"] #projectSearch,
html[data-theme="dark"] #projectSearch,
[data-theme="dark"] #projectSearch {
    background-color: var(--darker-bg) !important;
    border-color: var(--border-color) !important;
    color: #ffffff !important;
}

/* Main search box - BLACK text in light mode */
body[data-theme="light"] #projectSearch,
html[data-theme="light"] #projectSearch,
[data-theme="light"] #projectSearch {
    background-color: white !important;
    color: black !important;
    border: 1px solid #ddd !important;
}

.form-select {
    background-color: white;
    color: black !important;
    border: 1px solid #ddd;
    background-color: var(--darker-bg);
    border-color: var(--border-color);
    color: var(--text-light);
}

.form-select option {
    background-color: white !important;
    color: black !important;
    background-color: var(--dark-bg);
}

#projectSearch::placeholder {
    color: #999;
}

[data-theme="light"] #projectSearch::placeholder {
    color: #666;
}

.form-control:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
    color: var(--text-light);
}

.form-control::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .form-control::placeholder {
    color: #666;
}

/* Landing Page Styles */
.landing-container {
    margin-top: 2rem;
    margin-bottom: 4rem;
}

.hero-section {
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.hero-image {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
}

.cta-buttons {
    margin-top: 2rem;
}

.features-section {
    padding: 3rem 0;
}

.feature-card {
    background-color: var(--darker-bg);
    border-radius: 8px;
    padding: 2rem;
    height: 100%;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.feature-card p {
    color: var(--text-light);
    opacity: 0.8;
}

.cta-section {
    background-color: var(--darker-bg);
    padding: 3rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-top: 3rem;
}

/* Landing Page Text Colors - Proper White Text for Dark Backgrounds */
.landing-page .hero-section h1,
.landing-page .hero-section .lead,
.landing-page .hero-section p,
.landing-page .cta-section h2,
.landing-page .cta-section .lead,
.landing-page .cta-section p {
    color: #ffffff !important;
    text-shadow: none !important;
}

/* Landing Page Statistics Section - White Text on Orange */
.landing-page .stats-section h2,
.landing-page .stats-section .lead,
.landing-page .stats-section .stat-card h3,
.landing-page .stats-section .stat-card p {
    color: #ffffff !important;
    text-shadow: none !important;
}

/* Feature Cards - Dark Text on White Background */
.landing-page .feature-card h5,
.landing-page .feature-card p {
    color: #333333 !important;
}

/* Testimonial Cards - Dark Text on White Background */
.landing-page .testimonial-card h6,
.landing-page .testimonial-card p,
.landing-page .testimonial-card small {
    color: #333333 !important;
}

/* Section Headings - Dark on White Background */
.landing-page .section-heading {
    color: #333333 !important;
}

/* Dark Mode Overrides for Landing Page */
[data-theme="dark"] .landing-page .feature-card h5,
[data-theme="dark"] .landing-page .feature-card p,
[data-theme="dark"] .landing-page .testimonial-card h6,
[data-theme="dark"] .landing-page .testimonial-card p,
[data-theme="dark"] .landing-page .testimonial-card small {
    color: #e0e0e0 !important;
}

[data-theme="dark"] .landing-page .section-heading {
    color: #ffffff !important;
}

/* Mobile Responsive Landing Page Text */
@media (max-width: 768px) {
    .landing-page .hero-section h1,
    .landing-page .hero-section .lead,
    .landing-page .hero-section p,
    .landing-page .cta-section h2,
    .landing-page .cta-section .lead,
    .landing-page .stats-section h2,
    .landing-page .stats-section .lead,
    .landing-page .stats-section .stat-card h3,
    .landing-page .stats-section .stat-card p {
        color: #ffffff !important;
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5) !important;
    }
}

/* Password instructions and helper text styling */
.password-instructions,
.helper-text,
.form-text,
small.text-muted {
    color: var(--text-light) !important;
    opacity: 0.9;
    display: block;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

[data-theme="light"] .password-instructions,
[data-theme="light"] .helper-text,
[data-theme="light"] .form-text,
[data-theme="light"] small.text-muted {
    color: var(--text-dark) !important;
}

/* Style all links in auth containers */
.auth-container a,
.card a {
    color: var(--primary-color) !important;
    text-decoration: none;
}

.auth-container a:hover,
.card a:hover {
    text-decoration: underline;
}

/* Upgrade Plan link styling in dropdown */
.dropdown-menu a[href*="upgrade"] {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.dropdown-menu a[href*="upgrade"]:hover {
    color: #ff8c00 !important;
    background-color: rgba(var(--primary-color-rgb), 0.1) !important;
}

/* Add your custom styles here */
.sort-icon {
    cursor: pointer;
    margin-left: 5px;
    opacity: 0.5;
    transition: opacity 0.2s;
    color: #d39e10 !important;
}

.sort-icon:hover {
    opacity: 1;
    color: #d39e10 !important;
}

.sort-icon.bi-arrow-up,
.sort-icon.bi-arrow-down {
    opacity: 1;
    color: #d39e10 !important;
}

/* Comprehensive arrow and white text styling */
.arrow,
.arrow-text,
.white-arrow,
.white-text-arrow,
.text-arrow,
.nav-arrow-text,
.menu-arrow,
.dropdown-arrow,
.breadcrumb-arrow-text,
.pagination-arrow,
.accordion-arrow,
.collapse-arrow,
.expand-arrow,
.toggle-arrow,
.caret,
.chevron,
.triangle-arrow {
    color: #d39e10 !important;
}

/* Bootstrap and common UI arrows */
.dropdown-toggle::after,
.btn-group .dropdown-toggle::after,
.dropup .dropdown-toggle::after,
.dropstart .dropdown-toggle::after,
.dropend .dropdown-toggle::after {
    border-color: #d39e10 transparent transparent transparent !important;
}

/* Pagination arrows */
.page-link::before,
.page-link::after,
.pagination .page-link {
    color: #d39e10 !important;
}

/* Modal and dialog arrows */
.modal-arrow,
.dialog-arrow,
.tooltip-arrow,
.popover-arrow {
    color: #d39e10 !important;
}

/* Any remaining white text elements that should be orange */
.white-text,
.text-white:not(.btn):not(.badge),
.navbar-text,
.nav-text {
    color: #d39e10 !important;
}

.dragging {
    opacity: 0.5;
    cursor: move;
}

.drag-over {
    border: 2px dashed #666;
    background-color: rgba(102, 102, 102, 0.1);
}

tr[data-level="item"] {
    cursor: move;
}

/* Add consistent CC row styling */
.cc-row {
    background-color: rgba(255, 165, 0, 0.1) !important;
    color: #ff8c00 !important;
}

.cc-row td,
.cc-row td *,
.cc-row strong,
.cc-row span {
    color: #ff8c00 !important;
}

.cc-row td:first-child {
    padding-left: 2rem !important;
}

#boq-table {
    transition: opacity 0.2s ease-in-out;
}

#boq-table.updating {
    opacity: 0.7;
}

.modal-backdrop {
    transition: opacity 0.2s ease-in-out;
}

.header-container {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--dark-bg);
    padding: 1rem;
    border-bottom: 1px solid var(--primary-color);
}

/* Welcome header sticky styles */
.welcome-header {
    position: sticky;
    top: 0;
    z-index: 1010;
    background-color: var(--dark-bg);
    padding: 10px 15px;
    border-bottom: 1px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}


/* Catalog Import styles */
.catalog-item-checkbox {
    cursor: pointer;
}

.import-item-btn {
    padding: 2px 6px;
}

#catalogTable tbody tr:hover {
    background-color: rgba(245, 179, 1, 0.05);
}

.selected-count {
    color: #6c757d;
    font-size: 0.9rem;
}

#addItemModal .modal-dialog {
    max-width: 800px;
}

#addItemModal .table {
    margin-bottom: 0;
}

#addItemModal .select-container {
    background-color: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100% !important;
    table-layout: fixed;
}

.table-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.table th,
.table td {
    word-wrap: break-word;
    min-width: 0;
}

.table thead {
    position: sticky;
    top: 0;
    z-index: 900;
    background-color: var(--dark-bg);
}

/* Project Search */
#projectSearch    margin-bottom: 10px;
}

/* View button and menu styles */
.view-options-menu {
    min-width: 160px;
    background-color: var(--dark-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
z-index: 1050;

/* Export button styles */
.exporting {
    pointer-events: none;
    opacity: 0.8;
}

    background: var(--dark-bg);
    border: 1px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 150px;
    padding: 8px 0;
}

.view-options-menu .dropdown-item {
    color: var(--text-light);
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--text-light);
    padding: 8px 16px;
}

.view-options-menu .dropdown-item:hover {
    background-color: var(--primary-color);
    color: white;
    background-color: var(--primary-color);
    color: var(--text-dark);
}


/* Preserve existing table styles */
.table thead th {
    background-color: var(--dark-bg);
    border-bottom: 1px solid rgba(245, 179, 1, 0.4);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-right: 1px solid rgba(245, 179, 1, 0.4);
    padding: 12px 8px;
    user-select: none;
}

.editable {
    cursor: pointer;
    display: block;
    padding: 2px 4px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.editable:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.table-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.form-control-sm {
    height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1050;
    min-width: 250px;

/* Toolbar button size reduction */
.header-container .btn, 
#boqTabs .btn,
.boq-action-buttons .btn {
    padding: 0.25rem 0.625rem;
    font-size: 0.875rem;
    height: auto;
    line-height: 1.2;
}

/* Icon size adjustment */
.header-container .btn i, 
#boqTabs .btn i,
.boq-action-buttons .btn i {
    font-size: 0.875rem;
}

/* Ensure consistent sizing for all toolbar actions */
.copy, .paste, .undo, .redo, 
.add-item, .add-phase, .add-cc,
.export-to-excel, .print {
    transform: scale(0.85);
}

    opacity:0;
    transition: opacity 0.3s ease-in-out;
    color: #000000 !important;
    background-color: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.notification.show {
    opacity: 1;
}

.toggle-btn {
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    vertical-align: middle;
    position: relative;
    left: 0;
    margin: 0;
    color: #d39e10;
    font-size: 1.2rem;
}

.cc-row .toggle-btn {
    margin-right: 10px;
    margin-left: -5px;
}

.text-end {
    text-align: right;
}

.options-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--dark-bg);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    z-index: 1060;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    padding: 20px;
}

.options-menu::before {
    content: 'Font Size';
    display: block;
    color: var(--text-light);
    margin-bottom: 10px;
    text-align: center;
    font-weight: bold;
}

#fontSizeValue {
    display: block;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-light);
}

.form-range {
    display: block;
    width: 100%;
}

.form-range {
    width: 100%;
    height: 1.5rem;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    background: var(--primary-color);
    height: 16px;
    width: 16px;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -6px;
}

/* Editable field styles */
.editable {
    position: relative;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.editable:hover {
    background-color: rgba(var(--primary-color-rgb), 0.1);
}

.editable-input-container {
    width: 100%;
    position: relative;
}

.editable-input {
    width: 100%;
    padding: 2px 5px;
    border: 1px solid var(--primary-color);
    border-radius: 3px;
    background-color: var(--dark-bg);
    color: var(--text-light);
    position: absolute;
    z-index: 1000;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
}

.editable-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-range::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: #555;
    border-radius: 2px;
    cursor: pointer;
}

.form-select {
    background-color: white;
    border: 1px solid #333;
    color: black;
    padding: 2px 20px 2px 5px;
    font-size: 0.875rem;
    min-width: 70px;
    background-color: var(--darker-bg);
    border-color: var(--border-color);
    color: var(--text-light);
}

/* Limit dropdown to show only one row */
.form-select {
    size: 1;
}

.form-select option {
    height: 1.5em;
    line-height: 1.5em;
}

/* For unit dropdowns specifically */
.unit-dropdown {
    size: 1;
}

.priority-select {
    width: auto;
    min-width: 90px;
    padding: 5px !important;
    border: 1px solid #ddd !important;
    color: white !important;
}

/* Priority select background colors */
.priority-select[data-value="High"] {
    background-color: #ff4444 !important;
}

.priority-select[data-value="Medium"] {
    background-color: #ffbb33 !important;
}

.priority-select[data-value="Low"] {
    background-color: #33b5e5 !important;
}

.priority-select[data-value="Finished"] {
    background-color: rgb(146, 208, 80) !important;
    color: white !important;
}

/* Dropdown options colors */
.priority-select option[value="High"] {
    background-color: #ff4444 !important;
    color: white !important;
}

.priority-select option[value="Medium"] {
    background-color: #ffbb33 !important;
    color: white !important;
}

.priority-select option[value="Low"] {
    background-color: #33b5e5 !important;
    color: white !important;
}

.priority-select option[value="Finished"] {
    background-color: rgb(146, 208, 80) !important;
    color: white !important;
}

/* Ensure dropdown text is always white */
.priority-select option {
    color: white !important;
}

/* Dark mode fixes for specific elements */
[data-theme="dark"] .text-muted.small {
    color: #ffffff !important;
}

[data-theme="dark"] .projects-table-card .text-muted {
    color: #000000 !important;
}

/* Upgrade page dark mode - ensure white text for all elements */
[data-theme="dark"] .addon-card .text-muted.small,
[data-theme="dark"] .addon-card small.text-muted,
[data-theme="dark"] .currency-note.text-muted.small {
    color: #ffffff !important;
}

/* Force priority dropdowns to use light mode colors in dark theme */
[data-theme="dark"] .priority-select {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    color: #212529 !important;
}

[data-theme="dark"] .priority-select[data-value="High"] {
    background-color: #ff4444 !important;
    color: white !important;
}

[data-theme="dark"] .priority-select[data-value="Medium"] {
    background-color: #ffbb33 !important;
    color: white !important;
}

[data-theme="dark"] .priority-select[data-value="Low"] {
    background-color: #33b5e5 !important;
    color: white !important;
}

[data-theme="dark"] .priority-select[data-value="Finished"] {
    background-color: rgb(146, 208, 80) !important;
    color: white !important;
}

[data-theme="dark"] .priority-select option {
    background-color: #ffffff !important;
    color: #212529 !important;
}

[data-theme="dark"] .priority-select option[value="High"] {
    background-color: #ff4444 !important;
    color: white !important;
}

[data-theme="dark"] .priority-select option[value="Medium"] {
    background-color: #ffbb33 !important;
    color: white !important;
}

[data-theme="dark"] .priority-select option[value="Low"] {
    background-color: #33b5e5 !important;
    color: white !important;
}

[data-theme="dark"] .priority-select option[value="Finished"] {
    background-color: rgb(146, 208, 80) !important;
    color: white !important;
}

.unit-select {
    width: auto;
    min-width: 70px;
    max-width: 100px;
    padding-right: 20px;
    text-overflow: ellipsis;
}

.form-select option {
    padding: 4px;
    background-color: var(--dark-bg);
}

/* Loading animations and transitions */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1080;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

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

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Table animations */
.table tr {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.table tr.fade-out {
    opacity: 0;
    transform: translateX(-20px);
}

.table tr.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Input animations */
.form-control,
.form-select {
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Button animations */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(1px);
}

/* Loading state for buttons */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-top: -8px;
    margin-left: -8px;
    border: 2px solid var(--primary-color);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Smooth transitions for notifications */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1070;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.alert.show {
    opacity: 1;
    transform: translateX(0);
}

/* Editable field animations */
.editable {
    position: relative;
    transition: background-color 0.2s ease;
}

.editable:hover {
    background-color: rgba(245, 179, 1, 0.1);
}

.editable:hover::after {
    content: '✎';
    position: absolute;
    right: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1070;
    pointer-events: none;
}

.toast {
    padding: 15px 25px;
    border-radius: 4px;
    margin-bottom: 10px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 350px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .toast {
    background-color: #fff;
    color: #333;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .toast {
    background-color: #333;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-header {
    background-color: var(--dark-bg);
    border-bottom-color: var(--border-color);
}

.toast-error {
    border-left: 4px solid #dc3545;
}

.toast-success {
    border-left: 4px solid #28a745;
}

.toast-info {
    border-left: 4px solid #17a2b8;
}

.toast-warning {
    border-left: 4px solid #ffc107;
}

[data-theme="light"] .toast.show {
    opacity: 1;
    transform: translateX(0);
}

[data-theme="dark"] .toast.show {
    opacity: 1;
    transform: translateX(0);
}

.timer-button {
    margin: 10px 0;
    padding: 10px 20px;
    fontsize: 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
}

.admin-actions {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 0.25rem;
    margin-bottom: 1rem;
}

.admin-actions button {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

table th input[type="checkbox"],
table td input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
}

.table {
    font-size: 0.9rem;
}

.phase-row {
    background-color: var(--dark-bg);
    font-weight: bold;
    border-top: 2px solid var(--primary-color);
    font-size: 1.3rem;
    color: #FFFFFF !important;
    background-color: rgba(var(--primary-color-rgb), 0.1);
    font-weight: 600;
}

.cc-row {
    background-color: var(--dark-bg);
    font-weight: bold;
    border-top: 2px dotted var(--primary-color);
    font-size: 1.1rem;
    color: #FFFFFF !important;
    background-color: rgba(var(--primary-color-rgb), 0.05);
}

tr[data-level="item"] {
    font-size: 0.9rem;
}

.phase-row td,
.cc-row td {
    padding-top: 15px !important;
    padding-bottom: 15px !important;
}

.btn-outline-primary {
    background-color: transparent;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #000000;
}

.add-item-btn {
}

.floating-window .window-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.floating-window .window-controls button {
    padding: 2px 6px;
    font-size: 12px;
}

.floating-window-content {
    height: calc(100% - 40px);
    overflow: auto;
    padding: 10px;
}

.floating-window .table-container {
    width: 100%;
    height: 100%;
}

.floating-window .table {
    font-family: 'Times New Roman', serif;
    font-style: italic;
}

.project-total-row {
    background-color: var(--dark-bg);
    border-top: 2px solid var(--primary-color);
    font-size: 1.5em;
    color: #ffffff !important;
    font-weight: bold;
    white-space: nowrap;
}

.project-total-row td {
    padding: 20px 8px !important;
    color: #ffffff !important;
}

.project-total-row td * {
    color: #ffffff !important;
}

.project-total-row td:last-child {
    text-align: right;
    min-width: 250px;
    max-width: none;
    white-space: nowrap;
    padding-right: 15px !important;
    overflow: visible;
    font-size: 0.85em;
    letter-spacing: -0.3px;
}

.project-total {
    min-width: 250px;
    max-width: none;
    white-space: nowrap;
    text-align: right;
    overflow: visible;
    font-size: 0.85em;
    letter-spacing: -0.3px;
}

.date-range-icons {
    display: flex;
    align-items: center;
}

.date-input {
    width: 16px;
    padding: 0;
    border: none;
    color: transparent;
    background: #d39e10 !important;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
}

.date-input:hover {
    background: #ff8c00 !important;
}

.date-input::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: #333;
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 100;
}

.date-input:hover::before {
    opacity: 1;
    visibility: visible;
}

.clear-dates {
    cursor: pointer;
    color: #666;
}

.clear-dates:hover {
    color: #dc3545;
}

/* Search container and clear button styling */
.search-container .input-group {
    display: flex;
    align-items: stretch;
}

.search-container .input-group .form-control {
    height: 38px;
}

.search-container .input-group .btn {
    height: 38px;
    display: flex;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

#contextMenu .context-item:hover {
    background-color: var(--primary-color);
    color: var(--text-dark) !important;
}

.admin-name {
    color: var(--text-light);
    font-style: italic;
    margin: 0;
}

.footer {
    text-align: center;
    padding: 0.75rem 2rem;
    background-color: var(--dark-bg);
    color: var(--text-light);
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 8px;
    max-width: 300px;
    width: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Split View Styles */
.floating-window {
    position: fixed;
    background: var(--dark-bg);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    resize: both;
    min-width: 400px;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    z-index: 1001;
}

.floating-window .table-container {
    height: calc(100% - 40px) !important;
    overflow: auto;
}

.floating-window .table {
    margin: 0;
    width: 100% !important;
}

.floating-window .project-total-row {
    position: sticky;
    bottom: 0;
    background: var(--dark-bg);
    z-index: 2;
}

.floating-window thead th {
    position: sticky;
    top: 0;
    background: var(--dark-bg);
    z-index: 2;
    padding: 8px;
    white-space: nowrap;
}

.floating-window td {
    padding: 4px 8px;
    white-space: normal;
    word-break: break-word;
}

.view-options-menu {
    z-index: 1050;
    background: var(--dark-bg);
    border: 1px solid var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 150px;
    padding: 8px 0;
}

.view-options-menu .dropdown-item {
    color: var(--text-light);
    padding: 8px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
    color: var(--text-light);
    padding: 8px 16px;
}

.view-options-menu .dropdown-item:hover {
    background-color: var(--primary-color);

/* Admin Users Table Styles */
.admin-users-table .btn {
    padding: 0.1rem 0.2rem;
    font-size: 0.6rem;
    white-space: nowrap;
    margin-bottom: 1px;
    line-height: 1;
    min-width: 40px;
    max-width: 50px;
}

/* Bulk Actions Styles */
#bulk-actions {
    border-left: 4px solid var(--primary-color);
    background-color: var(--darker-bg);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

#bulk-actions .card-header {
    background-color: var(--darker-bg);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-light);
}

#bulk-actions .card-body {
    background-color: var(--dark-bg);
    color: var(--text-light);
}

/* Light mode overrides for bulk actions */
[data-theme="light"] #bulk-actions {
    background-color: #ffffff;
    border: 1px solid #dee2e6;
}

[data-theme="light"] #bulk-actions .card-header {
    background-color: #f8f9fa;
    color: #333333;
    border-bottom: 1px solid #dee2e6;
}

[data-theme="light"] #bulk-actions .card-body {
    background-color: #ffffff;
    color: #333333;
}

/* Selected row highlighting */
.table-warning {
    background-color: rgba(var(--primary-color-rgb), 0.15) !important;
    transition: all 0.3s ease;
    border-left: 4px solid var(--primary-color) !important;
}

/* Row hover effects */
.user-row:hover {
    background-color: rgba(var(--primary-color-rgb), 0.05) !important;
    transition: background-color 0.2s ease;
}

/* Button pulse animation for active states */
.btn-pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Smooth checkbox transitions */
.form-check-input {
    transition: all 0.2s ease;
}

.form-check-input:hover {
    transform: scale(1.1);
}

/* Better spacing for bulk actions */
#bulk-actions .btn-group .btn {
    margin: 0 2px;
}

#bulk-actions .btn-group .btn:first-child {
    margin-left: 0;
}

#bulk-actions .btn-group .btn:last-child {
    margin-right: 0;
}

.table-responsive {
    overflow-x: auto;
}

/* Make sure action buttons always stay on one line or wrap properly */
.d-flex.flex-wrap.gap-1 {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem !important;
}

/* Ensure the Actions column is wide enough */
.admin-users-table th:last-child,
.admin-users-table td:last-child {
    min-width: 200px;
    width: 200px;
}

/* Center action buttons in their container */
.admin-users-table td:last-child {
    text-align: center;
}

/* Make sure the table takes full width */
.table {
    width: 100% !important;
    table-layout: fixed;
}

/* Add horizontal scrolling specifically for admin tables */
.admin-users-table {
    min-width: 800px;
}

/* Ensure buttons fit nicely in their cells */
.admin-users-table .btn-group {
    display: flex;
    justify-content: center;
}

    color: var(--text-dark);
}

.floating-window .table-container {
    width: 100%;
    height: 100%;
    overflow: auto;
}

.floating-window .table {
    width: 100% !important;
    margin-bottom: 0;
}

.floating-window-header {
    background: var(--darker-bg);
    padding: 8px;
    cursor: move;
display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--primary-color);
}

.window-controls {
    display: flex;
    gap: 8px;
    position: sticky;
    top: 0;
    right: 8px;
    z-index: 1000;
    background: var(--darker-bg);
    padding: 4px;
    border-radius: 4px;
}

.window-controls button {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 4px;
}

.floating-window-content {
    height: calc(100% - 40px);
    overflow: auto;
    padding: 10px;
}

tr[data-level].dragging {
    opacity: 0.5;
    background: var(--dark-bg);
}

tr[data-level].drag-over {
    border: 2px dashed var(--primary-color);
    background: rgba(245, 179, 1, 0.1);
}

/* BOQ Styles */
.table-container {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

/* Phase row styling */
#boq-table tr[data-level="phase"],
.table tr.phase-row {
    background-color: #2a2a2a !important;
    font-size: 1.4em !important;
    font-weight: 700 !important;
    border-top: 3px solid var(--primary-color) !important;
    border-bottom: 1px solid var(--primary-color) !important;
    color: #ff8c00 !important;
    text-transform: uppercase;
}

#boq-table tr[data-level="phase"] td,
.table tr.phase-row td {
    color: #ff8c00 !important;
}

/* Phase row text colors */
#boq-table tr[data-level="phase"] td,
#boq-table tr[data-level="phase"] td *,
.table tr.phase-row td,
.table tr.phase-row td * {
    color: #ff8c00 !important;
}

/* Cost center row text colors */
#boq-table tr[data-level="cc"] td,
#boq-table tr[data-level="cc"] td *,
.table tr[data-type="cc"] td,
.table tr[data-type="cc"] td * {
    color: #ff8c00 !important;
}

/* Ensure phase and cc row editable spans maintain color */
#boq-table tr[data-level="phase"] td span.editable,
#boq-table tr[data-level="cc"] td span.editable,
.table tr.phase-row td span.editable,
.table tr[data-type="cc"] td span.editable {
    color: #ff8c00 !important;
}

/* Total columns color */
#boq-table tr[data-level="phase"] td.phase-total,
#boq-table tr[data-level="cc"] td.cc-total,
.table tr.phase-row td.text-end,
.table tr[data-type="cc"] td.text-end {
    color: #ff8c00 !important;
}

#boq-table thead th,
.table thead th {
    color: #ff6600 !important;
    font-weight: 600;
}

/* Cost center row styling */
#boq-table tr[data-level="cc"],
.table tr[data-type="cc"] {
    background-color: #222222 !important;
    font-size: 1.2em !important;
    font-weight: 600 !important;
    border-left: 4px solid #ff8c00 !important;
    color: #ff8c00 !important;
    padding-left: 15px !important;
}

#boq-table tr[data-level="cc"] td,
.table tr[data-type="cc"] td {
    color: #ff8c00 !important;
}

/* Item row styling */
#boq-table tr[data-level="item"],
.table tr[data-type="item"] {
    background-color: #1a1a1a !important;
    padding-left: 30px !important;
    border-left: 2px solid #444 !important;
    color: #d0d0d0 !important;
    font-size: 1em !important;
    font-weight: normal !important;
}

/* Hover effects */
tr[data-level]:hover {
    background-color: rgba(245, 179, 1, 0.1);
}

[contenteditable="true"] {
    border: 1px solid var(--primary-color);
    padding: 2px 4px;
    min-width: 50px;
    outline: none;
    background: rgba(255, 255, 255, 0.05);
    cursor: text;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

[contenteditable="true"]:focus {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 2px rgba(245, 179, 1, 0.3);
}

.editable {
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    min-width: 30px;
    display: inline-block;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.editable:hover {
    background: rgba(255, 255, 255, 0.05);
}

.editable[contenteditable="true"] {
    background: rgba(255, 255, 255, 0.1);
    outline: 1px solid var(--primary-color);
    padding: 2px 4px;
}

/* Fix for item catalog table display */
#catalogTable td {
    white-space: normal !important;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
    min-width: 50px;
    padding: 8px !important;
    vertical-align: middle;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#catalogTable td:nth-child(3) {  /* Item Code column */
    min-width: 180px;
    max-width: 180px;
    white-space: nowrap;
}

#catalogTable td:nth-child(4) {  /* Description column */
    min-width: 200px;
    word-break: break-word;
}

.item-code {
    font-family: monospace;
    white-space: nowrap !important;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
    margin-right: 5px;
}

/* Ensure items appear in their correct columns */
#catalogTable tr[data-type="item"] td {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Force column alignment */
#catalogTable th,
#catalogTable td {
    box-sizing: border-box;
    position: relative;
}

/* Fixed column widths */
#catalogTable th:nth-child(1),
#catalogTable td:nth-child(1) {
    width: 40px;
    max-width: 40px;
}

#catalogTable th:nth-child(2),
#catalogTable td:nth-child(2) {
    width: 40px;
    max-width: 40px;
}

/* Hide preview icon cell for item rows */
#catalogTable tr[data-type="item"] td:nth-child(2) {
    padding: 0 !important;
    width: 0 !important;
    max-width: 0 !important;
    overflow: hidden;
    border: none !important;
}

#catalogTable th:nth-child(5),
#catalogTable td:nth-child(5) {
    width: 80px;
    max-width: 80px;
}

#catalogTable th:nth-child(6),
#catalogTable td:nth-child(6) {
    width: 120px;
    max-width: 120px;
    text-align: right;
}

/* Actions column removed */

/* Hide the actions header and column completely */
#catalogTable th:last-child,
#catalogTable td:last-child {
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border: none !important;
    display: none !important;
}

/* Hide all action buttons in items */
#catalogTable tr[data-type="item"] .action-buttons,
#catalogTable tr[data-type="item"] .btn-edit,
#catalogTable tr[data-type="item"] .btn-delete {
    display: none !important;
}

/* BOQ action buttons fixed at top */
.boq-action-buttons {
    position: sticky;
    top: 0;
    background-color: var(--dark-bg);
    z-index: 1050;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Project title in header */
.boq-action-buttons h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
}

/* Buttons in the fixed header */
.boq-action-buttons .btn-group {
    display: inline-flex;
}

/* Add some spacing between button groups */
.boq-action-buttons .btn-group:not(:last-child) {
    margin-right: 10px;
}

/* Priority colors */
.bg-priority-High {
    background-color: #dc3545!important;
}

.bg-priority-Medium {
    background-color: #ffc107!important;
}

.bg-priority-Low {
    background-color: #17a2b8!important;
}

.bg-priority-Finished {
    background-color: rgb(146, 208, 80)!important;
    color: #fff!important;
}

/* Tree connector styles for expand/collapse buttons */
.tree-button-group {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-right: 10px;
}

.tree-connector {
    position: absolute;
    width: 2px;
    height: 100%;
    background-color: #d39e10; /* Orange color matching your theme */
    left: 50%;
    top: 50%;
    transform: translate(-50%, -36%);
    z-index: 1;
}

.tree-connector:before {
    content: "";
    position: absolute;
    width: 8px;
    height: 2px;
    background-color: #d39e10;
    bottom: 0;
left: 0;
    transform: translateX(-3px);
}

.plus-connector {
    height: calc(100% - 10px);
}

.minus-connector {
    height: calc(100% - 10px);
}

.tree-button-group .btn {
    position: relative;
    z-index: 2;
    margin-bottom: 14px;
}

.tree-button-group .btn:last-child {
    margin-bottom: 0;
}

/* Ensure description cells properly wrap long text */
#boqTable td:nth-child(5) {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.2;
    min-height: 1.2em;
}

/* Fix number field overflow */
#boqTable input[type="number"], 
#boqTable .unit-price {
    color: #000000 !important;
}

#boqTable .unit-price-header,
#boqTable .takeoff {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
    text-overflow: ellipsis;
    white-space: normal;
}

#boqTable td {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Apply word wrap to all table cells */
#boqTable td, #boqTable th {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* BOQ Comparison Styles */
.comparison-table {
    border-collapse: collapse;
    width: 100%;
}

.comparison-table th,
.comparison-table td {
    border: 1px solid var(--border-color);
    padding: 8px;
    text-align: left;
}

.comparison-table th {
    background-color: var(--header-bg);
    font-weight: bold;
}

.phase-header {
    background-color: var(--phase-bg);
    font-weight: bold;
    text-transform: uppercase;
}

.cc-header {
    background-color: var(--cc-bg);
    font-weight: bold;
    padding-left: 20px;
}

.item-row {
    background-color: var(--item-bg);
}

.item-description {
    font-weight: 500;
    padding-left: 40px;
}

/* Item number styling */
    .item-number {
        display: block;
        font-weight: 500;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        max-width: 100%;
        font-family: monospace;
        font-size: 0.85rem;
        line-height: 1.2;
        padding: 2px 0;
        white-space: normal !important;
        color: var(--text-light) !important;
    }

    /* Ensure item numbers are visible in dark mode */
    [data-theme="dark"] .item-number {
        color: #ffffff !important;
    }

    [data-theme="light"] .item-number {
        color: #333333 !important;
    }

.item-data {
    text-align: center;
    vertical-align: top;
}

.item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.takeoff {
    font-weight: bold;
}

.unit-price {
    color: #000000 !important;
    font-size: 0.9em;
}

.total {
    color: var(--success-color);
    font-weight: bold;
}

.notes {
    font-size: 0.8em;
    color: var(--text-muted);
    font-style: italic;
}

/* ===============================================
   COMPACT PROFESSIONAL BOQ TABLE STYLES
   =============================================== */

/* Override BOQ table for compact professional look */
.boq-table {
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
}

/* Compact table cell padding */
.boq-table th,
.boq-table td {
    padding: 3px 5px !important;
    vertical-align: middle !important;
    border: 1px solid #333 !important;
}

/* Compact phase rows */
#boqTable tr.phase-row,
#boq-table tr[data-level="phase"],
.table tr.phase-row {
    background-color: #2a2a2a !important;
    font-size: 0.9rem !important;
    font-weight: 700 !important;
    border-top: 2px solid var(--primary-color) !important;
    border-bottom: 1px solid var(--primary-color) !important;
    color: #ff8c00 !important;
    text-transform: uppercase;
    height: 28px !important;
}

#boqTable tr.phase-row td,
#boq-table tr[data-level="phase"] td,
.table tr.phase-row td {
    padding: 2px 5px !important;
    color: #ff8c00 !important;
}

/* Compact cost center rows */
#boqTable tr.cc-row,
#boq-table tr[data-level="cc"],
.table tr[data-type="cc"] {
    background-color: #222222 !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-left: 3px solid #ff8c00 !important;
    color: #ff8c00 !important;
    height: 26px !important;
}

#boqTable tr.cc-row td,
#boq-table tr[data-level="cc"] td,
.table tr[data-type="cc"] td {
    padding: 2px 5px !important;
    color: #ff8c00 !important;
}

/* Compact item rows */
#boqTable tr.item-row,
#boq-table tr[data-level="item"],
.table tr[data-type="item"] {
    background-color: #1a1a1a !important;
    border-left: 1px solid #444 !important;
    color: #d0d0d0 !important;
    font-size: 0.8rem !important;
    font-weight: normal !important;
    height: 24px !important;
}

#boqTable tr.item-row td,
#boq-table tr[data-level="item"] td,
.table tr[data-type="item"] td {
    padding: 2px 5px !important;
    color: #d0d0d0 !important;
}

/* Compact table header */
.boq-table thead th {
    padding: 4px 5px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    height: 30px !important;
    background-color: #2d2d2d !important;
    color: #ff8c00 !important;
    border-bottom: 2px solid var(--primary-color) !important;
}

/* Compact input fields in table */
.boq-table input[type="text"],
.boq-table input[type="number"],
.boq-table select,
.boq-table .form-control,
.boq-table .form-select {
    padding: 1px 3px !important;
    font-size: 0.75rem !important;
    height: 18px !important;
    line-height: 1.2 !important;
    border: 1px solid #444 !important;
    background-color: rgba(0, 0, 0, 0.3) !important;
    color: #d0d0d0 !important;
}

/* Compact editable spans */
.boq-table .editable {
    padding: 1px 3px !important;
    font-size: 0.75rem !important;
    line-height: 1.2 !important;
    min-height: auto !important;
    display: inline-block;
}

/* Compact checkboxes and toggle buttons */
.boq-table input[type="checkbox"] {
    transform: scale(0.8);
    margin: 0 !important;
}

.boq-table .toggle-btn {
    font-size: 0.7rem !important;
    padding: 1px 3px !important;
    line-height: 1 !important;
}

/* Compact drag handles */
.boq-table .item-drag-handle {
    font-size: 0.7rem !important;
    padding: 1px !important;
}

/* Remove extra spacing */
.boq-table tr {
    margin: 0 !important;
}

/* Ensure totals are properly formatted */
.boq-table .text-end,
.boq-table .phase-total,
.boq-table .cc-total {
    font-weight: 600 !important;
    text-align: right !important;
    font-size: 0.8rem !important;
}

/* Compact toolbar buttons to match table density */
.boq-toolbar .btn-sm {
    padding: 2px 8px !important;
    font-size: 0.75rem !important;
    height: 26px !important;
}

/* Compact dropdown menus */
.boq-table .dropdown-menu {
    font-size: 0.75rem !important;
    padding: 2px 0 !important;
}

.boq-table .dropdown-item {
    padding: 2px 8px !important;
    font-size: 0.75rem !important;
}

/* Compact BOQ container and toolbar */
.boq-content-wrapper {
    padding-top: 110px !important; /* Adjusted for main nav + toolbar height */
}

/* Fixed/Sticky BOQ Toolbar - Positioned below main navigation */
.boq-toolbar-fixed {
    position: fixed !important;
    top: 56px !important; /* Position below main navigation bar */
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    z-index: 1040 !important; /* Lower than main nav but above content */
    background-color: #1a1a1a !important;
    border-bottom: 2px solid var(--primary-color) !important;
    padding: 4px 8px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}

.boq-toolbar {
    padding: 4px 8px !important;
    background-color: #1a1a1a !important;
    border-bottom: 1px solid #333 !important;
}

.boq-toolbar .btn {
    margin: 1px 2px !important;
    padding: 3px 6px !important;
    font-size: 0.75rem !important;
    height: 24px !important;
    line-height: 1.2 !important;
}

/* Compact project header in BOQ page */
.boq-page h4 {
    font-size: 1.1rem !important;
    margin-bottom: 0.5rem !important;
}

.boq-page small {
    font-size: 0.7rem !important;
}

/* Ensure table responsive container doesn't add extra spacing */
.table-responsive {
    padding: 0 !important;
    margin: 0 !important;
}

/* Compact BOQ container */
#boq-container {
    border: 1px solid #333 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

/* Fix any bootstrap default spacing that interferes */
.boq-table.table-hover tbody tr:hover {
    background-color: rgba(245, 179, 1, 0.05) !important;
}

/* Professional grid-like appearance */
.boq-table {
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background-color: #1a1a1a !important;
}

/* ===============================================
   LIGHT MODE BOQ TABLE IMPROVEMENTS
   =============================================== */

/* Light mode: Softer borders and better contrast */
[data-theme="light"] .boq-table th,
[data-theme="light"] .boq-table td {
    border: 1px solid #cccccc !important; /* Softer grey borders instead of black */
    color: #333333 !important;
}

/* Light mode: Readable input fields with black text */
[data-theme="light"] .boq-table input[type="text"],
[data-theme="light"] .boq-table input[type="number"],
[data-theme="light"] .boq-table select,
[data-theme="light"] .boq-table .form-control,
[data-theme="light"] .boq-table .form-select {
    background-color: #f8f9fa !important;
    border: 1px solid #cccccc !important;
    color: #000000 !important; /* Black text for visibility */
}

/* Light mode: Black text for totals and important values */
[data-theme="light"] .boq-table .text-end,
[data-theme="light"] .boq-table .item-total,
[data-theme="light"] .boq-table tr.item-row .text-end,
[data-theme="light"] .boq-table tr[data-type="item"] .text-end,
[data-theme="light"] #boqTable tr.item-row .text-end,
[data-theme="light"] .boq-table .project-total {
    color: #000000 !important; /* Black totals for visibility */
    font-weight: 600 !important;
}

/* Light mode: Phase and CC totals keep orange color */
[data-theme="light"] .boq-table .phase-total,
[data-theme="light"] .boq-table .cc-total,
[data-theme="light"] .boq-table tr.phase-row .text-end,
[data-theme="light"] .boq-table tr[data-type="cc"] .text-end {
    color: #ff6600 !important;
    font-weight: 600 !important;
}

/* Light mode: Better visibility for editable spans */
[data-theme="light"] .boq-table .editable {
    color: #000000 !important;
    background-color: rgba(248, 249, 250, 0.8) !important;
    border: 1px solid #cccccc !important;
}

/* Light mode: Phase and CC row editable spans stay orange */
[data-theme="light"] .boq-table tr.phase-row .editable,
[data-theme="light"] .boq-table tr[data-type="cc"] .editable,
[data-theme="light"] #boqTable tr.phase-row td span.editable,
[data-theme="light"] #boqTable tr[data-level="cc"] td span.editable,
[data-theme="light"] #boq-table tr.phase-row td span.editable,
[data-theme="light"] #boq-table tr[data-level="cc"] td span.editable {
    color: #ff6600 !important;
}

/* Light mode: Header styling */
[data-theme="light"] .boq-table thead th {
    background-color: #f1f3f4 !important;
    border-bottom: 2px solid #cccccc !important;
    color: #ff6600 !important; /* Match Phase/CC row text color */
}

/* Light mode: Phase and cost center rows */
[data-theme="light"] #boqTable tr.phase-row,
[data-theme="light"] #boq-table tr[data-level="phase"],
[data-theme="light"] .table tr.phase-row {
    background-color: #f8f9fa !important;
    border-top: 2px solid #d39e10 !important;
    border-bottom: 1px solid #cccccc !important;
    color: #ff6600 !important;
}

[data-theme="light"] #boqTable tr.phase-row td,
[data-theme="light"] #boq-table tr[data-level="phase"] td,
[data-theme="light"] .table tr.phase-row td {
    color: #ff6600 !important;
}

[data-theme="light"] #boqTable tr.cc-row,
[data-theme="light"] #boq-table tr[data-level="cc"],
[data-theme="light"] .table tr[data-type="cc"] {
    background-color: #f1f3f4 !important;
    border-left: 3px solid #d39e10 !important;
    color: #ff6600 !important;
}

[data-theme="light"] #boqTable tr.cc-row td,
[data-theme="light"] #boq-table tr[data-level="cc"] td,
[data-theme="light"] .table tr[data-type="cc"] td {
    color: #ff6600 !important;
}

/* Light mode: Item rows with subtle background */
[data-theme="light"] #boqTable tr.item-row,
[data-theme="light"] #boq-table tr[data-level="item"],
[data-theme="light"] .table tr[data-type="item"] {
    background-color: #ffffff !important;
    border-left: 1px solid #cccccc !important;
}

/* Light mode: Hover effects */
[data-theme="light"] .boq-table.table-hover tbody tr:hover {
    background-color: rgba(245, 179, 1, 0.1) !important;
}

/* Light mode: Fix input placeholder text */
[data-theme="light"] .boq-table input::placeholder {
    color: #6c757d !important;
}

/* Light mode: Dropdown styling */
[data-theme="light"] .boq-table .dropdown-menu {
    background-color: #ffffff !important;
    border: 1px solid #cccccc !important;
}

[data-theme="light"] .boq-table .dropdown-item {
    color: #333333 !important;
}

[data-theme="light"] .boq-table .dropdown-item:hover {
    background-color: rgba(245, 179, 1, 0.1) !important;
}

/* ===============================================
   LIGHT MODE TOAST STYLING
   =============================================== */

/* Light mode: Toast text should be dark for readability - override text-white class */
[data-theme="light"] .toast,
[data-theme="light"] .toast.text-white,
[data-theme="light"] .toast .toast-body,
[data-theme="light"] .alert,
[data-theme="light"] .alert-error,
[data-theme="light"] .alert-success,
[data-theme="light"] .alert-warning,
[data-theme="light"] .alert-info {
    color: #000000 !important;
}

/* Light mode: Toast close button should be dark */
[data-theme="light"] .toast .btn-close,
[data-theme="light"] .alert .btn-close {
    filter: invert(1) !important;
}

/* Light mode: Specific error toast styling */
[data-theme="light"] .toast.bg-danger,
[data-theme="light"] .toast.bg-danger.text-white,
[data-theme="light"] .toast.error,
[data-theme="light"] .alert-danger {
    background-color: #f8d7da !important;
    border-color: #f5c6cb !important;
    color: #721c24 !important;
}

/* Light mode: Success toast styling */
[data-theme="light"] .toast.bg-success,
[data-theme="light"] .toast.bg-success.text-white,
[data-theme="light"] .toast.success,
[data-theme="light"] .alert-success {
    background-color: #d1e7dd !important;
    border-color: #badbcc !important;
    color: #0f5132 !important;
}

/* Light mode: Warning toast styling */
[data-theme="light"] .toast.bg-warning,
[data-theme="light"] .toast.bg-warning.text-white,
[data-theme="light"] .toast.warning,
[data-theme="light"] .alert-warning {
    background-color: #fff3cd !important;
    border-color: #ffecb5 !important;
    color: #664d03 !important;
}

/* Light mode: Info toast styling */
[data-theme="light"] .toast.bg-info,
[data-theme="light"] .toast.bg-info.text-white,
[data-theme="light"] .toast.info,
[data-theme="light"] .alert-info {
    background-color: #d1ecf1 !important;
    border-color: #bee5eb !important;
    color: #055160 !important;
}
/* ===== SUBSCRIPTION DASHBOARD - DARK MODE FIXES ===== */
/* Fix text visibility in dark mode */
[data-theme="dark"] .card {
    background-color: transparent !important;
}

[data-theme="dark"] .card {
    color: #ffffff !important;
    border-color: #555555 !important;
}

[data-theme="dark"] .card-header {
    color: #ffffff !important;
    border-bottom-color: #555555 !important;
}

[data-theme="dark"] .card-body {
    color: #ffffff !important;
}

[data-theme="dark"] .card h5,
[data-theme="dark"] .card h6,
[data-theme="dark"] .card label,
[data-theme="dark"] .card .fw-bold {
    color: #ffffff !important;
}

[data-theme="dark"] .text-muted {
    color: #b0b0b0 !important;
}

[data-theme="dark"] .text-center small {
    color: #b0b0b0 !important;
}

/* Fix text color for Current Plan section */
[data-theme="dark"] .card-body .fs-5 {
    color: #ffffff !important;
}

/* Fix text in Usage section */
[data-theme="dark"] .card-body span {
    color: #ffffff !important;
}

/* Fix progress bar label text */
/* REMOVED - Use the complete progress bar styling at the end of the file instead */

/* Add-on Policy Box - Dark Mode */
[data-theme="dark"] .card-body > div > div {
    background-color: transparent !important;
    border-color: #d97706 !important;
    color: #fbbf24 !important;
}

[data-theme="dark"] .card-body > div > div small {
    color: #fbbf24 !important;
}

[data-theme="dark"] .card-body > div > div strong {
    color: #fcd34d !important;
}

/* Modal styling for dark mode */
[data-theme="dark"] .modal-content {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
    border-color: #555555 !important;
}

[data-theme="dark"] .modal-header {
    background-color: #1a1a1a !important;
    border-bottom-color: #555555 !important;
}

[data-theme="dark"] .modal-body {
    background-color: #2d2d2d !important;
    color: #ffffff !important;
}

[data-theme="dark"] .modal-footer {
    background-color: #1a1a1a !important;
    border-top-color: #555555 !important;
}

[data-theme="dark"] .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.9) !important;
}

[data-theme="dark"] .modal-body h5,
[data-theme="dark"] .modal-title {
    color: #ffffff !important;
}

/* Warning alert in modal */
[data-theme="dark"] .alert-warning {
    background-color: #5a5204 !important;
    border-color: #8a7a04 !important;
    color: #ffd966 !important;
}

[data-theme="dark"] .alert-warning strong {
    color: #ffffff !important;
}

[data-theme="dark"] .alert-warning li {
    color: #ffd966 !important;
}

[data-theme="dark"] .modal-body p {
    color: #b0b0b0 !important;
}

/* Card border in modal */
[data-theme="dark"] .modal-body .card {
    background-color: #2d2d2d !important;
    border-color: #555555 !important;
}

[data-theme="dark"] .modal-body .card h6 {
    color: #ffffff !important;
}

[data-theme="dark"] .modal-body .card small {
    color: #b0b0b0 !important;
}

/* Button styling in dark mode */
[data-theme="dark"] .btn-outline-secondary {
    color: #b0b0b0 !important;
    border-color: #555555 !important;
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background-color: #555555 !important;
    border-color: #555555 !important;
    color: #ffffff !important;
}

[data-theme="dark"] .btn-outline-warning {
    color: #ffc107 !important;
    border-color: #ffc107 !important;
}

[data-theme="dark"] .btn-outline-warning:hover {
    background-color: #ffc107 !important;
    color: #000000 !important;
}

/* ===== DARK MODE BADGE STYLING ===== */
/* Keep badges visible with their colors in dark mode */
[data-theme="dark"] .badge {
    background-color: inherit !important;
    color: inherit !important;
}

[data-theme="dark"] .bg-primary {
    background-color: #007bff !important;
}

[data-theme="dark"] .bg-success {
    background-color: #28a745 !important;
}

[data-theme="dark"] .badge.bg-primary {
    background-color: #007bff !important;
    color: #ffffff !important;
}

[data-theme="dark"] .badge.bg-success {
    background-color: #28a745 !important;
    color: #ffffff !important;
}

/* ===== PROGRESS BAR - DARK MODE STYLING ===== */
/* Fix progress bar visibility in dark mode */
[data-theme="dark"] .progress {
    background-color: #92400e !important;
    border-radius: 0.375rem;
}

[data-theme="dark"] .progress-bar {
    background-color: #10b981 !important;
    background-image: none !important;
}

[data-theme="dark"] .progress-bar.bg-success {
    background-color: #10b981 !important;
}

[data-theme="dark"] .progress-bar.bg-warning {
    background-color: #f59e0b !important;
}

[data-theme="dark"] .progress-bar.bg-danger {
    background-color: #ef4444 !important;
}

/* ===== FORCE PROGRESS BAR VISIBILITY IN DARK MODE ===== */
/* Explicitly ensure progress bar is visible in dark mode */
[data-theme="dark"] .progress {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 8px !important;
    height: auto !important;
}

[data-theme="dark"] .progress-bar {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 8px !important;
}

/* Ensure text-muted in progress section is visible */
[data-theme="dark"] div.mt-3 .text-muted {
    color: #b0b0b0 !important;
    display: block !important;
    visibility: visible !important;
}
