/**
 * Aurora ERP — Override Styles
 * 
 * ERP-specific style overrides that sit on top of the Valex theme.
 * This file is loaded AFTER all Valex CSS to allow targeted customizations
 * without modifying the base theme files.
 *
 * Migrated from aurora.css — only ERP-specific styles that Valex doesn't cover.
 *
 * Sections:
 *   1. Layout & Spacing Overrides
 *   2. Sidebar Customizations
 *   3. Topbar / Header Customizations
 *   4. Card & Widget Overrides
 *   5. Table / DataTable Overrides
 *   6. Modal & Form Overrides
 *   7. Badge & Status Overrides
 *   8. Toast & Notification Overrides
 *   9. Print Styles
 *  10. Utility Helpers
 *  11. ERP-Specific Components (Kanban, Pipeline, Gantt, etc.)
 *  12. Login & Error Pages
 *  13. Responsive Design
 *  14. Skeleton Screen Animations
 *  15. Dark Mode Overrides for ERP Components
 *  16. Print Layouts for Documents
 *  17. Help Center Styles
 *  18. Productivity Features (Search, Shortcuts, Favorites, Recent, QuickCreate, Widgets)
 */

/* ==========================================================================
   1. Layout & Spacing Overrides
   ========================================================================== */

/* Main content area — fill available space, reduce excess padding */
.main-content.app-content .container-fluid {
    max-width: 100%;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

/* Cards should use full width of their container */
.card.custom-card {
    margin-bottom: 1rem;
}

/* Page header breadcrumb — consistent top spacing */
.page-header-breadcrumb {
    margin-top: 1rem !important;
    margin-bottom: 1rem !important;
}

/* Ensure rows use full width */
.main-content .row {
    margin-left: 0;
    margin-right: 0;
}

/* Form pages — use Bootstrap default grid widths */

@media (min-width: 1400px) {
    .main-content.app-content .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

@media (max-width: 991.98px) {
    .main-content.app-content .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* ==========================================================================
   2. Sidebar Customizations
   ========================================================================== */

/* Smooth expand/collapse animation for sidebar sub-menus */
.slide.has-sub > .slide-menu {
    transition: max-height 0.3s ease, opacity 0.25s ease;
    overflow: hidden;
}

/* Active state highlighting for current module */
.slide.has-sub.open > .side-menu__item {
    color: var(--primary-color);
    font-weight: 600;
}

/* Sidebar Remix Icon sizing */
.side-menu__icon {
    font-size: 1.15rem;
    line-height: 1;
    margin-inline-end: 0.5rem;
    width: 1.5rem;
    text-align: center;
}

/* Smooth angle rotation on expand */
.slide.has-sub > a > .side-menu__angle {
    transition: transform 0.3s ease;
}
.slide.has-sub.open > a > .side-menu__angle {
    transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   2.1  Sidebar Search — Input field for real-time menu filtering
   Requirements: 5.3
   -------------------------------------------------------------------------- */

.aurora-sidebar-search {
    border-bottom: 1px solid var(--default-border);
}

.aurora-sidebar-search-input {
    padding-left: 2rem;
    padding-right: 2rem;
    font-size: 0.8rem;
    border-radius: 0.375rem;
    background: var(--custom-white);
    border-color: var(--default-border);
    color: var(--default-text-color);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[dir="rtl"] .aurora-sidebar-search-input {
    padding-left: 2rem;
    padding-right: 2rem;
}

.aurora-sidebar-search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.15rem rgba(229, 57, 53, 0.15);
}

.aurora-sidebar-search-input::placeholder {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.aurora-sidebar-search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85rem;
    color: var(--text-muted);
    pointer-events: none;
}

[dir="rtl"] .aurora-sidebar-search-icon {
    left: auto;
    right: 0.6rem;
}

.aurora-sidebar-search-clear {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 0.1rem 0.2rem;
    line-height: 1;
    transition: color 0.15s ease;
}

[dir="rtl"] .aurora-sidebar-search-clear {
    right: auto;
    left: 0.4rem;
}

.aurora-sidebar-search-clear:hover {
    color: var(--default-text-color);
}

/* Hide items that don't match search */
.slide.aurora-search-hidden,
.slide__category.aurora-search-hidden {
    display: none !important;
}

/* Highlight matching text in search results */
.aurora-search-highlight {
    background: rgba(229, 57, 53, 0.15);
    border-radius: 2px;
    padding: 0 1px;
}

[data-theme-mode="dark"] .aurora-search-highlight {
    background: rgba(239, 83, 80, 0.25);
}

/* No results message */
.aurora-sidebar-no-results {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   2.2  Sidebar Notification Badges — Count badges for modules with pending items
   Requirements: 5.6
   -------------------------------------------------------------------------- */

.aurora-sidebar-badge {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15em 0.45em;
    min-width: 1.15rem;
    text-align: center;
    line-height: 1.4;
    margin-inline-start: auto;
    margin-inline-end: 0.35rem;
    flex-shrink: 0;
}

/* Ensure the parent link is flex so badge aligns properly */
.slide.has-sub > .side-menu__item {
    display: flex;
    align-items: center;
}

/* In collapsed sidebar mode, position badge as a dot indicator */
[data-toggled="icon-overlay-close"] .aurora-sidebar-badge,
[data-toggled="icon-text-close"] .aurora-sidebar-badge,
[data-nav-layout="horizontal"] .aurora-sidebar-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    margin: 0;
    padding: 0;
    width: 8px;
    height: 8px;
    min-width: 8px;
    font-size: 0;
    border-radius: 50%;
}

[dir="rtl"] [data-toggled="icon-overlay-close"] .aurora-sidebar-badge,
[dir="rtl"] [data-toggled="icon-text-close"] .aurora-sidebar-badge {
    right: auto;
    left: 6px;
}

/* ==========================================================================
   3. Topbar / Header Customizations
   ========================================================================== */

/* ==========================================================================
   4. Card & Widget Overrides
   ========================================================================== */

/* Dashboard Widget Cards */
.aurora-widget-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.aurora-widget-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aurora-widget-icon {
    width: 44px;
    height: 44px;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aurora-widget-primary { background: var(--aurora-primary-light, #FFEBEE); color: var(--aurora-primary, #E53935); }
.aurora-widget-success { background: #ecfdf5; color: #10b981; }
.aurora-widget-warning { background: #fffbeb; color: #f59e0b; }
.aurora-widget-danger  { background: #fef2f2; color: #ef4444; }
.aurora-widget-info    { background: #eff6ff; color: #3b82f6; }
.aurora-widget-secondary { background: #f1f5f9; color: #64748b; }

.aurora-widget-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.15rem;
}

.aurora-widget-label {
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
}

/* KPI Card — Hover Effect */
.aurora-kpi-hover {
    transition: all 200ms ease;
}

.aurora-kpi-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* KPI Card — Gradient Background Variants */
.aurora-kpi-primary {
    background: linear-gradient(135deg, var(--aurora-primary-light, #FFEBEE) 0%, #FFCDD2 100%);
    color: var(--aurora-primary-hover, #C62828);
}

.aurora-kpi-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #059669;
}

.aurora-kpi-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #d97706;
}

.aurora-kpi-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
}

.aurora-kpi-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
}

.aurora-kpi-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #475569;
}

/* KPI Card — Dark Mode Gradient Variants */
[data-theme-mode="dark"] .aurora-kpi-primary {
    background: linear-gradient(135deg, rgba(229, 57, 53, 0.15) 0%, rgba(198, 40, 40, 0.2) 100%);
    color: #FFCDD2;
}

[data-theme-mode="dark"] .aurora-kpi-success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(5, 150, 105, 0.2) 100%);
    color: #6ee7b7;
}

[data-theme-mode="dark"] .aurora-kpi-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.2) 100%);
    color: #fcd34d;
}

[data-theme-mode="dark"] .aurora-kpi-danger {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(220, 38, 38, 0.2) 100%);
    color: #fca5a5;
}

[data-theme-mode="dark"] .aurora-kpi-info {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(37, 99, 235, 0.2) 100%);
    color: #93c5fd;
}

[data-theme-mode="dark"] .aurora-kpi-secondary {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.15) 0%, rgba(71, 85, 105, 0.2) 100%);
    color: #cbd5e1;
}

