/* --- UTILITY CLASSES --- */
.force-hide {
    display: none !important;
}

/* --- FILE: public/css/dashboard_style.css --- */

/* --- Conditional Lead Info Styling --- */
.contact-info-hidden {
    filter: blur(4px); /* Apply blur effect */
    /* color: transparent; */ /* Alternative: hide text color */
    /* text-shadow: 0 0 6px rgba(0,0,0,0.6); */ /* Alternative: shadow blur */
    cursor: default;
    user-select: none; /* Prevent text selection */
    pointer-events: none; /* Prevent interaction */
    display: inline-block; /* Ensure blur applies correctly */
    /* Feedback Modal Styles */
}

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal.is-visible {
    display: flex;
}

.modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #aaa;
}

.close-modal:hover {
    color: #333;
}

/* Hamburger Button Alignment Fix */
.hamburger-button {
    position: relative; /* Ensure z-index and positioning context */
    z-index: 2100; /* Higher than menu overlay's content */
    top: -5px; /* Adjust this value to move the button up */
}

/* Add any additional specific styles for the single page app here */

/* --- Action Button Highlight Styling --- */
.action-highlight-btn {
    padding: 10px 15px !important;
    font-size: 1.05em !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px;
    background-color: var(--surface-color) !important;
    color: var(--accent-button-primary) !important;
    border: 1px solid var(--border-color);
    box-shadow: var(--neumorphic-shadow);
    transition: all 0.2s ease;
}

.action-highlight-btn:hover {
    filter: brightness(1.05);
}

.action-highlight-btn:active {
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.15),
    inset -2px -2px 5px rgba(255,255,255,0.1);
    filter: brightness(0.95);
    transform: translateY(1px);
}

/* --- End Action Button Styling --- */

/* --- Note Preview Spacing --- */
.leads-table td[data-label="Notes"] {
    padding-bottom: 15px !important;
    margin-bottom: 10px;
}

.note-preview {
    display: block;
    margin-bottom: 5px;
}
/* --- End Note Preview Spacing --- */

/* --- Dashboard Logo --- */
.dashboard-logo {
    height: auto;
    width: 37.5%; /* Increased from 25% to 37.5% (50% larger) */
    max-width: 450px; /* Also increased max-width proportionally */
    display: block;
}
/* --- End Dashboard Logo --- */

/* --- nuVisions Button Styling --- */
.nuVisions-btn {
    background: linear-gradient(45deg, #3f87a6, #6b5ca5, #a66395) !important;
    color: white !important;
    font-weight: bold !important;
    border: none !important;
    position: relative;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23);
    transition: all 0.3s cubic-bezier(.25,.8,.25,1);
}

.nuVisions-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.25), 0 5px 5px rgba(0,0,0,0.22);
    background: linear-gradient(45deg, #4f97b6, #7b6cb5, #b673a5) !important;
}

.nuVisions-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}

.ai-sparkle {
    display: inline-block;
    animation: sparkle 1.5s infinite alternate;
    margin-left: 3px;
}

@keyframes sparkle {
    0% { transform: scale(1) rotate(0deg); opacity: 0.7; }
    50% { transform: scale(1.2) rotate(20deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 0.7; }
}
/* --- End nuVisions Button Styling --- */

/* --- Status Colors --- */
.status-unassigned {
    color: orange !important; 
    font-weight: bold;
}
.status-accepted {
    color: mediumseagreen !important; /* Changed from green for better visibility */
    font-weight: bold;
}
.status-rejected {
    color: tomato !important; /* Changed from red for better visibility */
    font-weight: bold;
}
.status-estimate-performed {
    color: gold !important; /* Changed from yellow */
    font-weight: bold;
}
.status-manual-lead {
    color: #87CEEB !important; /* Light Sky Blue */
    font-weight: bold;
}
/* Add other status colors if needed */

/* Ensure status span is inline-block for padding/bg if needed later */
.status-indicator {
    display: inline-block;
    padding: 0.1em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
}

/* --- End Status Colors --- */

/*-------------------------------
  Leads Table Styling
--------------------------------*/

/* ... existing table styles ... */

/* Table Action Buttons - Stacked Layout */
.action-buttons-group {
    display: flex;
    flex-direction: column; /* Stack vertically */
    gap: 4px; /* Small gap between buttons */
    width: 100%; /* Full width of cell */
    align-items: stretch; /* Make buttons same width */
}

/* Calculate Estimate Button - Light Green */
.calculate-btn {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%) !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
    order: 1; /* First button */
}

