/* 🌟 LINETECO ERP Premium Modern Theme (Odoo Style & Glassmorphism Dashboard) */
@import url('https://fonts.googleapis.com/css2?family=Zain:ital,wght@0,200;0,300;0,400;0,700;0,800;0,900;1,300;1,400&family=Cairo:wght@300;400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600;700&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── 0. Global Modern Typography System (Crisp, Executive & Legible - Powered by Zain Font) ── */
html, body, button, input, select, textarea, .btn, .table, .modal, .dropdown-menu, .form-control, .select2-container, .popover, .tooltip {
    font-family: 'Zain', 'Cairo', 'IBM Plex Sans Arabic', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    letter-spacing: normal !important;
}

h1, h2, h3, h4, h5, h6, .content-header h1, .modal-title, .box-title {
    font-family: 'Zain', 'Cairo', 'IBM Plex Sans Arabic', sans-serif !important;
    font-weight: 700 !important;
    letter-spacing: -0.01em !important;
}

/* 1. Dashboard Info Boxes & Cards */
.info-box, .box, .card, .panel {
    background: rgba(255, 255, 255, 0.95) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.04), 0 2px 4px -1px rgba(0, 0, 0, 0.02) !important;
    border-radius: 12px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden;
}

.info-box:hover, .card:hover, .box:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Info Box Icons */
.info-box-icon {
    border-radius: 10px !important;
    margin: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

/* 2. Premium Buttons & Badges */
.btn-primary, .btn-success, .btn-info, .btn-warning, .btn-danger {
    border-radius: 8px !important;
    font-weight: 500 !important;
    padding: 6px 16px !important;
    transition: all 0.2s ease-in-out !important;
    border: none !important;
    box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.05) !important;
}

.btn-primary { background-color: #3b82f6 !important; color: #fff !important; }
.btn-primary:hover { background-color: #2563eb !important; transform: translateY(-1px); }
.btn-success { background-color: #10b981 !important; color: #fff !important; }
.btn-success:hover { background-color: #059669 !important; transform: translateY(-1px); }

/* Badges styling */
.badge {
    border-radius: 9999px !important;
    padding: 3px 10px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.05em;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* 3. Sub-Header Navigation Bar */
.app-sub-header-bar {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0 24px;
    height: 48px;
    width: 100%;
    z-index: 990;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

body.dark-mode .app-sub-header-bar {
    background: #1e293b !important;
    border-bottom: 1px solid #334155 !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.15);
}

.horizontal-menu-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
    height: 100%;
    /* Fill the available width and keep items on one line; the JS priority+
       handler moves overflowing items into the "More" bucket. NOTE: overflow
       must stay visible here, otherwise the absolutely-positioned submenu
       dropdowns (which drop below the bar) would be clipped. */
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.horizontal-menu-item { flex: 0 0 auto; white-space: nowrap; }

.horizontal-menu-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.horizontal-menu-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    color: #1e293b !important; /* Strong high-contrast color for light mode */
    text-decoration: none !important;
    font-size: 13.5px;
    font-weight: 700;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
}

body.dark-mode .horizontal-menu-link {
    color: #f1f5f9 !important; /* Strong high-contrast color for dark mode */
}

.horizontal-menu-link:hover {
    background-color: #f1f5f9;
    color: #2563eb !important;
}

body.dark-mode .horizontal-menu-link:hover {
    background-color: #334155 !important;
    color: #60a5fa !important;
}

.horizontal-menu-item.active .horizontal-menu-link {
    background-color: rgba(37, 99, 235, 0.1);
    color: #2563eb !important;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.2);
}

body.dark-mode .horizontal-menu-item.active .horizontal-menu-link {
    background-color: rgba(96, 165, 250, 0.15) !important;
    color: #60a5fa !important;
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.3) !important;
}

/* Dropdown styling for sub-menus */
.horizontal-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 210px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 20px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 6px 0;
    margin-top: 4px;
    z-index: 2000;
    animation: slideDown 0.15s ease-out;
}

[dir="rtl"] .horizontal-dropdown {
    left: auto;
    right: 0;
}

body.dark-mode .horizontal-dropdown {
    background: #1e293b !important;
    border: 1px solid #334155 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.horizontal-menu-item:hover .horizontal-dropdown {
    display: block;
}

/* ── Overflow "More" bucket (priority+ responsive sub-nav) ─────────────── */
.more-menu-item { flex: 0 0 auto; }

.more-dropdown {
    max-height: 72vh;
    overflow-y: auto;
    min-width: 230px;
}

/* Open the More panel toward the viewport centre regardless of direction. */
.more-dropdown { left: auto; right: 0; }
[dir="rtl"] .more-dropdown { right: auto; left: 0; }

/* Items moved into the More panel render as a flat vertical list; any nested
   submenu is flattened inline (always visible, indented) instead of hover. */
.more-dropdown .horizontal-menu-item {
    display: block;
    width: 100%;
    height: auto;
}
.more-dropdown .horizontal-menu-link {
    width: 100%;
    border-radius: 0;
    justify-content: flex-start;
}
.more-dropdown .horizontal-menu-link .fa-chevron-down { display: none; }
.more-dropdown .horizontal-dropdown {
    display: block;
    position: static;
    box-shadow: none;
    border: none;
    min-width: 0;
    margin: 0;
    padding: 0 0 6px 0;
    animation: none;
    background: transparent !important;
}
.more-dropdown .horizontal-dropdown-link {
    padding-inline-start: 36px;
    font-size: 12.5px;
}

.horizontal-dropdown-link {
    display: block;
    padding: 8px 18px;
    color: #475569;
    font-size: 13px;
    text-decoration: none !important;
    transition: all 0.2s ease;
    text-align: start;
}

body.dark-mode .horizontal-dropdown-link {
    color: #cbd5e1 !important;
}

.horizontal-dropdown-link:hover {
    background-color: #f1f5f9;
    color: #2563eb;
    padding-left: 22px;
}

[dir="rtl"] .horizontal-dropdown-link:hover {
    padding-left: 18px;
    padding-right: 22px;
}

body.dark-mode .horizontal-dropdown-link:hover {
    background-color: #334155 !important;
    color: #60a5fa !important;
}

.horizontal-dropdown-link.active {
    background-color: rgba(37, 99, 235, 0.05);
    color: #2563eb;
    font-weight: 700;
}

body.dark-mode .horizontal-dropdown-link.active {
    background-color: rgba(96, 165, 250, 0.1) !important;
    color: #60a5fa !important;
}

/* 4. Odoo-Style App Switcher Launcher */
.app-switcher-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.app-switcher-trigger:hover {
    background-color: #f1f5f9;
    color: #1e293b;
    border-color: #cbd5e1;
}

/* The Overlay Grid Launcher Screen */
.app-switcher-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 15, 30, 0.96);
    backdrop-filter: blur(24px);
    z-index: 10000;
    padding: 30px;
    overflow: hidden;
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.99); }
    to { opacity: 1; transform: scale(1); }
}