[data-theme-mode="dark"] .aurora-kpi-hover:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* KPI Card — Sparkline Container */
.aurora-kpi-sparkline {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 40px;
    overflow: hidden;
    opacity: 0.6;
    pointer-events: none;
}

[dir="rtl"] .aurora-kpi-sparkline {
    right: auto;
    left: 0;
}

/* ==========================================================================
   5. Table / DataTable Overrides
   Requirements: 2.2, 2.5, 8.6
   ========================================================================== */

/* --------------------------------------------------------------------------
   5.1  Filter Panel — Collapsible panel above DataTable
   -------------------------------------------------------------------------- */

.aurora-filter-panel {
    padding: 1rem 1.25rem;
    background: var(--custom-white);
    border: 1px solid var(--default-border);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.aurora-filter-panel .row {
    align-items: flex-end;
}

.aurora-filter-panel label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--default-text-color);
    margin-bottom: 0.25rem;
}

.aurora-filter-panel .btn-group {
    display: flex;
    gap: 0.5rem;
}

/* --------------------------------------------------------------------------
   5.2  Bulk Action Bar — Sticky toolbar for batch operations
   -------------------------------------------------------------------------- */

.aurora-bulk-bar {
    position: sticky;
    top: 0;
    z-index: 1020;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--primary-color, #E53935);
    color: #fff;
    border-radius: 0.5rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    animation: aurora-bulk-bar-in 0.2s ease;
}

@keyframes aurora-bulk-bar-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.aurora-bulk-bar .badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3em 0.65em;
    border-radius: 0.375rem;
    min-width: 1.5rem;
    text-align: center;
}

.aurora-bulk-bar .btn {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
}

.aurora-bulk-bar .btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.5);
}

.aurora-bulk-bar .aurora-bulk-bar-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.15rem 0.35rem;
    line-height: 1;
}

[dir="rtl"] .aurora-bulk-bar .aurora-bulk-bar-close {
    margin-left: 0;
    margin-right: auto;
}

.aurora-bulk-bar .aurora-bulk-bar-close:hover {
    color: #fff;
}

/* --------------------------------------------------------------------------
   5.3  DataTable Loading Overlay — Semi-transparent spinner for AJAX reload
   -------------------------------------------------------------------------- */

.aurora-table-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    border-radius: 0.5rem;
    pointer-events: all;
}