.calculate-btn:hover {
    background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%) !important;
    border-color: #6ee7b7 !important;
    color: #064e3b !important;
}

/* View Lead Info Button - Theme Default */
.view-btn {
    background: var(--surface) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border) !important;
    order: 2; /* Second button */
}

.view-btn:hover {
    background: var(--background-alt-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--primary-color) !important;
}

/* Delete Button - Light Red */
.delete-btn {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%) !important;
    color: #991b1b !important;
    border: 1px solid #fca5a5 !important;
    order: 3; /* Third button */
}

.delete-btn:hover {
    background: linear-gradient(135deg, #fecaca 0%, #f87171 100%) !important;
    border-color: #f87171 !important;
    color: #7f1d1d !important;
}

/* Dark mode adjustments for action buttons */
[data-theme="dark"] .calculate-btn {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%) !important;
    color: #86efac !important;
    border-color: #059669 !important;
}

[data-theme="dark"] .calculate-btn:hover {
    background: linear-gradient(135deg, #065f46 0%, #047857 100%) !important;
    color: #a7f3d0 !important;
}

[data-theme="dark"] .delete-btn {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%) !important;
    color: #fca5a5 !important;
    border-color: #dc2626 !important;
}

[data-theme="dark"] .delete-btn:hover {
    background: linear-gradient(135deg, #991b1b 0%, #b91c1c 100%) !important;
    color: #fecaca !important;
}

/* Accept/Reject Button Colors */
.accept-btn-color {
    background-color: lime; /* Bright Green */
    color: black; /* Black text */
    border: 1px solid darkgreen; /* Darker green border */
}
.accept-btn-color:hover {
    background-color: #00cc00; /* Slightly darker green on hover */
    border-color: #004d00;
    color: black; 
}

.reject-btn-color {
    background-color: red; /* Bright Red */
    color: black; /* Black text */
    border: 1px solid darkred; /* Darker red border */
}
.reject-btn-color:hover {
    background-color: #cc0000; /* Slightly darker red on hover */
    border-color: #660000;
    color: black; 
}

/* Override default button hover if necessary */
.action-btn.accept-btn-color:hover,
.action-btn.reject-btn-color:hover {
    filter: none; /* Remove brightness filter if applied generally */
}

header .header-actions .icon-button,
header .header-actions .action-btn,
header .header-actions .header-action-btn {
    padding: 12px 16px; /* Increased padding for more uniform height */
    font-size: 0.95em;  /* Slightly smaller font to fit better */
    box-sizing: border-box; /* Ensure padding is included in width/height consistently */
    font-family: 'League Spartan', var(--font-family-sans-serif, sans-serif); /* Added Font */
    font-weight: 700; /* Made all buttons bold (increased from bold) */
    height: 44px; /* Fixed height for uniformity */
    width: auto; /* Ensure width is auto */
    min-width: 120px; /* Set minimum width to fit all buttons better */
    max-width: 140px; /* Set maximum width to keep them compact */
    border-radius: var(--button-border-radius, 6px); /* Slightly larger radius */
    display: inline-flex; /* Use flex to help vertical alignment */
    align-items: center; /* Vertically center content */
    justify-content: center; /* Horizontally center content (good for icons/short text) */
    text-align: center;
    vertical-align: middle; /* Helps align inline-flex elements */
    gap: 6px; /* Space between icon and text */
    transition: all 0.3s ease;
    border: 2px solid transparent; /* Increased border width */
    cursor: pointer;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow if text is too long */
}

header .header-actions .icon-button i,
header .header-actions .header-action-btn i {
    font-size: 1.3em; /* Ensure icons scale well */
}

/* Unified Header Action Button Styles - Enhanced for Visibility */
.header-action-btn {
    font-weight: 700; /* Ensured bold font */
    border: 2px solid var(--border); /* Increased border width for visibility */
    text-decoration: none;
    background: var(--surface);
    color: var(--text-color);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Enhanced shadow */
}

/* Light mode enhancements - add gradients and better borders */
body[data-theme="light"] .header-action-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #d1d5db;
    color: #374151;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .header-action-btn:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #e5e7eb 100%);
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Settings Button - Subtle Blue Accent */
body[data-theme="light"] .settings-btn {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
}

body[data-theme="light"] .settings-btn:hover {
    border-color: #2563eb;
    color: #1d4ed8;
    background: linear-gradient(135deg, #bfdbfe 0%, #93c5fd 100%);
}

/* Archive Button - Light Grey in Dark Mode, Light Pastel in Light Mode */
body[data-theme="light"] .archive-btn {
    border-color: #a5b4fc;
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%);
    color: #4338ca;
}

body[data-theme="light"] .archive-btn:hover {
    border-color: #8b5cf6;
    color: #3730a3;
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
}

/* Feedback Button - Light Pastel Green in Light Mode */
body[data-theme="light"] .feedback-btn {
    border-color: #86efac;
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #059669;
}

body[data-theme="light"] .feedback-btn:hover {
    border-color: #22c55e;
    color: #047857;
    background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
}

/* Dark mode improvements - grey colors with distinct borders */
[data-theme="dark"] .header-action-btn {
    background: #374151; /* Grey background */
    color: #d1d5db; /* Light grey text */
    border: 2px solid #6b7280; /* Visible grey border */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .header-action-btn:hover {
    background: #4b5563; /* Lighter grey on hover */
    border-color: #9ca3af; /* Lighter border on hover */
    color: #f3f4f6; /* Even lighter text on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .settings-btn {
    background: #1e3a8a; /* Dark blue background */
    color: #93c5fd; /* Light blue text */
    border-color: #3b82f6; /* Blue border */
}

[data-theme="dark"] .settings-btn:hover {
    background: #1e40af; /* Slightly lighter blue */
    color: #dbeafe; /* Lighter blue text */
    border-color: #60a5fa; /* Lighter blue border */
}

[data-theme="dark"] .archive-btn {
    background: #d1d5db; /* Light grey background */
    color: #000000; /* Black text */
    border-color: #9ca3af; /* Medium grey border */
}

[data-theme="dark"] .archive-btn:hover {
    background: #e5e7eb; /* Slightly lighter grey */
    color: #000000; /* Keep black text */
    border-color: #6b7280; /* Darker grey border */
}

[data-theme="dark"] .feedback-btn {
    background: #d1d5db; /* Light grey background */
    color: #000000; /* Black text */
    border-color: #9ca3af; /* Medium grey border */
}

[data-theme="dark"] .feedback-btn:hover {
    background: #e5e7eb; /* Slightly lighter grey */
    color: #000000; /* Keep black text */
    border-color: #6b7280; /* Darker grey border */
}

/* Apply/Clear Filter Button Styling */
.filter-buttons .header-action-btn,
.action-btn.header-action-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    font-weight: 600;
    border-radius: 5px;
    margin: 0 4px;
    transition: all 0.2s ease;
}