/* Command Center Layout */
.command-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Header */
.command-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.command-logo-area {
    display: flex;
    flex-direction: column;
}

.command-logo-title {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.03em;
    background: linear-gradient(135deg, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.command-logo-sub {
    font-size: 11.5px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Search bar */
.command-search-wrap {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.command-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 10px 16px 10px 42px;
    color: #ffffff;
    font-size: 14.5px;
    outline: none;
    transition: all 0.25s ease;
}

[dir="rtl"] .command-search-input {
    padding: 10px 42px 10px 16px;
}

.command-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.command-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: #64748b;
    pointer-events: none;
}

[dir="rtl"] .command-search-icon {
    left: auto;
    right: 14px;
}

/* Body Split Pane */
.command-body {
    display: flex;
    flex: 1;
    gap: 24px;
    margin-top: 24px;
    overflow: hidden;
    height: calc(100vh - 130px);
}

/* Sidebar */
.command-sidebar {
    width: 290px;
    flex-shrink: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
}

[dir="rtl"] .command-sidebar {
    padding-right: 0;
    padding-left: 10px;
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-active-indicator {
    position: absolute;
    right: 10px;
    width: calc(100% - 20px);
    height: 48px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(147, 51, 234, 0.1));
    border-right: 3px solid #3b82f6;
    border-radius: 10px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s, height 0.2s;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
}

[dir="ltr"] .sidebar-active-indicator {
    right: auto;
    left: 10px;
    border-right: none;
    border-left: 3px solid #3b82f6;
}

.command-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: #94a3b8 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.command-sidebar-item:hover {
    color: #f1f5f9 !important;
}

.command-sidebar-item.active {
    color: #60a5fa !important;
}

/* Star Pinning styles */
.command-sub-link {
    position: relative;
    padding-left: 12px;
    padding-right: 12px;
}
.pin-star-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 4px;
    cursor: pointer;
    opacity: 0.25;
    transition: all 0.2s ease;
    color: #94a3b8;
}
[dir="rtl"] .pin-star-btn {
    margin-right: 0;
    margin-left: 4px;
}
.command-sub-link:hover .pin-star-btn {
    opacity: 0.75;
}
.pin-star-btn:hover {
    transform: scale(1.25);
    opacity: 1 !important;
    color: #eab308 !important;
}
.pin-star-btn.pinned {
    opacity: 1 !important;
    color: #eab308 !important;
}
.pin-star-btn.pinned svg {
    fill: currentColor;
}
.pin-star-btn svg {
    width: 12px !important;
    height: 12px !important;
    stroke: currentColor !important;
    stroke-width: 2.5px;
}