.aurora-table-loading .spinner-border {
    width: 2rem;
    height: 2rem;
    color: var(--primary-color, #E53935);
}

/* ==========================================================================
   6. Modal & Form Overrides
   Requirements: 3.6
   ========================================================================== */

/* --------------------------------------------------------------------------
   6.1  Wizard Form — Multi-step form with step indicators and transitions
   -------------------------------------------------------------------------- */

/* Wizard container */
.aurora-wizard {
    position: relative;
}

/* Step indicator bar — horizontal flex layout */
.aurora-wizard-steps {
    width: 100%;
}

.aurora-wizard-steps .nav-tabs {
    border-bottom: 2px solid var(--default-border);
    gap: 0;
}

/* Individual step indicator */
.aurora-wizard-step {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: color 0.2s ease, border-color 0.2s ease;
    cursor: default;
    position: relative;
}

.aurora-wizard-step .badge {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

/* Active step — primary color highlight */
.aurora-wizard-step.active {
    color: var(--primary-color, #E53935);
    border-bottom-color: var(--primary-color, #E53935);
}

.aurora-wizard-step.active .badge {
    background: var(--primary-color, #E53935);
    color: #fff;
}

/* Completed step — success color with checkmark */
.aurora-wizard-step.completed {
    color: #059669;
    cursor: pointer;
}

.aurora-wizard-step.completed .badge {
    background: #10b981;
    color: #fff;
}

/* Pending step — muted styling */
.aurora-wizard-step.pending,
.aurora-wizard-step.disabled {
    color: #94a3b8;
    cursor: default;
    opacity: 0.7;
}

.aurora-wizard-step.pending .badge,
.aurora-wizard-step.disabled .badge {
    background: #e2e8f0;
    color: #94a3b8;
}

/* Step connector line between steps */
.aurora-wizard-step-connector {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.5rem;
    position: relative;
    align-self: center;
    transition: background 0.3s ease;
}

.aurora-wizard-step-connector.completed {
    background: #10b981;
}

.aurora-wizard-step-connector.active {
    background: linear-gradient(90deg, #10b981 0%, var(--primary-color, #E53935) 100%);
}

/* Step content area with fade/slide transition */
.aurora-wizard-content {
    position: relative;
    min-height: 120px;
}

.aurora-wizard-panel {
    animation: aurora-wizard-fade-in 0.3s ease;
}

@keyframes aurora-wizard-fade-in {
    from {
        opacity: 0;
        transform: translateX(12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Navigation button container */
.aurora-wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    gap: 0.5rem;
}

.aurora-wizard-nav .btn {
    min-width: 100px;
}

/* RTL support for wizard transitions */
[dir="rtl"] .aurora-wizard-panel {
    animation-name: aurora-wizard-fade-in-rtl;
}

@keyframes aurora-wizard-fade-in-rtl {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* --------------------------------------------------------------------------
   6.2  Wizard Form — Dark Mode Variants
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-wizard-steps .nav-tabs {
    border-bottom-color: var(--default-border);
}

[data-theme-mode="dark"] .aurora-wizard-step {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-wizard-step.active {
    color: #EF5350;
    border-bottom-color: #EF5350;
}

[data-theme-mode="dark"] .aurora-wizard-step.active .badge {
    background: #EF5350;
    color: #fff;
}

[data-theme-mode="dark"] .aurora-wizard-step.completed {
    color: #34d399;
}

[data-theme-mode="dark"] .aurora-wizard-step.completed .badge {
    background: #34d399;
    color: #fff;
}

[data-theme-mode="dark"] .aurora-wizard-step.pending .badge,
[data-theme-mode="dark"] .aurora-wizard-step.disabled .badge {
    background: rgba(100, 116, 139, 0.3);
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-wizard-step-connector {
    background: var(--default-border);
}

[data-theme-mode="dark"] .aurora-wizard-step-connector.completed {
    background: #34d399;
}

[data-theme-mode="dark"] .aurora-wizard-step-connector.active {
    background: linear-gradient(90deg, #34d399 0%, #EF5350 100%);
}

/* ==========================================================================
   7. Badge & Status Overrides
   ========================================================================== */

/* Aurora ERP status badge classes */
.aurora-status-draft      { background: #f1f5f9; color: #64748b; }
.aurora-status-active,
.aurora-status-approved,
.aurora-status-paid,
.aurora-status-posted      { background: #ecfdf5; color: #059669; }
.aurora-status-pending,
.aurora-status-in_progress { background: #fffbeb; color: #d97706; }
.aurora-status-overdue,
.aurora-status-rejected,
.aurora-status-cancelled,
.aurora-status-voided      { background: #fef2f2; color: #dc2626; }
.aurora-status-sent,
.aurora-status-confirmed   { background: #eff6ff; color: #2563eb; }
.aurora-status-completed   { background: #ecfdf5; color: #059669; }

/* Badge-status alternative naming */
.badge-status-draft     { background-color: #64748b; color: #fff; }
.badge-status-pending   { background-color: #f59e0b; color: #212529; }
.badge-status-active    { background-color: #10b981; color: #fff; }
.badge-status-approved  { background-color: #10b981; color: #fff; }
.badge-status-completed { background-color: #3b82f6; color: #fff; }
.badge-status-cancelled { background-color: #ef4444; color: #fff; }
.badge-status-overdue   { background-color: #ef4444; color: #fff; }
.badge-status-paid      { background-color: #10b981; color: #fff; }

/* ==========================================================================
   8. Toast & Notification Overrides
   ========================================================================== */

/* Flash Messages / Toast */
.aurora-flash-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    min-width: 300px;
    max-width: 450px;
}

.aurora-flash {
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: aurora-flash-in 0.3s ease;
}

@keyframes aurora-flash-in {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* Notification badge */
.aurora-notif-badge {
    font-size: 0.65rem;
    padding: 0.2em 0.45em;
    transform: translate(-50%, -30%) !important;
}

/* ==========================================================================
   9. Print Styles
   ========================================================================== */

.aurora-print-only {
    display: none;
}

@media print {
    .app-sidebar,
    .app-header,
    .aurora-flash-container,
    .btn,
    .no-print,
    .navbar,
    .switcher-backdrop,
    #switcher-canvas {
        display: none !important;
    }

    .main-content.app-content {
        margin-left: 0 !important;
        margin-inline-start: 0 !important;
        width: 100% !important;
    }

    .aurora-print-only {
        display: block !important;
    }

    .card {
        border: none !important;
        box-shadow: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    a {
        color: #000 !important;
        text-decoration: none !important;
    }

    .table th,
    .table td {
        border-color: #ccc !important;
    }

    /* ------------------------------------------------------------------
       9.1  Payroll Slip Print Layout
       Structured A4 layout: employee header, two-column earnings/deductions,
       and net pay summary. Complements Section 16 .aurora-print-document.
       Requirements: 10.3
       ------------------------------------------------------------------ */

    .aurora-print-payslip {
        max-width: 210mm;
        margin: 0 auto;
        padding: 12mm 15mm;
        font-size: 10pt;
        color: #000 !important;
        background: #fff !important;
    }

    /* Employee details header row */
    .aurora-print-payslip-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        border-bottom: 2px solid #333;
        padding-bottom: 8mm;
        margin-bottom: 8mm;
    }

    .aurora-print-payslip-header .employee-info {
        flex: 1;
    }

    .aurora-print-payslip-header .employee-info h3 {
        margin: 0 0 2mm;
        font-size: 13pt;
        font-weight: 700;
    }

    .aurora-print-payslip-header .employee-info p {
        margin: 0;
        font-size: 9pt;
        color: #555;
        line-height: 1.6;
    }

    .aurora-print-payslip-header .pay-period {
        text-align: right;
        font-size: 9pt;
        color: #555;
    }

    .aurora-print-payslip-header .pay-period strong {
        display: block;
        font-size: 11pt;
        color: #000;
    }

    /* Two-column earnings / deductions layout */
    .aurora-print-payslip-body {
        display: flex;
        gap: 10mm;
        margin-bottom: 8mm;
    }

    .aurora-print-payslip-body .earnings-col,
    .aurora-print-payslip-body .deductions-col {
        flex: 1;
    }

    .aurora-print-payslip-body h4 {
        font-size: 10pt;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        border-bottom: 1px solid #999;
        padding-bottom: 2mm;
        margin: 0 0 3mm;
    }

    .aurora-print-payslip-body table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
    }

    .aurora-print-payslip-body table td {
        padding: 1.5mm 0;
        border-bottom: 1px solid #e5e5e5;
    }

    .aurora-print-payslip-body table td:last-child {
        text-align: right;
        font-weight: 500;
    }

    .aurora-print-payslip-body table tr:last-child td {
        border-bottom: none;
        font-weight: 700;
        padding-top: 3mm;
        border-top: 1px solid #999;
    }

    /* Net pay summary */
    .aurora-print-payslip-net {
        border: 2px solid #333;
        padding: 5mm 8mm;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 5mm;
    }

    .aurora-print-payslip-net .net-label {
        font-size: 11pt;
        font-weight: 700;
        text-transform: uppercase;
    }

    .aurora-print-payslip-net .net-amount {
        font-size: 14pt;
        font-weight: 800;
    }

    /* RTL payslip support */
    [dir="rtl"] .aurora-print-payslip-header {
        flex-direction: row-reverse;
    }

    [dir="rtl"] .aurora-print-payslip-header .pay-period {
        text-align: left;
    }

    [dir="rtl"] .aurora-print-payslip-body {
        flex-direction: row-reverse;
    }

    [dir="rtl"] .aurora-print-payslip-body table td:last-child {
        text-align: left;
    }

    [dir="rtl"] .aurora-print-payslip-net {
        flex-direction: row-reverse;
    }

    /* ------------------------------------------------------------------
       9.2  Financial Report Print Layout
       Layout for trial balance, P&L, balance sheet, aged receivables.
       Report title, date range, data table, and totals row.
       Complements Section 16 .aurora-print-document and .aurora-print-table.
       Requirements: 10.4
       ------------------------------------------------------------------ */

    .aurora-print-report {
        max-width: 210mm;
        margin: 0 auto;
        padding: 12mm 15mm;
        font-size: 10pt;
        color: #000 !important;
        background: #fff !important;
    }

    /* Report title and date range header */
    .aurora-print-report-header {
        text-align: center;
        margin-bottom: 8mm;
        padding-bottom: 5mm;
        border-bottom: 2px solid #333;
    }

    .aurora-print-report-header h2 {
        margin: 0 0 2mm;
        font-size: 14pt;
        font-weight: 700;
    }

    .aurora-print-report-header .report-subtitle {
        font-size: 10pt;
        color: #555;
        margin: 0 0 1mm;
    }

    .aurora-print-report-header .report-date-range {
        font-size: 9pt;
        color: #777;
        margin: 0;
    }

    /* Report data table */
    .aurora-print-report table {
        width: 100%;
        border-collapse: collapse;
        font-size: 9pt;
        margin-bottom: 5mm;
    }

    .aurora-print-report table th {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
        font-weight: 700;
        text-transform: uppercase;
        font-size: 8pt;
        letter-spacing: 0.03em;
        padding: 2.5mm 3mm;
        border-bottom: 2px solid #333;
        text-align: left;
    }

    .aurora-print-report table td {
        padding: 2mm 3mm;
        border-bottom: 1px solid #e5e5e5;
    }

    /* Indented sub-account rows (for trial balance / P&L hierarchy) */
    .aurora-print-report table .indent-1 td:first-child { padding-left: 8mm; }
    .aurora-print-report table .indent-2 td:first-child { padding-left: 16mm; }
    .aurora-print-report table .indent-3 td:first-child { padding-left: 24mm; }

    /* Section header rows within report (e.g. "Assets", "Liabilities") */
    .aurora-print-report table .section-header td {
        font-weight: 700;
        font-size: 10pt;
        padding-top: 4mm;
        border-bottom: 1px solid #999;
        background: none;
    }

    /* Totals row */
    .aurora-print-report table .totals-row td {
        font-weight: 700;
        border-top: 2px solid #333;
        border-bottom: 2px solid #333;
        padding-top: 3mm;
        padding-bottom: 3mm;
        font-size: 10pt;
    }

    /* Numeric columns right-aligned */
    .aurora-print-report table td.amount,
    .aurora-print-report table th.amount {
        text-align: right;
    }

    /* RTL report support */
    [dir="rtl"] .aurora-print-report table th {
        text-align: right;
    }

    [dir="rtl"] .aurora-print-report table .indent-1 td:first-child { padding-left: 0; padding-right: 8mm; }
    [dir="rtl"] .aurora-print-report table .indent-2 td:first-child { padding-left: 0; padding-right: 16mm; }
    [dir="rtl"] .aurora-print-report table .indent-3 td:first-child { padding-left: 0; padding-right: 24mm; }

    [dir="rtl"] .aurora-print-report table td.amount,
    [dir="rtl"] .aurora-print-report table th.amount {
        text-align: left;
    }

    /* ------------------------------------------------------------------
       9.3  Page Break Rules for Multi-Page Reports
       Use .aurora-print-page-break-before / -after alongside the
       Section 16 .aurora-print-page-break class for fine-grained control.
       Requirements: 10.4
       ------------------------------------------------------------------ */

    .aurora-print-page-break-before {
        page-break-before: always;
        break-before: page;
    }

    .aurora-print-page-break-after {
        page-break-after: always;
        break-after: page;
    }

    /* Prevent page breaks inside key elements */
    .aurora-print-payslip-net,
    .aurora-print-report table .totals-row,
    .aurora-print-report-header {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    /* Keep table header rows with at least some data rows */
    .aurora-print-report table thead {
        display: table-header-group;
    }

    .aurora-print-report table tr {
        page-break-inside: avoid;
        break-inside: avoid;
    }
}

/* ==========================================================================
   10. Utility Helpers
   ========================================================================== */

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

/* ==========================================================================
   11. ERP-Specific Components (Kanban, Pipeline, Gantt, File Manager, etc.)
   ========================================================================== */

/* Kanban Board (Project Tasks) */
.aurora-kanban-board {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 1rem;
}

.aurora-kanban-column {
    min-width: 280px;
    flex: 1;
    background: #f1f5f9;
    border-radius: 0.75rem;
    padding: 0.75rem;
}

.aurora-kanban-column-header {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.aurora-kanban-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    transition: box-shadow 0.15s ease;
}

.aurora-kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Pipeline View (CRM Opportunities) */
.aurora-pipeline {
    display: flex;
    gap: 0;
    overflow-x: auto;
}

.aurora-pipeline-stage {
    flex: 1;
    min-width: 200px;
    padding: 0.75rem;
    border-right: 1px solid #e2e8f0;
}

.aurora-pipeline-stage:last-child {
    border-right: none;
}

.aurora-pipeline-stage-header {
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--aurora-primary, #E53935);
    margin-bottom: 0.75rem;
}

.aurora-pipeline-stage-value {
    font-size: 0.75rem;
    color: #94a3b8;
}

/* Gantt Chart (Simple CSS) */
.aurora-gantt-container {
    overflow-x: auto;
    padding: 1rem 0;
}

.aurora-gantt-row {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
    height: 32px;
}

.aurora-gantt-label {
    width: 200px;
    flex-shrink: 0;
    font-size: 0.8rem;
    padding-right: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aurora-gantt-bar-container {
    flex: 1;
    position: relative;
    height: 100%;
}

.aurora-gantt-bar {
    position: absolute;
    height: 20px;
    top: 50%;
    transform: translateY(-50%);
    border-radius: 4px;
    background: var(--aurora-primary, #E53935);
    opacity: 0.8;
    font-size: 0.7rem;
    color: #fff;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    white-space: nowrap;
    overflow: hidden;
}

.aurora-gantt-bar.status-done        { background: #10b981; }
.aurora-gantt-bar.status-in_progress { background: #f59e0b; }
.aurora-gantt-bar.status-todo        { background: #64748b; }

/* File Manager */
.aurora-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.aurora-file-item {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.15s ease;
    cursor: pointer;
}

.aurora-file-item:hover {
    border-color: var(--aurora-primary, #E53935);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.15);
}

.aurora-file-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #94a3b8;
}

.aurora-file-name {
    font-size: 0.8rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aurora-file-meta {
    font-size: 0.7rem;
    color: #94a3b8;
}

.aurora-folder-icon {
    color: #f59e0b;
}

/* Drag & Drop Zone */
.aurora-dropzone {
    border: 2px dashed #e2e8f0;
    border-radius: 0.75rem;
    padding: 3rem 2rem;
    text-align: center;
    background: #f1f5f9;
    transition: all 0.2s ease;
    cursor: pointer;
}

.aurora-dropzone:hover,
.aurora-dropzone.drag-over {
    border-color: var(--aurora-primary, #E53935);
    background: var(--aurora-primary-light, #FFEBEE);
}

.aurora-dropzone-icon {
    font-size: 3rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

/* Email / Messaging */
.aurora-email-layout {
    display: flex;
    gap: 0;
    min-height: 600px;
}

.aurora-email-sidebar {
    width: 200px;
    flex-shrink: 0;
    border-right: 1px solid #e2e8f0;
    padding: 1rem 0;
}

.aurora-email-list {
    flex: 1;
    overflow-y: auto;
}

.aurora-email-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    transition: background 0.1s ease;
}

.aurora-email-item:hover {
    background: #f1f5f9;
}

.aurora-email-item.unread {
    font-weight: 600;
    background: #fefefe;
}

.aurora-email-item.unread::before {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #E53935;
    flex-shrink: 0;
}

.aurora-email-sender {
    font-size: 0.85rem;
    font-weight: 500;
    width: 150px;
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aurora-email-subject {
    flex: 1;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aurora-email-date {
    font-size: 0.75rem;
    color: #94a3b8;
    flex-shrink: 0;
}

/* Storage Usage Bar */
.aurora-storage-bar {
    height: 6px;
    border-radius: 3px;
    background: #f1f5f9;
    overflow: hidden;
}

.aurora-storage-fill {
    height: 100%;
    border-radius: 3px;
    background: var(--aurora-primary, #E53935);
    transition: width 0.3s ease;
}

.aurora-storage-fill.warning { background: #f59e0b; }
.aurora-storage-fill.danger  { background: #ef4444; }

/* Chart Container */
.aurora-chart-container {
    position: relative;
    width: 100%;
    min-height: 250px;
}

/* Progress Bar Custom */
.aurora-progress {
    height: 8px;
    border-radius: 4px;
    background: #f1f5f9;
}

.aurora-progress-bar {
    border-radius: 4px;
    background: var(--aurora-primary, #E53935);
    transition: width 0.5s ease;
}

/* Empty State */
.aurora-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}

.aurora-empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.aurora-empty-state-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.aurora-empty-state-text {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   12. Login & Error Pages
   ========================================================================== */

/* Login Page — Primary button used on standalone pages */
.aurora-btn-primary,
.btn-aurora-primary {
    background-color: var(--aurora-primary, #E53935);
    border-color: var(--aurora-primary, #E53935);
    color: #fff;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}

.aurora-btn-primary:hover,
.btn-aurora-primary:hover {
    background-color: var(--aurora-primary-hover, #C62828);
    border-color: var(--aurora-primary-hover, #C62828);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.35);
}

.aurora-btn-primary:active,
.btn-aurora-primary:active {
    transform: translateY(0);
}

/* Error Pages */
.aurora-error-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aurora-error-code {
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.2;
}

/* ==========================================================================
   13. Responsive Design — Valex Breakpoint Compliance
   Breakpoints: xs(<576), sm(≥576), md(≥768), lg(≥992), xl(≥1200), xxl(≥1400)
   Requirements: 19.1, 19.2, 19.3, 19.4, 19.5
   ========================================================================== */

/* --- All tables must have horizontal scroll on small screens --- */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Ensure DataTables wrapper is also responsive */
.dataTables_wrapper .table-responsive,
.dataTables_wrapper .row {
    overflow-x: visible;
}

div.dataTables_wrapper {
    overflow-x: auto;
}

/* --- Modal forms: mobile-friendly sizing --- */
@media (max-width: 575.98px) {
    /* xs breakpoint: modals go nearly full-width (Req 6.2) */
    .modal-dialog.modal-lg,
    .modal-dialog.modal-xl {
        max-width: 95vw;
        margin: 0.5rem auto;
    }

    .modal-dialog {
        max-width: 95vw;
        margin: 0.5rem auto;
    }

    .modal-body {
        padding: 0.75rem;
    }

    .modal-header,
    .modal-footer {
        padding: 0.5rem 0.75rem;
    }

    .modal-header .modal-title {
        font-size: 0.95rem;
    }

    /* Stack form columns vertically on xs */
    .modal-body .row > [class*="col-md-"],
    .modal-body .row > [class*="col-lg-"],
    .modal-body .row > [class*="col-xl-"],
    .modal-body .row > [class*="col-sm-6"] {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Reduce form group spacing in modals on xs */
    .modal-body .mb-3 {
        margin-bottom: 0.5rem !important;
    }

    /* Page header: stack title and buttons */
    .page-header-breadcrumb {
        flex-direction: column;
        gap: 0.5rem;
    }

    .page-header-breadcrumb .btn-group,
    .page-header-breadcrumb .d-flex {
        flex-wrap: wrap;
        gap: 0.25rem;
    }

    /* Dashboard widgets: 2 columns on xs */
    .aurora-widget-value {
        font-size: 1.25rem;
    }

    .aurora-widget-icon {
        width: 36px;
        height: 36px;
    }

    /* DataTable controls: stack length + search vertically (Req 6.1) */
    .dataTables_wrapper .row:first-child,
    .dataTables_wrapper .row:last-child {
        flex-direction: column;
    }

    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        flex-direction: column;
        width: 100%;
        text-align: left !important;
        margin-bottom: 0.5rem;
    }

    .dataTables_wrapper .dataTables_length label,
    .dataTables_wrapper .dataTables_filter label {
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }

    .dataTables_wrapper .dataTables_length select {
        width: 100% !important;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
    }

    [dir="rtl"] .dataTables_wrapper .dataTables_filter input {
        margin-right: 0 !important;
    }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        width: 100%;
        text-align: center !important;
        margin-top: 0.5rem;
    }

    /* DataTable export/toolbar buttons: wrap on xs */
    .dataTables_wrapper .dt-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }

    /* Action buttons in tables: icon-only on xs (Req 6.1) */
    .table .btn-sm {
        padding: 0.2rem 0.35rem;
        font-size: 0.75rem;
    }

    /* Hide text labels in action buttons, show icon only */
    .table .btn-sm .btn-text,
    .table .btn-sm .button-text,
    .table .btn-sm span:not([class*="ri-"]):not(.badge) {
        display: none;
    }

    .table .btn-sm i,
    .table .btn-sm .ri,
    .table .btn-sm [class^="ri-"],
    .table .btn-sm [class*=" ri-"] {
        margin-right: 0;
        margin-inline-end: 0;
    }

    /* Ensure action button group wraps properly */
    .table td .btn-group,
    .table td .d-flex {
        flex-wrap: wrap;
        gap: 0.15rem;
    }

    /* Bulk action bar: stack on xs */
    .aurora-bulk-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    /* Filter panel: full-width controls on xs */
    .aurora-filter-panel .row > [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* --- sm breakpoint (≥576px) --- */
@media (min-width: 576px) and (max-width: 767.98px) {
    .modal-dialog.modal-lg {
        max-width: calc(100% - 2rem);
    }

    .modal-dialog.modal-xl {
        max-width: calc(100% - 1.5rem);
    }

    .aurora-widget-value {
        font-size: 1.35rem;
    }
}

/* --- md breakpoint (≥768px) — tablet --- */
@media (max-width: 991.98px) {
    /* Sidebar overlay mode: ensure proper z-index and overlay */
    .app-sidebar {
        z-index: 1050;
    }

    /* Main content takes full width when sidebar is hidden */
    .main-content.app-content {
        margin-inline-start: 0 !important;
    }

    /* Topbar adjustments */
    .header-content-right .d-none.d-xl-block {
        display: none !important;
    }

    /* KPI cards: 2-column grid on sm/md instead of 4-column (Req 6.3)
       Bootstrap col-md-6 on the HTML already handles this natively.
       This rule is a safety net for any KPI wrapper that only has col-xl-3
       without col-md-6 (e.g. dynamically generated cards). */
    .row > [class*="col-xl-3"].aurora-kpi-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* --- Responsive: mobile adjustments for ERP components --- */
@media (max-width: 767.98px) {
    .aurora-kanban-board {
        flex-direction: column;
    }

    .aurora-kanban-column {
        min-width: 100%;
    }

    .aurora-file-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .aurora-email-sidebar {
        display: none;
    }

    .aurora-email-list {
        width: 100%;
    }

    /* Detail page tabs: scrollable horizontal tabs (Req 6.5) */
    .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }

    .nav-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }

    .nav-tabs .nav-item {
        flex-shrink: 0;
    }

    .nav-tabs .nav-link {
        white-space: nowrap;
    }

    /* Pipeline: stack stages vertically */
    .aurora-pipeline {
        flex-direction: column;
    }

    .aurora-pipeline-stage {
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .aurora-pipeline-stage:last-child {
        border-bottom: none;
    }

    /* Gantt: reduce label width */
    .aurora-gantt-label {
        width: 120px;
        font-size: 0.7rem;
    }

    /* Card body padding reduction */
    .card-body {
        padding: 0.75rem;
    }
}

/* --- lg breakpoint (≥992px) --- */
@media (min-width: 992px) {
    /* Sidebar toggle: ensure smooth transition */
    .app-sidebar {
        transition: width 0.3s ease;
    }
}

/* --- xl/xxl breakpoints (≥1200px / ≥1400px) --- */
@media (min-width: 1200px) {
    .modal-dialog.modal-xl {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .modal-dialog.modal-xl {
        max-width: 1320px;
    }
}

/* --- Mobile menu toggle: ensure visibility on all pages --- */
.sidemenu-toggle.header-link {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure table-responsive wrapper on all ERP tables */
.card-body > .table,
.card-body > table {
    width: 100%;
}

/* Wrap long text in table cells */
.table td {
    word-break: break-word;
}

/* Ensure breadcrumb wraps on small screens */
.breadcrumb {
    flex-wrap: wrap;
}

/* Touch-friendly action buttons and interactive elements (Req 6.6) */
@media (hover: none) and (pointer: coarse) {
    .btn-sm {
        min-height: 36px;
        min-width: 36px;
    }

    .dropdown-item {
        padding: 0.5rem 1rem;
    }
}

@media (pointer: coarse) {
    /* Ensure all interactive elements meet 36x36px minimum tap target */
    .btn {
        min-height: 36px;
        min-width: 36px;
    }

    .nav-link {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }

    .page-link {
        min-height: 36px;
        min-width: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .form-check-input {
        min-width: 20px;
        min-height: 20px;
    }

    .dropdown-item {
        min-height: 36px;
        display: flex;
        align-items: center;
    }

    .aurora-bulk-bar .btn {
        min-height: 36px;
        min-width: 36px;
    }

    .table .btn-sm {
        min-height: 36px;
        min-width: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Form controls: ensure comfortable touch input height */
    .form-control,
    .form-select {
        min-height: 36px;
    }

    /* Close buttons (modals, toasts, alerts) */
    .btn-close {
        min-height: 36px;
        min-width: 36px;
        padding: 0.5rem;
    }

    /* Sidebar menu items */
    .side-menu__item {
        min-height: 36px;
    }

    /* Choices.js select wrapper */
    .choices .choices__inner {
        min-height: 36px;
    }

    /* Checkbox/radio labels — enlarge tap area */
    .form-check {
        min-height: 36px;
        display: flex;
        align-items: center;
    }

    /* Breadcrumb links */
    .breadcrumb-item a {
        min-height: 36px;
        display: inline-flex;
        align-items: center;
    }
}

/* ============================================
   HELP WIDGET — Floating Button & Panel
   ============================================ */
#aurora-help-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-color, #5b6eae);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(91, 110, 174, 0.4);
    z-index: 1080;
    transition: transform 0.2s, box-shadow 0.2s;
    animation: aurora-help-pulse 3s ease-in-out infinite;
}
#aurora-help-btn:hover,
#aurora-help-btn.ahb-active {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(91, 110, 174, 0.5);
    animation: none;
}
@keyframes aurora-help-pulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(91, 110, 174, 0.4); }
    50% { box-shadow: 0 4px 20px rgba(91, 110, 174, 0.6); }
}

#aurora-help-panel {
    position: fixed;
    bottom: 84px;
    right: 24px;
    width: 340px;
    max-height: 460px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    z-index: 1081;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
}
#aurora-help-panel.ahp-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.ahp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    color: var(--primary-color, #5b6eae);
}
.ahp-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.ahp-close:hover { color: #333; }
.ahp-search { padding: 10px 16px; }
.ahp-search input {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
    outline: none;
}
.ahp-search input:focus { border-color: var(--primary-color, #5b6eae); }
.ahp-results {
    flex: 1;
    overflow-y: auto;
    max-height: 200px;
    padding: 0 8px;
}
.ahp-result-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    text-decoration: none;
    color: #333;
    border-radius: 6px;
    font-size: 13px;
    transition: background 0.15s;
}
.ahp-result-item:hover { background: #f0f4ff; color: var(--primary-color, #5b6eae); }
.ahp-result-item i { color: var(--primary-color, #5b6eae); flex-shrink: 0; }
.ahp-empty, .ahp-loading {
    padding: 12px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}
.ahp-links {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid #eee;
}
.ahp-links a {
    flex: 1;
    text-align: center;
    padding: 6px 8px;
    border-radius: 6px;
    background: #f5f7fa;
    color: #555;
    text-decoration: none;
    font-size: 12px;
    transition: background 0.15s;
}
.ahp-links a:hover { background: #e8ecf4; color: var(--primary-color, #5b6eae); }
.ahp-footer {
    text-align: center;
    padding: 6px 16px 10px;
}
.ahp-footer kbd {
    background: #eee;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 11px;
}

/* Help Tooltip */
.aurora-help-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 12px;
    color: #8896b3;
    cursor: help;
    vertical-align: middle;
    margin-left: 4px;
}
.aurora-help-tip:hover { color: var(--primary-color, #5b6eae); }

/* RTL adjustments */
[dir="rtl"] #aurora-help-btn { right: auto; left: 24px; }
[dir="rtl"] #aurora-help-panel { right: auto; left: 24px; }

/* ==========================================================================
   14. Skeleton Screen Animations
   Requirements: 8.1
   ========================================================================== */

/* Base skeleton class with shimmer gradient animation */
.aurora-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: aurora-shimmer 1.5s infinite;
    border-radius: 0.375rem;
}

/* Skeleton card variant — mimics a KPI or widget card placeholder */
.aurora-skeleton-card {
    height: 120px;
    border-radius: 0.75rem;
}

/* Skeleton row variant — mimics a table row placeholder */
.aurora-skeleton-row {
    height: 1rem;
    margin-bottom: 0.75rem;
    border-radius: 0.25rem;
}

/* Skeleton text variant — mimics a line of text placeholder */
.aurora-skeleton-text {
    height: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 0.25rem;
    width: 80%;
}

/* Dark mode variant */
[data-theme-mode="dark"] .aurora-skeleton {
    background: linear-gradient(90deg, #2a2a3a 25%, #3a3a4a 50%, #2a2a3a 75%);
    background-size: 200% 100%;
}

/* Shimmer keyframes */
@keyframes aurora-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   15. Dark Mode Overrides for ERP Components
   Requirements: 7.1, 7.2
   
   All ERP-specific components that use hardcoded colors need explicit
   dark mode overrides via [data-theme-mode="dark"]. Valex CSS custom
   properties handle the base theme; these rules cover aurora-* classes
   and third-party widget styles (Flatpickr, Choices.js, FilePond).
   ========================================================================== */

/* --------------------------------------------------------------------------
   15.1  Widget / KPI Card Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-widget-primary   { background: rgba(229, 57, 53, 0.15);  color: #EF5350; }
[data-theme-mode="dark"] .aurora-widget-success   { background: rgba(16, 185, 129, 0.15);  color: #34d399; }
[data-theme-mode="dark"] .aurora-widget-warning   { background: rgba(245, 158, 11, 0.15);  color: #fbbf24; }
[data-theme-mode="dark"] .aurora-widget-danger    { background: rgba(239, 68, 68, 0.15);   color: #f87171; }
[data-theme-mode="dark"] .aurora-widget-info      { background: rgba(59, 130, 246, 0.15);  color: #60a5fa; }
[data-theme-mode="dark"] .aurora-widget-secondary { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }

[data-theme-mode="dark"] .aurora-widget-label {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-widget-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --------------------------------------------------------------------------
   15.2  Kanban Board Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-kanban-column {
    background: var(--custom-white);
}

[data-theme-mode="dark"] .aurora-kanban-column-header {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-kanban-card {
    background: var(--default-background);
    border-color: var(--default-border);
}

[data-theme-mode="dark"] .aurora-kanban-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* --------------------------------------------------------------------------
   15.3  Pipeline View Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-pipeline-stage {
    border-right-color: var(--default-border);
}

[data-theme-mode="dark"] .aurora-pipeline-stage-header {
    color: var(--text-muted);
    border-bottom-color: #EF5350;
}

[data-theme-mode="dark"] .aurora-pipeline-stage-value {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   15.4  Gantt Chart Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-gantt-label {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .aurora-gantt-bar {
    background: #EF5350;
}

[data-theme-mode="dark"] .aurora-gantt-bar.status-done {
    background: #34d399;
}

[data-theme-mode="dark"] .aurora-gantt-bar.status-in_progress {
    background: #fbbf24;
}

[data-theme-mode="dark"] .aurora-gantt-bar.status-todo {
    background: #94a3b8;
}

/* Inline Gantt chart (gantt_view.php) dark mode */
[data-theme-mode="dark"] .gantt-label {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .gantt-label-header {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .gantt-header-cell {
    color: var(--text-muted);
    border-right-color: rgba(255, 255, 255, 0.06);
}

[data-theme-mode="dark"] .gantt-header-cell.weekend,
[data-theme-mode="dark"] .gantt-bar-cell.weekend {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme-mode="dark"] .gantt-bar-cell {
    border-right-color: rgba(255, 255, 255, 0.05);
}

[data-theme-mode="dark"] .gantt-row {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme-mode="dark"] .gantt-bar.todo { background: #94a3b8; }
[data-theme-mode="dark"] .gantt-bar.in_progress { background: #EF5350; }
[data-theme-mode="dark"] .gantt-bar.in_review { background: #fbbf24; }
[data-theme-mode="dark"] .gantt-bar.done { background: #34d399; }
[data-theme-mode="dark"] .gantt-milestone { background: #f87171; }
[data-theme-mode="dark"] .gantt-milestone.completed { background: #34d399; }
[data-theme-mode="dark"] .gantt-milestone-row { background: rgba(251, 191, 36, 0.05); }

/* --------------------------------------------------------------------------
   15.5  File Manager Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-file-grid {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .aurora-file-item {
    border-color: var(--default-border);
    background: var(--custom-white);
}

[data-theme-mode="dark"] .aurora-file-item:hover {
    border-color: #EF5350;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.25);
}

[data-theme-mode="dark"] .aurora-file-icon {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-file-name {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .aurora-file-meta {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-dropzone {
    border-color: var(--default-border);
    background: var(--custom-white);
}

[data-theme-mode="dark"] .aurora-dropzone:hover,
[data-theme-mode="dark"] .aurora-dropzone.drag-over {
    border-color: #EF5350;
    background: rgba(229, 57, 53, 0.1);
}

[data-theme-mode="dark"] .aurora-dropzone-icon {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   15.6  Status Badge Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-status-draft {
    background: rgba(100, 116, 139, 0.2);
    color: #94a3b8;
}

[data-theme-mode="dark"] .aurora-status-active,
[data-theme-mode="dark"] .aurora-status-approved,
[data-theme-mode="dark"] .aurora-status-paid,
[data-theme-mode="dark"] .aurora-status-posted,
[data-theme-mode="dark"] .aurora-status-completed {
    background: rgba(5, 150, 105, 0.2);
    color: #34d399;
}

[data-theme-mode="dark"] .aurora-status-pending,
[data-theme-mode="dark"] .aurora-status-in_progress {
    background: rgba(217, 119, 6, 0.2);
    color: #fbbf24;
}

[data-theme-mode="dark"] .aurora-status-overdue,
[data-theme-mode="dark"] .aurora-status-rejected,
[data-theme-mode="dark"] .aurora-status-cancelled,
[data-theme-mode="dark"] .aurora-status-voided {
    background: rgba(220, 38, 38, 0.2);
    color: #f87171;
}

[data-theme-mode="dark"] .aurora-status-sent,
[data-theme-mode="dark"] .aurora-status-confirmed {
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
}

/* --------------------------------------------------------------------------
   15.7  Email / Messaging Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-email-sidebar {
    border-right-color: var(--default-border);
}

[data-theme-mode="dark"] .aurora-email-item {
    border-bottom-color: var(--default-border);
}

[data-theme-mode="dark"] .aurora-email-item:hover {
    background: var(--custom-white);
}

[data-theme-mode="dark"] .aurora-email-item.unread {
    background: var(--default-background);
}

[data-theme-mode="dark"] .aurora-email-date {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   15.8  Storage, Progress, Empty State Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-storage-bar {
    background: var(--custom-white);
}

[data-theme-mode="dark"] .aurora-progress {
    background: var(--custom-white);
}

[data-theme-mode="dark"] .aurora-empty-state {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-empty-state-icon {
    opacity: 0.2;
}

[data-theme-mode="dark"] .aurora-empty-state-title {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-empty-state-text {
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   15.8b Filter Panel, Bulk Action Bar & Table Loading Dark Mode
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-filter-panel {
    background: var(--custom-white);
    border-color: var(--default-border);
}

[data-theme-mode="dark"] .aurora-filter-panel label {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .aurora-bulk-bar {
    background: #EF5350;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

[data-theme-mode="dark"] .aurora-table-loading {
    background: rgba(0, 0, 0, 0.5);
}

[data-theme-mode="dark"] .aurora-table-loading .spinner-border {
    color: #EF5350;
}

/* --------------------------------------------------------------------------
   15.8c Bulk Action Bar Close, Folder Icon, Storage, Progress Bar Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-bulk-bar .aurora-bulk-bar-close {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme-mode="dark"] .aurora-bulk-bar .aurora-bulk-bar-close:hover {
    color: #fff;
}

[data-theme-mode="dark"] .aurora-folder-icon {
    color: #fbbf24;
}

[data-theme-mode="dark"] .aurora-storage-fill {
    background: #EF5350;
}

[data-theme-mode="dark"] .aurora-storage-fill.warning {
    background: #fbbf24;
}

[data-theme-mode="dark"] .aurora-storage-fill.danger {
    background: #f87171;
}

[data-theme-mode="dark"] .aurora-progress-bar {
    background: #EF5350;
}

/* --------------------------------------------------------------------------
   15.9  Chart Container Override
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-chart-container {
    color: var(--default-text-color);
}

/* --------------------------------------------------------------------------
   15.10 Login & Button Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-btn-primary,
[data-theme-mode="dark"] .btn-aurora-primary {
    background-color: #EF5350;
    border-color: #EF5350;
}

[data-theme-mode="dark"] .aurora-btn-primary:hover,
[data-theme-mode="dark"] .btn-aurora-primary:hover {
    background-color: #E53935;
    border-color: #E53935;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
}

/* --------------------------------------------------------------------------
   15.11 Help Widget Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] #aurora-help-panel {
    background: var(--custom-white);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

[data-theme-mode="dark"] .ahp-header {
    border-bottom-color: var(--default-border);
}

[data-theme-mode="dark"] .ahp-close {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .ahp-close:hover {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .ahp-search input {
    background: var(--default-background);
    border-color: var(--default-border);
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .ahp-result-item {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .ahp-result-item:hover {
    background: rgba(229, 57, 53, 0.1);
}

[data-theme-mode="dark"] .ahp-empty,
[data-theme-mode="dark"] .ahp-loading {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .ahp-links a {
    background: var(--default-background);
    color: var(--text-muted);
}

[data-theme-mode="dark"] .ahp-links a:hover {
    background: rgba(229, 57, 53, 0.1);
}

[data-theme-mode="dark"] .ahp-links {
    border-top-color: var(--default-border);
}

[data-theme-mode="dark"] .ahp-footer kbd {
    background: var(--default-background);
    border-color: var(--default-border);
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-help-tip {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .aurora-help-tip:hover {
    color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   15.12 Flash / Toast Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-flash {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   15.13 Notification Badge Override
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-notif-badge {
    box-shadow: 0 0 0 2px var(--custom-white);
}

/* --------------------------------------------------------------------------
   15.14 Responsive Dark Mode — Mobile Pipeline & Email borders
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {
    [data-theme-mode="dark"] .aurora-pipeline-stage {
        border-bottom-color: var(--default-border);
    }
}

/* --------------------------------------------------------------------------
   15.15 Third-Party Widget Dark Mode — Flatpickr
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .flatpickr-calendar {
    background: var(--custom-white);
    border-color: var(--default-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

[data-theme-mode="dark"] .flatpickr-months .flatpickr-month {
    background: var(--custom-white);
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--custom-white);
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .flatpickr-current-month input.cur-year {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .flatpickr-weekdays {
    background: var(--custom-white);
}

[data-theme-mode="dark"] span.flatpickr-weekday {
    color: var(--text-muted);
    background: var(--custom-white);
}

[data-theme-mode="dark"] .flatpickr-day {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .flatpickr-day:hover {
    background: rgba(229, 57, 53, 0.15);
    border-color: transparent;
}

[data-theme-mode="dark"] .flatpickr-day.prevMonthDay,
[data-theme-mode="dark"] .flatpickr-day.nextMonthDay {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .flatpickr-day.today {
    border-color: var(--primary-color);
}

[data-theme-mode="dark"] .flatpickr-day.selected,
[data-theme-mode="dark"] .flatpickr-day.startRange,
[data-theme-mode="dark"] .flatpickr-day.endRange {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

[data-theme-mode="dark"] .flatpickr-day.inRange {
    background: rgba(229, 57, 53, 0.15);
    border-color: transparent;
    box-shadow: -5px 0 0 rgba(229, 57, 53, 0.15), 5px 0 0 rgba(229, 57, 53, 0.15);
}

[data-theme-mode="dark"] .flatpickr-months .flatpickr-prev-month,
[data-theme-mode="dark"] .flatpickr-months .flatpickr-next-month {
    color: var(--default-text-color);
    fill: var(--default-text-color);
}

[data-theme-mode="dark"] .flatpickr-months .flatpickr-prev-month:hover svg,
[data-theme-mode="dark"] .flatpickr-months .flatpickr-next-month:hover svg {
    fill: var(--primary-color);
}

[data-theme-mode="dark"] .flatpickr-time {
    border-top-color: var(--default-border);
}

[data-theme-mode="dark"] .flatpickr-time input {
    color: var(--default-text-color);
    background: var(--custom-white);
}

[data-theme-mode="dark"] .flatpickr-time .flatpickr-am-pm {
    color: var(--default-text-color);
    background: var(--custom-white);
}

/* --------------------------------------------------------------------------
   15.16 Third-Party Widget Dark Mode — Choices.js
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .choices {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .choices__inner {
    background: var(--default-background);
    border-color: var(--default-border);
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .choices__input {
    background: var(--default-background);
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .choices__list--dropdown {
    background: var(--custom-white);
    border-color: var(--default-border);
}

[data-theme-mode="dark"] .choices__list--dropdown .choices__item {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: rgba(229, 57, 53, 0.15);
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .choices__list--multiple .choices__item {
    background: rgba(229, 57, 53, 0.2);
    border-color: rgba(229, 57, 53, 0.3);
    color: #EF5350;
}

[data-theme-mode="dark"] .choices__list--single {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .choices[data-type*="select-one"] .choices__input {
    background: var(--custom-white);
    border-bottom-color: var(--default-border);
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .choices__placeholder {
    color: var(--text-muted);
    opacity: 0.7;
}

/* --------------------------------------------------------------------------
   15.17 Third-Party Widget Dark Mode — FilePond
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .filepond--root {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .filepond--panel-root {
    background-color: var(--default-background);
    border-color: var(--default-border);
}

[data-theme-mode="dark"] .filepond--drop-label {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .filepond--drop-label label {
    color: var(--text-muted);
}

[data-theme-mode="dark"] .filepond--label-action {
    color: var(--primary-color);
    text-decoration-color: var(--primary-color);
}

[data-theme-mode="dark"] .filepond--item-panel {
    background-color: var(--custom-white);
}

[data-theme-mode="dark"] .filepond--file {
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .filepond--drip-blob {
    background-color: rgba(229, 57, 53, 0.15);
}

[data-theme-mode="dark"] .filepond--image-preview-overlay-idle {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme-mode="dark"] .filepond--file-action-button {
    color: var(--default-text-color);
}

/* Sidebar search input dark mode */
[data-theme-mode="dark"] .aurora-sidebar-search-input {
    background: var(--custom-white);
    border-color: var(--default-border);
    color: var(--default-text-color);
}

[data-theme-mode="dark"] .aurora-sidebar-search-input:focus {
    border-color: #EF5350;
    box-shadow: 0 0 0 0.15rem rgba(239, 83, 80, 0.25);
}

[data-theme-mode="dark"] .aurora-sidebar-search-input::placeholder {
    color: var(--text-muted);
}

/* ==========================================================================
   16. Print Layouts for Documents (Invoice, PO, Payroll Slip)
   Requirements: 10.1, 10.2, 10.5, 10.6
   
   Professional A4 print layouts for invoices, quotations, purchase orders,
   payroll slips, and financial reports. Includes RTL support and dark mode
   print override to force light backgrounds.
   ========================================================================== */

/* Screen-only: hide print-only elements on screen */
.aurora-print-only {
    display: none !important;
}

@media print {
    /* Show print-only elements when printing */
    .aurora-print-only {
        display: block !important;
    }

    /* A4 document layout */
    .aurora-print-document {
        max-width: 210mm;
        margin: 0 auto;
        padding: 15mm;
        font-size: 10pt;
        color: #000 !important;
        background: #fff !important;
    }

    /* Letterhead: company info + logo side by side */
    .aurora-print-letterhead {
        display: flex;
        justify-content: space-between;
        border-bottom: 2px solid #333;
        padding-bottom: 10mm;
        margin-bottom: 10mm;
    }

    /* Table header background preserved in print */
    .aurora-print-table th {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* Right-aligned financial totals summary */
    .aurora-print-totals {
        float: right;
        width: 250px;
    }

    /* Force page breaks for multi-page reports */
    .aurora-print-page-break {
        page-break-before: always;
    }

    /* RTL print support */
    [dir="rtl"] .aurora-print-letterhead {
        flex-direction: row-reverse;
    }

    [dir="rtl"] .aurora-print-totals {
        float: left;
    }

    /* Override dark mode for print — force white background and dark text */
    [data-theme-mode="dark"] body {
        background: #fff !important;
        color: #000 !important;
    }

    [data-theme-mode="dark"] .card {
        background: #fff !important;
        color: #000 !important;
    }
}

/* ------------------------------------------------------------------
   Section 17: Help Center Styles
   Category cards, article cards, and help-specific hover effects.
   ------------------------------------------------------------------ */

.aurora-help-category-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.aurora-help-category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.aurora-help-article-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.aurora-help-article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme-mode="dark"] .aurora-help-category-card:hover {
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05);
}

[data-theme-mode="dark"] .aurora-help-article-card:hover {
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   18. Productivity Features (Search, Shortcuts, Favorites, Recent, QuickCreate, Widgets)
   Requirements: 1.11, 2.9, 3.9, 4.9, 5.7, 6.10, 7.8, 7.9
   ========================================================================== */

/* --------------------------------------------------------------------------
   18.1  Global Search Overlay
   -------------------------------------------------------------------------- */

.aurora-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1060;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    backdrop-filter: blur(4px);
}

.aurora-search-dialog {
    width: 100%;
    max-width: 640px;
    background: var(--custom-white);
    border-radius: 0.75rem;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.aurora-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--default-border);
}

.aurora-search-input-wrapper .aurora-search-icon {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-inline-end: 0.75rem;
    flex-shrink: 0;
}

.aurora-search-input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 1rem;
    background: transparent;
    color: var(--default-text-color);
    min-width: 0;
}

.aurora-search-input::placeholder {
    color: var(--text-muted);
}

.aurora-search-kbd {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    background: var(--default-border);
    color: var(--text-muted);
    flex-shrink: 0;
    margin-inline-start: 0.5rem;
}

.aurora-search-results {
    max-height: 400px;
    overflow-y: auto;
}

.aurora-search-group-label {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.aurora-search-item {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    color: var(--default-text-color);
}

.aurora-search-item:hover,
.aurora-search-item.active {
    background: var(--primary-01);
}

.aurora-search-item .search-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-inline-end: 0.75rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.aurora-search-item .search-title {
    font-weight: 500;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.aurora-search-item .search-module {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.aurora-search-module-badge {
    font-size: 0.65rem;
    padding: 0.15em 0.45em;
    border-radius: 0.25rem;
    background: var(--primary-01);
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
    margin-inline-start: auto;
}

.aurora-search-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   18.2  Keyboard Shortcuts Help Modal
   -------------------------------------------------------------------------- */

.aurora-shortcuts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aurora-shortcuts-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--default-border);
}

.aurora-shortcuts-list li:last-child {
    border-bottom: none;
}

.aurora-shortcuts-list kbd {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--default-border);
    color: var(--default-text-color);
}

.aurora-shortcuts-table {
    width: 100%;
}

.aurora-shortcuts-table td {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--default-border);
}

.aurora-shortcuts-table tr:last-child td {
    border-bottom: none;
}

.aurora-shortcuts-table td:last-child {
    text-align: end;
}

/* --------------------------------------------------------------------------
   18.3  Topbar Dropdown Shared Styles (Favorites, Recent, QuickCreate)
   -------------------------------------------------------------------------- */

.aurora-topbar-dropdown {
    min-width: 280px;
    max-height: 400px;
    overflow-y: auto;
}

.aurora-topbar-dropdown .dropdown-header {
    font-weight: 600;
    font-size: 0.85rem;
}

.aurora-topbar-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* --- Favorites --- */
.aurora-favorites-item {
    padding: 0.5rem 0.75rem;
    transition: background 0.15s ease;
}

.aurora-favorites-item:hover {
    background: var(--primary-01);
}

.aurora-favorites-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* --- Recent Records --- */
.aurora-recent-item {
    padding: 0.5rem 0.75rem;
    transition: background 0.15s ease;
}

.aurora-recent-item:hover {
    background: var(--primary-01);
}

.aurora-recent-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: var(--text-muted);
}

/* --- Quick Create --- */
.aurora-quickcreate-item {
    padding: 0.5rem 0.75rem;
    transition: background 0.15s ease;
}

.aurora-quickcreate-item:hover {
    background: var(--primary-01);
}

/* --------------------------------------------------------------------------
   18.4  Widget Manager
   -------------------------------------------------------------------------- */

.aurora-widget-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--default-border);
}

.aurora-widget-toggle:last-child {
    border-bottom: none;
}

.aurora-widget-toggle-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aurora-widget-toggle-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--default-border);
}

.aurora-widget-toggle-list li:last-child {
    border-bottom: none;
}

.aurora-widget-manager-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aurora-widget-manager-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--default-border);
}

.aurora-widget-manager-list li:last-child {
    border-bottom: none;
}

/* --------------------------------------------------------------------------
   18.5  Dark Mode Overrides
   -------------------------------------------------------------------------- */

[data-theme-mode="dark"] .aurora-search-overlay {
    background: rgba(0, 0, 0, 0.7);
}

[data-theme-mode="dark"] .aurora-search-dialog {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}

[data-theme-mode="dark"] .aurora-search-item:hover,
[data-theme-mode="dark"] .aurora-search-item.active {
    background: rgba(229, 57, 53, 0.1);
}

[data-theme-mode="dark"] .aurora-search-module-badge {
    background: rgba(229, 57, 53, 0.15);
    color: #FFCDD2;
}

[data-theme-mode="dark"] .aurora-favorites-item:hover,
[data-theme-mode="dark"] .aurora-recent-item:hover,
[data-theme-mode="dark"] .aurora-quickcreate-item:hover {
    background: rgba(229, 57, 53, 0.1);
}

/* --------------------------------------------------------------------------
   18.6  RTL Support
   Uses logical properties (margin-inline-start/end) throughout, so most
   components are RTL-ready by default. Additional overrides below.
   -------------------------------------------------------------------------- */

[dir="rtl"] .aurora-search-kbd {
    margin-inline-start: 0.5rem;
    margin-inline-end: 0;
}

[dir="rtl"] .aurora-shortcuts-table td:last-child {
    text-align: start;
}

[dir="rtl"] .aurora-fav-remove {
    margin-inline-start: 0;
    margin-inline-end: 0.25rem;
}

/* --------------------------------------------------------------------------
   18.7  Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 575.98px) {
    .aurora-search-overlay {
        padding-top: 5vh;
    }

    .aurora-search-dialog {
        max-width: calc(100% - 1.5rem);
        margin: 0 0.75rem;
    }

    .aurora-topbar-dropdown {
        min-width: 240px;
    }
}

/* ============================================================
   SPA Navigation Buffer — Progress Bar & Transitions
   ============================================================ */

/* SPA Progress Bar */
#spa-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background-color: var(--primary-color, #5b6eae);
    z-index: 9999;
    transition: width 0.4s ease, opacity 0.3s ease;
    pointer-events: none;
}

/* Indeterminate animation for the progress bar */
@keyframes spa-progress-indeterminate {
    0% { width: 0%; left: 0; }
    50% { width: 30%; left: 35%; }
    100% { width: 0%; left: 100%; }
}

#spa-progress-bar.indeterminate {
    animation: spa-progress-indeterminate 1.5s ease-in-out infinite;
}

/* Content area fade transition for smooth content swap */
.main-content .container-fluid {
    transition: opacity 0.15s ease;
}

.main-content .container-fluid.spa-loading {
    opacity: 0.6;
    pointer-events: none;
}

.main-content .container-fluid.spa-loaded {
    opacity: 1;
}