/* Light mode filter buttons */
body[data-theme="light"] .filter-buttons .header-action-btn,
body[data-theme="light"] .action-btn.header-action-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f1f5f9 100%);
    border: 2px solid #cbd5e1;
    color: #475569;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .filter-buttons .header-action-btn:hover,
body[data-theme="light"] .action-btn.header-action-btn:hover {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    border-color: #64748b;
    color: #334155;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Dark mode filter buttons */
[data-theme="dark"] .filter-buttons .header-action-btn,
[data-theme="dark"] .action-btn.header-action-btn {
    background: #475569; /* Grey background */
    color: #cbd5e1; /* Light grey text */
    border: 2px solid #64748b; /* Distinct grey border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .filter-buttons .header-action-btn:hover,
[data-theme="dark"] .action-btn.header-action-btn:hover {
    background: #64748b; /* Lighter grey on hover */
    border-color: #94a3b8; /* Lighter border on hover */
    color: #f1f5f9; /* Lighter text on hover */
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
}

/* Default (Light Mode) Style for Job Complete Button */
#jobCompleteBtn {
    background-color: var(--button-secondary-bg, #6c757d); /* Grey background */
    color: #000000; /* Black text */
    border: 1px solid var(--button-secondary-border, #5a6268);
    border-radius: var(--button-border-radius, 4px); 
    padding: 10px 15px; 
    font-size: 0.95em; 
}

#jobCompleteBtn:hover {
    background-color: var(--button-secondary-hover-bg, #5a6268);
    color: black; /* Keep text black */
    filter: none;
}

/* --- Dark Mode Overrides --- */
/* Removed conflicting archive button styles to allow theme styling to work */

/* Dark Mode Style for Job Complete Button */
body[data-theme='dark'] #jobCompleteBtn {
    background-color: var(--button-secondary-bg, #6c757d); /* Keep it grey */
    color: var(--dark-text-primary, #ffffff); /* Light text */
    border: 1px solid var(--button-secondary-border, #5a6268);
}
body[data-theme='dark'] #jobCompleteBtn:hover {
    background-color: var(--button-secondary-hover-bg, #5a6268);
    color: var(--dark-text-primary, #000000);
}

/* Section Details Table Layout Fix */
.estimate-sections .sections-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin: 1rem 0;
}

.estimate-sections .sections-table th,
.estimate-sections .sections-table td {
    padding: 8px 12px;
    border: 1px solid var(--border);
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

/* Column widths to prevent squishing - Updated for 5 columns */
.estimate-sections .sections-table th:nth-child(1),
.estimate-sections .sections-table td:nth-child(1) { width: 8%; }   /* # */
.estimate-sections .sections-table th:nth-child(2),
.estimate-sections .sections-table td:nth-child(2) { width: 18%; }  /* HxW - increased */
.estimate-sections .sections-table th:nth-child(3),
.estimate-sections .sections-table td:nth-child(3) { width: 40%; }  /* Style - increased */
.estimate-sections .sections-table th:nth-child(4),
.estimate-sections .sections-table td:nth-child(4) { width: 17%; }  /* Finish */
.estimate-sections .sections-table th:nth-child(5),
.estimate-sections .sections-table td:nth-child(5) { width: 17%; }  /* Area - increased */

/* Responsive layout for mobile */
@media (max-width: 768px) {
    /* Enhanced mobile layout for sections table */
    .estimate-sections .sections-table,
    .estimate-sections .sections-table thead,
    .estimate-sections .sections-table tbody,
    .estimate-sections .sections-table th,
    .estimate-sections .sections-table td,
    .estimate-sections .sections-table tr {
        display: block;
    }
    
    .estimate-sections .sections-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    .estimate-sections .sections-table tr {
        border: 1px solid var(--border);
        margin-bottom: 16px;
        padding: 16px;
        border-radius: 12px;
        background: var(--surface);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .estimate-sections .sections-table td {
        border: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 0;
    }
    
    .estimate-sections .sections-table td:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .estimate-sections .sections-table td:before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-secondary);
        font-size: 0.9em;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        min-width: 60px;
        flex-shrink: 0;
    }
    
    .estimate-sections .sections-table td.numeric {
        font-weight: 600;
        color: var(--primary-color);
    }
    
    /* Better spacing for mobile estimate details */
    .estimate-details-modal .modal-content {
        padding: 16px !important;
        margin: 10px !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 20px) !important;
    }
    
    .estimate-details-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .estimate-details-grid > div {
        padding: 12px !important;
        margin-bottom: 16px;
    }
    
    .estimate-sections .table-wrapper {
        max-height: none !important;
        border: none !important;
        border-radius: 0;
    }
    
    .estimate-sections h3 {
        font-size: 1.2em !important;
        margin-bottom: 16px !important;
        text-align: center;
        color: var(--primary-color) !important;
    }
}

/* ... rest of the file ... */

.header-action-btn.secondary {
    background: var(--background-alt-color);
    color: var(--text-secondary);
    border-color: var(--border);
}

.header-action-btn.secondary:hover {
    background: var(--surface);
    color: var(--text-color);
    border-color: var(--text-secondary);
}

/* Manual Lead Creator Info Styling */
.manual-lead-info {
    color: #6366f1 !important; /* Indigo color for manual lead info */
    font-weight: 600;
    font-size: 0.85em;
    display: block;
    margin-top: 2px;
}

/* Dark mode adjustment for manual lead info */
[data-theme="dark"] .manual-lead-info {
    color: #a5b4fc !important; /* Lighter indigo for dark mode */
}

/* Accepted by info styling */
.accepted-by-info {
    color: #059669 !important; /* Green color for accepted info */
    font-weight: 500;
    font-size: 0.85em;
    display: block;
    margin-top: 2px;
}

/* Dark mode adjustment for accepted by info */
[data-theme="dark"] .accepted-by-info {
    color: #34d399 !important; /* Lighter green for dark mode */
}

/* Secondary button styling for Clear Filters */
.header-action-btn.secondary {
    background: var(--background-alt-color);
    color: var(--text-secondary);
    border-color: var(--border);
}

/* Light mode secondary button */
body[data-theme="light"] .header-action-btn.secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #94a3b8;
    color: #64748b;
}

body[data-theme="light"] .header-action-btn.secondary:hover {
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
    border-color: #64748b;
    color: #475569;
}

/* Dark mode secondary button */
[data-theme="dark"] .header-action-btn.secondary {
    background: #374151;
    color: #9ca3af;
    border: 2px solid #4b5563;
}

[data-theme="dark"] .header-action-btn.secondary:hover {
    background: #4b5563;
    color: #d1d5db;
    border-color: #6b7280;
}

/* ==============================================
   HAMBURGER MENU & SIDE NAVIGATION STYLES
   ============================================== */

/* Hamburger Menu Button */
.hamburger-btn {
    background: var(--surface) !important;
    color: var(--text-color) !important;
    border: 2px solid var(--border) !important;
    font-weight: 700;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100; /* Lower z-index so it doesn't interfere with popups */
    width: 44px; /* Make it square and narrower */
    height: 44px;
    padding: 8px; /* Reduce padding for better icon display */
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Hamburger Icon (3 lines) */
.hamburger-icon {
    width: 24px;
    height: 18px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #374151; /* Fallback dark gray */
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Light mode hamburger lines - ensure visibility */
body[data-theme="light"] .hamburger-icon span {
    background-color: #374151 !important; /* Dark gray for visibility on light backgrounds */
}

/* Dark Mode Hamburger Icon Lines - ensure visibility */
[data-theme="dark"] .hamburger-icon span {
    background-color: #ffffff !important; /* Pure white for visibility on dark backgrounds */
    opacity: 1 !important;
}

[data-theme="dark"] .hamburger-btn:hover .hamburger-icon span {
    background-color: #e0e0e0 !important; /* Slightly dimmer white on hover */
}

/* Light mode hover effect */
body[data-theme="light"] .hamburger-btn:hover .hamburger-icon span {
    background-color: #1f2937 !important; /* Darker on hover for feedback */
}

/* Hamburger animation when menu is active */
.hamburger-btn.active .hamburger-icon span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.hamburger-btn.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.hamburger-btn.active .hamburger-icon span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* Dark Mode Hamburger Button - Critical Fixes */
[data-theme="dark"] .hamburger-btn {
    background-color: #000000 !important;
    color: #ffffff !important;
    border: 1px solid #333333 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.8) !important;
    opacity: 1 !important;
}

[data-theme="dark"] .hamburger-btn:hover {
    background-color: #1a1a1a !important;
    border-color: #555555 !important;
    transform: translateY(-1px);
}

/* Ensure hamburger is visible in dark mode with maximum priority */
[data-theme="dark"] .header-action-btn.hamburger-btn {
    background: #000000 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Center the AI Visualization for all screen sizes */
.ai-image-container-centered {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    text-align: center;
}

.ai-image-container-centered .ai-image {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    margin: 15px 0;
}

/* Mobile responsiveness for AI visualization */
@media (max-width: 768px) {
    .ai-image-container-centered {
        padding: 15px;
        margin: 15px auto;
    }
    
    .ai-image-container-centered .ai-image {
        border-radius: 8px;
        margin: 10px 0;
    }
}

@media (max-width: 480px) {
    .ai-image-container-centered {
        padding: 10px;
        margin: 10px auto;
    }
}

/* Side Navigation */
.side-nav {
    position: fixed;
    top: 0;
    right: -320px; /* Hidden by default */
    width: 320px;
    height: 100vh;
    background: var(--surface);
    border-left: 2px solid var(--border);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1002;
    overflow-y: auto;
}

/* Side nav when active */
.side-nav.active {
    right: 0;
}

/* Side nav header */
.side-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.25rem;
    border-bottom: 2px solid var(--border);
    background: var(--background-alt-color);
}

.side-nav-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.4em;
    font-weight: 700;
}

.close-nav-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 1.5em;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

.close-nav-btn:hover {
    background: var(--button-hover-bg);
    color: var(--text-primary);
}

/* Side Navigation Items */
.side-nav-items {
    padding: 1rem 0;
    flex: 1;
    overflow-y: auto;
}

.side-nav-items ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.side-nav-items li {
    margin: 0;
    padding: 0;
}

/* Navigation Item Buttons - Simplified Menu Style */
.nav-item-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: transparent; /* No background by default */
    border: none; /* Remove borders */
    color: var(--text-color);
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0; /* Remove border radius for cleaner menu look */
}

/* Dark mode text fix */
[data-theme="dark"] .nav-item-btn {
    color: var(--text-color, #ffffff);
    background: transparent;
}

.nav-item-btn:hover {
    background: rgba(var(--primary-color-rgb, 99, 102, 241), 0.1);
    color: var(--primary-color);
    transform: none; /* Remove transform effects */
}

[data-theme="dark"] .nav-item-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary-color, #a78bfa);
}

.nav-item-btn i {
    font-size: 1.2rem;
    width: 20px; /* Fixed width for icon alignment */
    text-align: center;
}

.nav-item-btn span {
    flex: 1;
}

/* Theme toggle button special styling */
.nav-item-btn.theme-toggle .theme-icon-light,
.nav-item-btn.theme-toggle .theme-icon-dark {
    font-size: 1rem;
    margin-right: 0.5rem;
}

/* Overlay */
.side-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

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

/* Dark mode adjustments */
[data-theme="dark"] .side-nav {
    background: #000000 !important; /* Solid black background */
    border-left: 2px solid #333333 !important; /* Dark gray border */
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.8) !important; /* Enhanced shadow */
}

[data-theme="dark"] .side-nav-header {
    background: #1a1a1a !important; /* Slightly lighter black for header */
    border-bottom: 2px solid #333333 !important; /* Dark gray border */
}

[data-theme="dark"] .side-nav-header h3 {
    color: #ffffff !important; /* Pure white text for header */
}

[data-theme="dark"] .hamburger-btn {
    background: var(--surface);
    color: var(--text-color);
    border-color: var(--border);
}

[data-theme="dark"] .hamburger-btn:hover {
    background: var(--button-hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

[data-theme="dark"] .nav-item-btn {
    color: #ffffff !important; /* Pure white text for nav items */
    background: transparent;
}

[data-theme="dark"] .nav-item-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important; /* Subtle white overlay on hover */
    color: #a78bfa !important; /* Light purple on hover */
}

[data-theme="dark"] .close-nav-btn {
    color: #ffffff !important; /* Pure white close button */
}

[data-theme="dark"] .close-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important; /* Subtle white overlay */
    color: #a78bfa !important; /* Light purple on hover */
}

/* Light mode specific adjustments */
body[data-theme="light"] .hamburger-btn {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #d1d5db;
    color: #374151;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .hamburger-btn:hover {
    background: linear-gradient(135deg, #f8fafc 0%, #e5e7eb 100%);
    border-color: #9ca3af;
    color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .side-nav {
    background: #ffffff;
    border-left: 2px solid #e5e7eb;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
}

body[data-theme="light"] .side-nav-header {
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
}

body[data-theme="light"] .nav-item-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

body[data-theme="light"] .close-nav-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .side-nav {
        width: 280px;
        right: -280px;
    }
    
    .side-nav-header {
        padding: 1rem;
    }
    
    .nav-item-btn {
        padding: 1rem 1.25rem;
        font-size: 1em;
    }
    
    .nav-item-btn:hover {
        padding-left: 1.75rem;
    }
}

@media (max-width: 480px) {
    .side-nav {
        width: 100vw;
        right: -100vw;
    }
}

/* MOBILE RESPONSIVE HEADER ALIGNMENT */
@media (max-width: 768px) {
    header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }
    
    header h1 {
        flex: 0 0 auto;
        margin: 0;
    }
    
    .dashboard-logo {
        width: 120px !important; /* Smaller on mobile */
        max-width: 120px !important;
    }
    
    #cni-id-display {
        flex: 1 1 auto;
        margin: 0 0.5rem;
        min-width: 0; /* Allow shrinking */
    }
    
    .hamburger-btn {
        flex: 0 0 44px !important; /* Fixed width, no grow/shrink */
        margin-left: auto !important; /* Push to right */
        order: 2; /* Ensure it comes after other elements */
    }
    
    .header-actions {
        flex: 0 0 auto;
        order: 3; /* Comes after hamburger */
        margin-left: 0.5rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.5rem;
        gap: 0.25rem;
    }
    
    .dashboard-logo {
        width: 100px !important;
        max-width: 100px !important;
    }
    
    #cni-id-display {
        font-size: 0.8rem;
        margin: 0 0.25rem;
    }
    
    .hamburger-btn {
        width: 40px !important;
        height: 40px !important;
        padding: 6px !important;
    }
    
    .hamburger-icon {
        width: 20px !important;
        height: 15px !important;
    }
    
    .hamburger-icon span {
        height: 2px !important;
    }
    
    /* Adjust animation for smaller icon */
    .hamburger-btn.active .hamburger-icon span:nth-child(1) {
        transform: translateY(6.5px) rotate(45deg);
    }
    
    .hamburger-btn.active .hamburger-icon span:nth-child(3) {
        transform: translateY(-6.5px) rotate(-45deg);
    }
}