/* Command Helper Box */
.command-helper-box {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    z-index: 10002;
    overflow: hidden;
}
.command-helper-item {
    padding: 10px 16px;
    color: #94a3b8;
    font-size: 12.5px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
}
.command-helper-item:last-child {
    border-bottom: none;
}
.command-helper-item:hover, .command-helper-item.active {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.sidebar-item-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: #f8fafc;
    flex-shrink: 0;
}

.command-sidebar-item.active .sidebar-item-icon {
    background: #2563eb;
    color: #ffffff;
}

.sidebar-item-icon svg {
    width: 14px !important;
    height: 14px !important;
    stroke: currentColor !important;
    fill: none !important;
    stroke-width: 2px !important;
}

.sidebar-item-title {
    font-size: 13px;
    font-weight: 600;
}

.sidebar-item-badge {
    font-size: 10px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 2px 7px;
    border-radius: 20px;
}

.command-sidebar-item.active .sidebar-item-badge {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

/* Content Area */
.command-content-area {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 40px;
}

.command-pane {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.command-pane.active {
    display: grid;
    animation: slideUpFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFade {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Card */
.command-section-card {
    background: rgba(30, 41, 59, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.25s ease;
}

.command-section-card:hover {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(96, 165, 250, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #f8fafc;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 8px;
}

.card-section-title svg {
    width: 15px !important;
    height: 15px !important;
    stroke: #94a3b8;
    fill: none;
    flex-shrink: 0;
}

.card-section-title i {
    font-size: 13px;
    color: #94a3b8;
    width: 15px;
    text-align: center;
    flex-shrink: 0;
}

/* Pills list */
.command-sub-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.command-sub-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #cbd5e1 !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.command-sub-link:hover {
    background: rgba(59, 130, 246, 0.16);
    border-color: rgba(96, 165, 250, 0.4);
    color: #60a5fa !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.1);
}

.command-sub-link svg {
    width: 12px !important;
    height: 12px !important;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.command-sub-link i {
    font-size: 11px;
    flex-shrink: 0;
}

/* In Search Mode class */
.command-container.search-active .command-sidebar {
    display: none !important;
}

.command-container.search-active .command-pane {
    display: grid !important;
}

.command-container.search-active .command-pane.has-no-results {
    display: none !important;
}

/* Responsiveness */
@media (max-width: 991px) {
    .command-body {
        flex-direction: column;
        overflow-y: auto;
        height: auto;
    }
    .command-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 12px;
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
    }
    [dir="rtl"] .command-sidebar {
        border-left: none;
    }
    .command-sidebar-item {
        flex-shrink: 0;
    }
    .command-content-area {
        overflow-y: visible;
    }
}

/* Custom Widgets Styles */
.widget-premium-card {
    border-left: 4px solid #3b82f6 !important;
}

.timeline-premium {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid #e2e8f0;
    margin-left: 10px;
}

.timeline-item-premium {
    position: relative;
    margin-bottom: 16px;
}

.timeline-item-premium::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 4px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #3b82f6;
    border: 2px solid #fff;
}

/* 🌟 Fix Action Dropdowns getting cut off and squeezed inside responsive tables/cards */
.table-responsive, 
.dataTables_scrollBody {
    min-height: 220px;
}

[dir="rtl"] .dropdown-menu-right {
    right: 0 !important;
    left: auto !important;
}

.info-box:has(.open, .show),
.box:has(.open, .show),
.card:has(.open, .show),
.panel:has(.open, .show),
.tab-content:has(.open, .show),
.nav-tabs-custom:has(.open, .show),
.table-responsive:has(.open, .show) {
    overflow: visible !important;
}

/* NOTE: .dataTables_scrollBody intentionally excluded above — forcing overflow:visible
   on DataTables' internal scrollY box the instant a dropdown opens kills its scrollbar
   and lets content spill into the adjacent cloned footer (the "Total" row overlap bug).
   Action-dropdown clipping inside scrollY tables is handled in app.js instead, by
   detaching the open menu to <body> with `position: fixed` — that escapes the clipping
   without touching this container's overflow/scroll behavior at all. */

/* 🌟 Fix Info Box stretching bug and style text/content colors */
.info-box {
    height: 90px !important;
    min-height: 90px !important;
    display: flex !important;
    align-items: center !important;
}
.info-box-icon {
    height: 70px !important;
    width: 70px !important;
    flex-shrink: 0;
}
.info-box-content {
    color: #1e293b !important;
    padding: 5px 15px !important;
}
.info-box-text {
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    display: block;
    margin-bottom: 2px;
}
.info-box-number {
    color: #1e293b !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    display: block;
}

/* 🌟 Modern Dark-Slate Sidebar Theme */
.side-bar {
    background-color: #0b0f19 !important;
    border-right: 1px solid #1e2937 !important;
}

/* Sidebar Logo/Header */
.theme-logo-bg {
    background-color: #0b0f19 !important;
    border-bottom: 1px solid #1e2937 !important;
}

/* Sidebar Search bar wrapper and input */
.side-bar #sidebar-search {
    background-color: #111827 !important;
    border: 1px solid #1f2937 !important;
    color: #f3f4f6 !important;
    border-radius: 6px;
    padding: 6px 12px;
}
.side-bar #sidebar-search:focus {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
}

/* Customize Sidebar Button */
#btn-customize-sidebar {
    background-color: #111827 !important;
    border-color: #1f2937 !important;
    color: #cbd5e1 !important;
}
#btn-customize-sidebar:hover {
    color: #ffffff !important;
    background-color: #1f2937 !important;
}

/* Menu headers (Group titles in AdminLTE) */
.sidebar-menu > li.header {
    background: transparent !important;
    color: #94a3b8 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 15px 4px 15px !important;
}

/* General Link styling */
.sidebar-menu li a {
    color: #e2e8f0 !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 10px 15px 10px 15px !important;
    border-left: 3px solid transparent !important;
    transition: all 0.2s ease !important;
}

.sidebar-menu li a:hover {
    background-color: #1e293b !important;
    color: #ffffff !important;
}

.sidebar-menu li a i {
    color: #cbd5e1 !important;
    width: 20px;
    text-align: center;
    margin-right: 6px;
    transition: color 0.2s ease;
}

.sidebar-menu li a:hover i {
    color: #ffffff !important;
}

/* Active State Styles (LTR) */
.sidebar-menu li.active > a {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0) 100%) !important;
    color: #10b981 !important;
    border-left: 3px solid #10b981 !important;
}

.sidebar-menu li.active > a i {
    color: #10b981 !important;
}

/* Active State Styles (RTL) */
[dir="rtl"] .sidebar-menu li.active > a {
    border-left: none !important;
    border-right: 3px solid #10b981 !important;
    background: linear-gradient(270deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0) 100%) !important;
}

/* Submenu dropdown container styling */
.sidebar-menu .treeview-menu {
    background-color: #0e1320 !important;
    padding-left: 10px !important;
}

[dir="rtl"] .sidebar-menu .treeview-menu {
    padding-left: 0 !important;
    padding-right: 10px !important;
}

/* Submenu links */
.sidebar-menu .treeview-menu li a {
    padding: 6px 15px 6px 15px !important;
    font-size: 12px !important;
    border-left: none !important;
    border-right: none !important;
}

.sidebar-menu .treeview-menu li.active a {
    color: #10b981 !important;
    background-color: transparent !important;
}

/* Sidebar Tailwind container overrides to maintain dark-slate layout */
.side-bar div.tw-border-gray-200 {
    border-color: #1e2937 !important;
}
.side-bar div.tw-bg-gray-100 {
    background-color: #111827 !important;
    border-color: #1f2937 !important;
}
.side-bar input#sidebar-search {
    background-color: transparent !important;
    border: none !important;
}
.side-bar #sidebar-no-results {
    border-right-color: #1e2937 !important;
}

/* ══ DATATABLES BUTTONS — hide default bar, use custom buttons ══ */
.dt-buttons {
    display: none !important;
}
/* Keep DataTables search box styling */
.dataTables_filter input {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 13px;
}