/* Button Container */
.main-actions-container {
    display: flex;
    gap: 1rem;
    align-items: stretch; /* Make buttons same height */
    margin-bottom: 1.5em;
}

/* Base button styles */
.main-actions-container .action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 59.18px; /* Precise height */
    padding: 0.5rem 1.5rem; /* Adjust padding */
    margin: 0;
}

/* nuVision Button Specifics */
.main-actions-container .nuvision-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    min-width: 300px; /* Twice as wide */
    padding: 0.2rem; /* Minimal top/bottom padding */
}

.nuvision-logo-icon {
    width: 96px;  /* Doubled from 48px */
    height: 96px; /* Doubled from 48px */
    object-fit: contain;
    /* Removed filter: brightness(0) invert(1); to restore color */
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .main-actions-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .main-actions-container {
        flex-direction: column; /* Stack buttons on smaller screens */
        align-items: stretch; /* Make buttons full width */
    }
    .main-actions-container .action-btn,
    .main-actions-container .nuvision-btn {
        width: 100%; /* Full width */
        margin-bottom: 10px; /* Space between stacked buttons */
    }
    .main-actions-container .nuvision-btn {
        margin-left: 0; /* Reset margin from desktop view */
    }
}

/* --- Pop-up Message Styling --- */
.pop-up-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 999; /* Lower z-index */
    display: flex; /* Added for potential multiple pop-ups stacking */
    flex-direction: column-reverse; /* New messages appear on top if stacked */
    gap: 15px; /* Spacing between stacked messages */
}