/* ══ GLOBAL PRINT STYLES ════════════════════════════════ */
@media print {
    /* Hide all non-essential UI */
    .main-header,
    .main-sidebar,
    .side-bar,
    .content-header,
    .no-print,
    .hidden-print,
    .box-tools,
    .btn-group.pull-right,
    .dataTables_filter,
    .dataTables_length,
    .dataTables_paginate,
    .dataTables_info,
    nav,
    footer,
    .main-footer,
    .modal-header .close,
    .alert,
    #toast-container,
    .sidebar-toggle,
    .filters,
    .pos-tab-content .row:first-child,
    .select2-container,
    form.filters-form,
    .daterangepicker,
    .components-filters,
    .content-header,
    .breadcrumb {
        display: none !important;
    }

    /* Expand content to full width */
    .content-wrapper,
    .right-side {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    /* Box/widget without shadow */
    .box,
    .widget-box {
        box-shadow: none !important;
        border: none !important;
    }

    .box-header {
        border-bottom: 1px solid #ddd !important;
        padding-bottom: 8px !important;
        margin-bottom: 8px !important;
    }

    /* Tables — clean print style */
    table.dataTable,
    table.table {
        width: 100% !important;
        font-size: 11px !important;
        border-collapse: collapse !important;
    }

    table.dataTable th,
    table.dataTable td,
    table.table th,
    table.table td {
        border: 1px solid #aaa !important;
        padding: 4px 6px !important;
        color: #000 !important;
        background: #fff !important;
    }

    table.dataTable thead th,
    table.table thead th {
        background: #f0f0f0 !important;
        font-weight: bold !important;
    }

    /* Hide action column */
    th.not-export,
    td:first-child:has(> .btn) {
        display: none !important;
    }

    /* Avoid page break inside a row */
    tr {
        page-break-inside: avoid !important;
    }

    /* Show print_section */
    .print_section {
        display: block !important;
    }

    /* Reset text colors */
    body, p, span, td, th, label, h1, h2, h3, h4, h5, h6 {
        color: #000 !important;
    }

    /* Page setup */
    @page {
        margin: 1cm;
        size: A4 landscape;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   🏛️ LINETECO IDENTITY OVERRIDE — applies site-wide, one file, no per-page
   edits needed. Appended last on purpose: later rules win the cascade at
   equal specificity, so this section overrides the generic-blue Odoo/
   glassmorphism theme above without having to rewrite it rule-by-rule.

   Two real decisions this section encodes (validated with the user this
   session — see memory: feedback_real_erp_density_not_saas_marketing_look):
   1. Real accounting/ERP software (SAP Fiori, Odoo, Wafeq) reads as dense,
      flat, bordered panels — not glossy translucent "glassmorphism" cards
      with floaty hover-lift animation. That look belongs on a marketing
      site, not software used 8 hours a day.
   2. Financial figures get a monospaced, tabular-numeral font so digits
      align in columns — a real accounting-software convention, not a
      generic dashboard one.
   ══════════════════════════════════════════════════════════════════════ */
:root {
    --lt-navy:      #12203a;
    --lt-navy-deep: #0c1728;
    --lt-navy2:     #1c3358;
    --lt-gold:      #b8863b;
    --lt-gold-deep: #8f6526;
    --lt-gold-tint: rgba(184, 134, 59, .12);
    --lt-emerald:   #137a56;
    --lt-coral:     #c24a3c;
    /* رمادي محايد بارد بدل الكريمي الدافئ — أقرب لهوية برامج المحاسبة
       الإنتربرايز المرجعية (SAP Fiori/Odoo/QuickBooks) من هوية تطبيقات
       التدوين/التحرير. */
    --lt-line:      #dfe3e8;
    --lt-paper:     #f4f5f7;
}

/* ── 0. Page background — wire --lt-paper site-wide (it was only ever
   declared, never applied outside /home) so the whole app matches the
   cool-neutral gray confirmed on the redesigned home page, not just that
   one screen. `body` carries a Tailwind `tw-bg-gray-100` utility class
   applied inline in layouts/app.blade.php — a single-class selector, so
   this needs !important to reliably win regardless of stylesheet load
   order. content-wrapper/right-side are usually transparent over body,
   but are covered too in case a skin sets an opaque background there. ── */
body, .content-wrapper, .right-side {
    background: var(--lt-paper) !important;
}

/* ── 1. Flatten the glassmorphism card language ─────────────────────── */
.info-box, .box, .card, .panel {
    background: #ffffff !important;
    border: 1px solid var(--lt-line) !important;
    box-shadow: 0 1px 2px rgba(18, 32, 58, .06) !important;
    border-radius: 8px !important;
    transition: border-color .15s ease !important;
}
.info-box:hover, .card:hover, .box:hover {
    transform: none;
    box-shadow: 0 1px 2px rgba(18, 32, 58, .06) !important;
    border-color: var(--lt-gold) !important;
}
.widget-premium-card { border-left-color: var(--lt-navy) !important; }
.timeline-premium { border-left-color: var(--lt-line); }
.timeline-item-premium::before { background-color: var(--lt-gold); }

/* ── 2. Navy/gold replaces the generic blue accent everywhere it was used ── */
.btn-primary { background-color: var(--lt-navy) !important; }
.btn-primary:hover { background-color: var(--lt-navy-deep) !important; transform: none; }

.horizontal-menu-item.active .horizontal-menu-link,
.command-sidebar-item.active,
.horizontal-dropdown-link.active {
    background-color: var(--lt-gold-tint) !important;
    color: var(--lt-gold-deep) !important;
    box-shadow: inset 0 0 0 1px rgba(184, 134, 59, .25) !important;
}
.horizontal-menu-link:hover,
.horizontal-dropdown-link:hover {
    color: var(--lt-gold-deep) !important;
}
body.dark-mode .horizontal-menu-item.active .horizontal-menu-link,
body.dark-mode .command-sidebar-item.active {
    background-color: rgba(224, 172, 87, .16) !important;
    color: #e0ac57 !important;
    box-shadow: inset 0 0 0 1px rgba(224, 172, 87, .3) !important;
}
.app-switcher-trigger:hover { color: var(--lt-navy); border-color: var(--lt-gold); }
.sidebar-active-indicator {
    background: linear-gradient(135deg, rgba(184, 134, 59, .2), rgba(18, 32, 58, .12)) !important;
    border-color: var(--lt-gold) !important;
}
.command-sidebar-item.active .sidebar-item-icon { background: var(--lt-gold) !important; }
.command-section-card:hover {
    border-color: rgba(184, 134, 59, .3) !important;
    transform: none;
}
.command-sub-link:hover {
    background: var(--lt-gold-tint) !important;
    border-color: rgba(184, 134, 59, .35) !important;
    color: #e0ac57 !important;
    transform: none;
    box-shadow: none !important;
}
.pin-star-btn:hover, .pin-star-btn.pinned { color: var(--lt-gold) !important; }
.command-helper-item:hover, .command-helper-item.active {
    background: var(--lt-gold-tint) !important;
    color: #e0ac57 !important;
}

/* Sidebar active-item accent: was generic green, now brand gold */
.sidebar-menu li.active > a {
    background: linear-gradient(90deg, rgba(184, 134, 59, .14) 0%, rgba(184, 134, 59, 0) 100%) !important;
    color: var(--lt-gold) !important;
    border-left-color: var(--lt-gold) !important;
}
.sidebar-menu li.active > a i { color: var(--lt-gold) !important; }
[dir="rtl"] .sidebar-menu li.active > a {
    background: linear-gradient(270deg, rgba(184, 134, 59, .14) 0%, rgba(184, 134, 59, 0) 100%) !important;
    border-right-color: var(--lt-gold) !important;
}
.sidebar-menu .treeview-menu li.active a { color: var(--lt-gold) !important; }
.side-bar #sidebar-search:focus {
    border-color: var(--lt-gold) !important;
    box-shadow: 0 0 0 2px var(--lt-gold-tint) !important;
}
.theme-logo-bg, .side-bar { background-color: var(--lt-navy-deep) !important; }

/* ── 3. Real financial figures get a tabular monospace treatment ────── */
.display_currency, .info-box-number, .metric-value, .value,
.total_sell, .net, .invoice_due, .total_sell_return,
.total_purchase, .purchase_due, .total_purchase_return, .total_expense,
td.text-right, .cp-rate {
    font-family: "IBM Plex Mono", "Cairo", monospace !important;
    font-variant-numeric: tabular-nums;
}

/* ── 4. Quiet the animation — near-zero motion, not scattered hover-lifts ── */
.command-container { animation-duration: .15s !important; }
.command-pane.active { animation: none !important; }
.horizontal-dropdown { animation: none !important; }

/* ══════════════════════════════════════════════════════════
   5. DATATABLES MODERN PROCESSING LOADER (SLEEK FLOATING PILL)
   ══════════════════════════════════════════════════════════ */
div.dataTables_wrapper {
    position: relative;
}

div.dataTables_wrapper div.dataTables_processing {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    width: auto !important;
    min-width: 170px !important;
    padding: 10px 22px !important;
    background: rgba(15, 23, 42, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    border-radius: 9999px !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15) !important;
    z-index: 100 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em !important;
    /* No !important here: DataTables hides this box by setting an inline
       style="display:none" once loading finishes. !important on display
       always beats an inline style, so the box used to stay visible
       forever no matter what DataTables did — the "stuck Processing..."
       bug seen on every table, every page. */
    display: flex;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
}

div.dataTables_wrapper div.dataTables_processing::before {
    content: '' !important;
    display: inline-block !important;
    width: 16px !important;
    height: 16px !important;
    border: 2.5px solid rgba(255, 255, 255, 0.25) !important;
    border-top-color: #38bdf8 !important;
    border-radius: 50% !important;
    animation: dt-smooth-spin 0.8s linear infinite !important;
    flex-shrink: 0 !important;
}

@keyframes dt-smooth-spin {
    to { transform: rotate(360deg); }
}

body.dark-mode div.dataTables_wrapper div.dataTables_processing {
    background: rgba(30, 41, 59, 0.92) !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
    color: #f8fafc !important;
}

/* ══════════════════════════════════════════════════════════
   6. MODERN FLOATING TOASTR NOTIFICATIONS
   ══════════════════════════════════════════════════════════ */
#toast-container > div {
    border-radius: 12px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.18), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    opacity: 0.98 !important;
    padding: 14px 20px 14px 48px !important;
    font-family: inherit !important;
    font-size: 13.5px !important;
    line-height: 1.5 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

#toast-container > div:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 20px 30px -10px rgba(0, 0, 0, 0.25) !important;
}