.pop-up-message {
    background-color: var(--background-color, #fff);
    color: var(--text-color, #333);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px; /* Softer corners */
    padding: 20px; /* Increased padding */
    /* Remove fixed positioning from individual messages */
    /* width: auto; Remove, let content define or use max-width */
    max-width: 350px; /* Original max-width */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15); /* Softer, more modern shadow */
    animation: fadeInSlideRight 0.5s ease-out forwards;
    position: relative; /* Keep for close button positioning */
    /* z-index: 1000; Remove, handled by container */
    display: flex; /* Use flex for internal alignment */
    flex-direction: column; /* Stack content and close button */
}

.pop-up-content {
    margin-bottom: 0; /* Remove bottom margin if close button is outside */
    line-height: 1.6; /* Improved readability for multi-line text */
    flex-grow: 1; /* Allow content to take available space */
    /* Order content before close button if necessary via flex order, or ensure DOM order */
}

.pop-up-content p:last-child {
    margin-bottom: 0;
}

.pop-up-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: transparent;
    border: none;
    font-size: 1.8em; /* Larger close icon */
    color: var(--text-color-muted, #aaa);
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.pop-up-close-btn:hover {
    color: var(--primary-color, #e74c3c);
}

/* Animation for pop-up */
@keyframes fadeInSlideRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Dark theme adjustments */
[data-theme="dark"] .pop-up-message {
    background-color: var(--modal-bg-dark, #404040);
    color: var(--text-color-dark, #f0f0f0);
    border-color: var(--border-color-dark, #555);
}

[data-theme="dark"] .pop-up-close-btn {
    color: var(--text-color-dark-muted, #aaa);
}

[data-theme="dark"] .pop-up-close-btn:hover {
    color: var(--primary-color-darker, #e74c3c); /* Ensure this var exists or use a direct value */
}

/* New styles for centering the pop-up messages container */
#pop-up-messages-container {
    position: fixed;
    top: 0; /* Align to top */
    left: 0;
    right: 0;
    bottom: 0; /* Full viewport height */
    display: flex;
    align-items: center; /* MODIFIED back to center for vertical centering */
    justify-content: center; /* Horizontally center the .pop-up-message */
    z-index: 1050;
    padding: 20px; /* Padding for small screens, ensures pop-up isn't edge-to-edge */
    pointer-events: none; 
}

/* Individual pop-up messages within the centered container */
#pop-up-messages-container .pop-up-message {
    background-color: var(--background-color, #fff);
    color: var(--text-color, #333);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 12px;
    padding: 25px; /* Standard padding */
    width: 90vw; /* Use viewport width up to a max */
    max-width: 650px; /* Set a reasonable max-width */
    min-height: 450px; /* MODIFIED - Increased min-height to a fixed pixel value */
    max-height: 90vh; /* Max height relative to viewport height */
    overflow-y: hidden; /* Prevent double scrollbars, content div will scroll */
    display: flex; 
    flex-direction: column; 
    pointer-events: auto; 
    animation: fadeInModal 0.3s ease-out forwards; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    position: relative; 
}

#pop-up-messages-container .pop-up-content {
    flex-grow: 1; /* ADDED - Allow content to take available vertical space */
    min-height: 0; /* ADDED - Good practice for scrollable flex children */
    overflow-y: auto; /* Ensure content area scrolls if content is too long */
    margin-bottom: 15px; /* Add some space before the close button */
    padding-right: 10px; /* Add some padding if scrollbar appears */
}

#pop-up-messages-container .pop-up-content p:last-child {
    margin-bottom: 0;
}

#pop-up-messages-container .pop-up-close-btn {
    display: block; /* Make it a block element */
    width: fit-content; /* Button width based on content */
    margin: 20px auto 0 auto; /* Center button: top margin, auto L/R, no bottom margin */
    padding: 10px 25px; /* More button-like padding */
    background-color: var(--primary-button-bg, #007bff);
    color: var(--primary-button-text, #fff);
    border: none;
    border-radius: 6px;
    font-size: 1rem; /* Standard font size */
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease;
    margin-top: auto; /* Push to bottom if content is short, or after content if long */
    flex-shrink: 0; /* Prevent button from shrinking */
}

#pop-up-messages-container .pop-up-close-btn:hover {
    background-color: var(--primary-button-hover-bg, #0056b3);
    color: var(--primary-button-text, #fff); /* Ensure text color remains on hover */
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: scale(0.95); /* Simpler scale animation for centered element */
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
/* Ensure dark theme compatibility for new/modified styles */
[data-theme="dark"] #pop-up-messages-container .pop-up-message {
    background-color: var(--surface-color, #2c3e50); /* Darker background */
    color: var(--text-color-dark-theme, #ecf0f1);
    border-color: var(--border-color-dark, #34495e);
}

[data-theme="dark"] #pop-up-messages-container .pop-up-close-btn {
    color: var(--text-color-muted-dark, #7f8c8d);
}

[data-theme="dark"] #pop-up-messages-container .pop-up-close-btn:hover {
    color: var(--primary-color-dark-theme, #e74c3c); /* Or a lighter color for contrast */
} 

/* Force color swatches in the selection list to be square */
.color-item .color-swatch {
    border-radius: 0 !important;
    width: 50px;
    height: 50px;
}