#toast-container > div.rtl {
    padding: 14px 48px 14px 20px !important;
}

#toast-container > .toast-success {
    background-color: #059669 !important;
}

#toast-container > .toast-error {
    background-color: #dc2626 !important;
}

#toast-container > .toast-warning {
    background-color: #d97706 !important;
}

#toast-container > .toast-info {
    background-color: #0284c7 !important;
}

/* ══════════════════════════════════════════════════════════
   7. DARK MODE CONTRAST & ACCESSIBILITY FIXES (WCAG AA)
   ══════════════════════════════════════════════════════════ */
body.dark-mode {
    background-color: #0b1329 !important;
    color: #e2e8f0 !important;
}

body.dark-mode .content-wrapper,
body.dark-mode .main-footer {
    background-color: #0b1329 !important;
}

body.dark-mode label,
body.dark-mode .control-label,
body.dark-mode .form-group > label {
    color: #e2e8f0 !important;
    font-weight: 600 !important;
}

body.dark-mode .help-block,
body.dark-mode .text-muted,
body.dark-mode small {
    color: #94a3b8 !important;
}

body.dark-mode .box,
body.dark-mode .card,
body.dark-mode .panel,
body.dark-mode .info-box {
    background: #131d38 !important;
    border-color: #1e293b !important;
    color: #f1f5f9 !important;
}

body.dark-mode .box-header,
body.dark-mode .card-header {
    border-bottom: 1px solid #1e293b !important;
    color: #f8fafc !important;
}

body.dark-mode .form-control,
body.dark-mode input[type="text"],
body.dark-mode input[type="password"],
body.dark-mode input[type="email"],
body.dark-mode input[type="number"],
body.dark-mode select.form-control,
body.dark-mode textarea.form-control {
    background-color: #1a2542 !important;
    border: 1px solid #2d3d63 !important;
    color: #f8fafc !important;
}

body.dark-mode .form-control:focus {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

body.dark-mode .form-control::placeholder {
    color: #64748b !important;
}

body.dark-mode .select2-container--default .select2-selection--single,
body.dark-mode .select2-container--default .select2-selection--multiple {
    background-color: #1a2542 !important;
    border-color: #2d3d63 !important;
    color: #f8fafc !important;
}

body.dark-mode .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #f8fafc !important;
}

body.dark-mode .select2-dropdown {
    background-color: #131d38 !important;
    border-color: #2d3d63 !important;
    color: #f8fafc !important;
}

body.dark-mode .select2-results__option {
    color: #cbd5e1 !important;
}

body.dark-mode .select2-results__option--highlighted[aria-selected] {
    background-color: #2563eb !important;
    color: #ffffff !important;
}

body.dark-mode .table,
body.dark-mode table.dataTable {
    color: #e2e8f0 !important;
    border-color: #1e293b !important;
}

body.dark-mode .table > thead > tr > th,
body.dark-mode table.dataTable thead th {
    background-color: #101930 !important;
    color: #94a3b8 !important;
    border-bottom: 2px solid #1e293b !important;
    font-weight: 700 !important;
}

body.dark-mode .table > tbody > tr > td,
body.dark-mode table.dataTable tbody td {
    border-color: #1e293b !important;
    color: #cbd5e1 !important;
}

body.dark-mode .table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(255, 255, 255, 0.02) !important;
}

body.dark-mode .table-hover > tbody > tr:hover {
    background-color: rgba(56, 189, 248, 0.06) !important;
}

body.dark-mode .modal-content {
    background-color: #131d38 !important;
    color: #f1f5f9 !important;
    border: 1px solid #1e293b !important;
}

body.dark-mode .modal-header,
body.dark-mode .modal-footer {
    border-color: #1e293b !important;
}

body.dark-mode .nav-tabs-custom,
body.dark-mode .nav-tabs {
    border-color: #1e293b !important;
}

body.dark-mode .nav-tabs-custom > .nav-tabs > li > a {
    color: #94a3b8 !important;
}

body.dark-mode .nav-tabs-custom > .nav-tabs > li.active > a,
body.dark-mode .nav-tabs > li.active > a {
    background-color: #131d38 !important;
    color: #38bdf8 !important;
    border-color: #1e293b #1e293b transparent !important;
}

/* ══════════════════════════════════════════════════════════
   8. POS TOUCHSCREEN & CART USABILITY ENHANCEMENTS
   ══════════════════════════════════════════════════════════ */
.pos-form-totals-wrap {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: #ffffff;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    border-top: 1px solid #e2e8f0;
}

body.dark-mode .pos-form-totals-wrap {
    background: #131d38 !important;
    border-top-color: #1e293b !important;
}

.product_box {
    transition: transform 0.18s ease, box-shadow 0.18s ease !important;
    cursor: pointer;
    user-select: none;
}

.product_box:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 8px 16px -2px rgba(0, 0, 0, 0.1) !important;
}

.product_box:active {
    transform: scale(0.97) !important;
}

/* POS Item Added Flash Animation (Immediate visual feedback for cashier) */
@keyframes pos-item-flash {
    0% { background-color: rgba(56, 189, 248, 0.4); }
    100% { background-color: transparent; }
}

#pos_table tbody tr:first-child {
    animation: pos-item-flash 0.9s ease-out;
}

/* POS Table Quantity and Price Inputs */
#pos_table .pos_quantity,
#pos_table .pos_unit_price {
    font-weight: 700 !important;
    font-size: 14px !important;
    border-radius: 6px !important;
}

/* Modern POS Fullscreen Button Highlight */
#full_screen:hover {
    border-color: #646EE4 !important;
    color: #646EE4 !important;
    box-shadow: 0 0 10px rgba(100, 110, 228, 0.3) !important;
}

/* ══════════════════════════════════════════════════════════
   9. PRODUCT THUMBNAIL HOVER ZOOM (LIGHTBOX EFFECT)
   ══════════════════════════════════════════════════════════ */
.product-thumbnail-small {
    width: 44px !important;
    height: 44px !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04) !important;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.28s ease, z-index 0s !important;
    cursor: zoom-in !important;
    position: relative !important;
}

.product-thumbnail-small:hover {
    transform: scale(3.4) !important;
    z-index: 99999 !important;
    box-shadow: 0 20px 30px -5px rgba(0, 0, 0, 0.35), 0 0 0 2px #ffffff !important;
    background: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════
   10. DATATABLES ACTIONS DROPDOWN OVERFLOW & VISIBILITY FIX
   ══════════════════════════════════════════════════════════ */
.table-responsive {
    overflow: visible !important;
}

@media (max-width: 991px) {
    .table-responsive {
        overflow-x: auto !important;
    }
}

table.dataTable td .btn-group.open .dropdown-menu {
    z-index: 1050 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.2), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    border-radius: 10px !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    padding: 6px !important;
    min-width: 170px !important;
}

table.dataTable td .btn-group.open .dropdown-menu li > a {
    padding: 8px 14px !important;
    border-radius: 6px !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: background-color 0.15s ease, color 0.15s ease !important;
}

table.dataTable td .btn-group.open .dropdown-menu li > a:hover {
    background-color: #f1f5f9 !important;
    color: #0f172a !important;
}

body.dark-mode table.dataTable td .btn-group.open .dropdown-menu {
    background: #1e293b !important;
    border-color: #334155 !important;
}

body.dark-mode table.dataTable td .btn-group.open .dropdown-menu li > a {
    color: #e2e8f0 !important;
}

body.dark-mode table.dataTable td .btn-group.open .dropdown-menu li > a:hover {
    background-color: #334155 !important;
    color: #ffffff !important;
}

/* ══════════════════════════════════════════════════════════
   11. POS STREAMLINED LAYOUT & COMPACT HEADER SUMMARY
   ══════════════════════════════════════════════════════════ */
.pos-toolbar,
.pos-stats-bar {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
    border: none !important;
}

.pos-header-summary-pill {
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.dark-mode .pos-header-summary-pill {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}

.pos-header-summary-pill .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
}

.pos-header-summary-pill .stat-divider {
    width: 1px;
    height: 16px;
    background: #cbd5e1;
}

body.dark-mode .pos-header-summary-pill .stat-divider {
    background: #475569;
}

/* ══════════════════════════════════════════════════════════
   12. UNIVERSAL SEARCH BUTTON POS INTEGRATION
   ══════════════════════════════════════════════════════════ */
body.pos-page #mobile_search_btn,
body:has(.pos-form-actions) #mobile_search_btn {
    bottom: 68px !important;
    right: 20px !important;
    z-index: 1045 !important;
}

@media (min-width: 992px) {
    body.pos-page #mobile_search_btn,
    body:has(.pos-form-actions) #mobile_search_btn {
        display: none !important;
    }
}

