/* ==========================================================================
   Modern UI Implementation (Radical Overhaul)
   Using CSS Variables from variables.css
   ========================================================================== */

/* 1. Global Reset & Typography */
body {
    background-color: var(--bg-body);
    /* Mesh Gradient for Glass Effect visibility */
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    /* Light mode override in :root or separate block if needed, assuming dark/deep theme based on user request for "premium" */
    /* Let's stick to a safe light mesh for the default light theme, and deep for dark */
    background-attachment: fixed;

    color: var(--text-primary);
    font-family: var(--font-primary);
    transition: background-color var(--duration-normal), color var(--duration-normal);
    overflow-x: hidden;
    /* Prevent horizontal scroll */
    padding-top: 60px;
    /* Space for fixed navbar */
}

[data-bs-theme="light"] body {
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 40%, 85%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 40%, 88%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 45%, 88%, 1) 0, transparent 50%);
    background-attachment: fixed;
}

a {
    text-decoration: none;
    transition: color var(--duration-fast);
}

/* 2. Glassmorphism Core */
.glass,
.navbar,
.card,
.modal-content,
.dropdown-menu,
.hero-card,
.quick-stat-card {
    background: var(--bg-surface);
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
}

[data-bs-theme="dark"] .glass,
[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu {
    background: rgba(22, 28, 36, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* 3. Navbar Styling (Floating Glass) */
.navbar {
    background: rgba(255, 255, 255, 0.7) !important;
    /* Specific glass for navbar */
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    margin-bottom: 2rem;
    z-index: 1030;
}

/* Fix: Ensure all nav items (including dropdowns) are aligned on same baseline */
.navbar-nav {
    align-items: center;
}

.navbar-nav .nav-item {
    display: flex;
    align-items: center;
}

.navbar-nav .nav-item.dropdown {
    position: relative;
}

.navbar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
}

[data-bs-theme="dark"] .navbar {
    background: rgba(15, 23, 42, 0.7) !important;
}

.navbar-brand {
    color: var(--primary-color) !important;
    font-weight: 800;
    font-size: 1.5rem;
}

/* Mobile Navbar - White Glass Effect */
@media (max-width: 991.98px) {
    .navbar {
        background: rgba(255, 255, 255, 0.95) !important;
        /* High opacity white glass */
        backdrop-filter: blur(12px) !important;
        -webkit-backdrop-filter: blur(12px) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        padding-bottom: 0.5rem;
    }

    /* Ensure the collapsed menu also has a background */
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
        padding: 1rem;
        margin-top: 0.5rem;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }

    [data-bs-theme="dark"] .navbar {
        background: rgba(15, 23, 42, 0.95) !important;
        /* High opacity dark glass */
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    [data-bs-theme="dark"] .navbar-collapse {
        background: rgba(15, 23, 42, 0.95);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }
}

/* Modern Button Styles - Standardized & Pastel */
.btn {
    font-weight: 500;
    transition: all var(--duration-fast);
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.action-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    width: 36px;
    /* Fixed square size for icon buttons */
    height: 36px;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--duration-fast);
    cursor: pointer;
    font-size: 1rem;
}

.action-btn:hover {
    background: var(--bg-surface-secondary);
    color: var(--primary);
    transform: translateY(-1px);
}

/* Pastel Button Variants - Soft Backgrounds, Dark Text */
.action-btn.primary {
    background: hsl(var(--primary-h), var(--primary-s), 90%);
    color: hsl(var(--primary-h), var(--primary-s), 30%);
}

.action-btn.primary:hover {
    background: hsl(var(--primary-h), var(--primary-s), 85%);
    color: hsl(var(--primary-h), var(--primary-s), 20%);
}

.action-btn.success {
    background: hsl(var(--success-h), var(--success-s), 90%);
    color: hsl(var(--success-h), var(--success-s), 30%);
}

.action-btn.success:hover {
    background: hsl(var(--success-h), var(--success-s), 85%);
    color: hsl(var(--success-h), var(--success-s), 20%);
}

.action-btn.warning {
    background: hsl(var(--warning-h), var(--warning-s), 90%);
    color: hsl(var(--warning-h), var(--warning-s), 30%);
}

.action-btn.warning:hover {
    background: hsl(var(--warning-h), var(--warning-s), 85%);
    color: hsl(var(--warning-h), var(--warning-s), 20%);
}

.action-btn.danger {
    background: hsl(var(--danger-h), var(--danger-s), 90%);
    color: hsl(var(--danger-h), var(--danger-s), 30%);
}

.action-btn.danger:hover {
    background: hsl(var(--danger-h), var(--danger-s), 85%);
    color: hsl(var(--danger-h), var(--danger-s), 20%);
}

.customer-status.blocked {
    background: hsla(var(--danger-h), var(--danger-s), 90%, 1);
    color: hsl(var(--danger-h), var(--danger-s), 35%);
    border: 1px solid hsla(var(--danger-h), var(--danger-s), 80%, 1);
}

/* Blocked Customer Card Styling */
.customer-blocked {
    background-color: hsla(var(--danger-h), var(--danger-s), 94%, 0.95) !important;
    border: 1px solid hsla(var(--danger-h), var(--danger-s), 85%, 1) !important;
    box-shadow: 0 4px 6px -1px hsla(var(--danger-h), var(--danger-s), 80%, 0.15),
        0 2px 4px -1px hsla(var(--danger-h), var(--danger-s), 80%, 0.1) !important;
}

/* Dark mode adjustment for blocked card */
[data-theme="dark"] .customer-blocked {
    background-color: hsla(var(--danger-h), var(--danger-s), 15%, 0.5) !important;
    border-color: hsla(var(--danger-h), var(--danger-s), 25%, 0.6) !important;
}

/* Blocked Customer Table Row */
.customer-blocked-row {
    background-color: hsla(var(--danger-h), var(--danger-s), 94%, 0.85) !important;
}

.customer-blocked-row:hover {
    background-color: hsla(var(--danger-h), var(--danger-s), 90%, 0.95) !important;
}

[data-theme="dark"] .customer-blocked-row {
    background-color: hsla(var(--danger-h), var(--danger-s), 15%, 0.4) !important;
}

[data-theme="dark"] .customer-blocked-row:hover {
    background-color: hsla(var(--danger-h), var(--danger-s), 20%, 0.5) !important;
}

.action-btn.info {
    background: hsl(var(--info-h), var(--info-s), 90%);
    color: hsl(var(--info-h), var(--info-s), 30%);
}

.action-btn.info:hover {
    background: hsl(var(--info-h), var(--info-s), 85%);
    color: hsl(var(--info-h), var(--info-s), 20%);
}

.action-btn.purple {
    background: hsl(270, 70%, 92%);
    color: hsl(270, 70%, 30%);
}

.action-btn.purple:hover {
    background: hsl(270, 70%, 85%);
    color: hsl(270, 70%, 20%);
}


/* Button Group Alignment */
.btn-group-custom {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 600;
    padding: 0.6rem 1rem !important;
    border-radius: var(--radius-md);
    margin: 0 0.2rem;
    transition: all var(--duration-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
    background-color: var(--primary-subtle);
    transform: translateY(-1px);
}

/* 4. Cards (Containers) */
/* Filter Cards & Inputs */
.filter-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    height: 100%;
    transition: all var(--duration-normal);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.filter-card:hover {
    border-color: var(--primary-glass);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.filter-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    display: block;
    color: var(--text-muted);
}

.form-control-filter {
    background-color: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 0.6rem 1rem;
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
    /* RTL aware usually, but let's stick to standard flow */
    font-size: 0.95rem;
}

/* RTL adjustment for inputs group */
[dir="rtl"] .form-control-filter {
    border-radius: 0 var(--radius-md) var(--radius-md) 0 !important;
}

.form-control-filter:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--primary-subtle);
}

.filter-btn {
    border-radius: var(--radius-md) 0 0 var(--radius-md) !important;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.orders-stats {
    background: var(--bg-surface);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.total-badge {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* Status Filter Pills */
.status-filters {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    scrollbar-width: none;
    /* Hide scrollbar Firefox */
}

.status-filters::-webkit-scrollbar {
    display: none;
    /* Hide scrollbar Chrome/Safari */
}

.status-filter-btn {
    border: 1px solid var(--border-color);
    background: var(--bg-body);
    color: var(--text-secondary);
    border-radius: 50rem;
    /* Pill shape */
    padding: 0.5rem 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--duration-fast);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.status-filter-btn:hover {
    background: var(--bg-surface-secondary);
    border-color: var(--border-color-dark);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.status-filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.3);
}

.status-filter-btn .badge {
    background: rgba(255, 255, 255, 0.2) !important;
    color: inherit !important;
    font-weight: 700;
}

/* Specific Colors for Active States if needed, or stick to primary for uniform look */



.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-glass);
}

.card-header {
    background-color: #f8f9fa;
    /* Light gray in Light Mode */
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
}

[data-bs-theme="dark"] .card-header {
    background-color: rgba(30, 41, 59, 0.8);
    /* Dark gray in Dark Mode - matching site theme */
}

/* Light mode explicit styling */
[data-bs-theme="light"] .card-header {
    background-color: #f8f9fa;
    color: #212529;
}

.card-body {
    padding: 1.5rem;
}

/* Light mode card body fix */
[data-bs-theme="light"] .card-body {
    background-color: #ffffff;
    color: #212529;
}

/* Dark mode bg-secondary fix for tracking orders */
[data-bs-theme="dark"] .bg-secondary {
    background-color: #2d3748 !important;
    /* Darker grey for tracking status */
}

[data-bs-theme="dark"] .order-header.bg-secondary {
    background-color: #374151 !important;
    /* Slightly lighter for order headers to be distinguishable */
    border-color: rgba(255, 255, 255, 0.1) !important;
    border-left: 5px solid #6b7280 !important;
}

/* Light mode order-header.bg-secondary */
.order-header.bg-secondary {
    border-left: 5px solid #6b7280;
}

/* 5. Buttons (Gradient & soft) */
.btn {
    border-radius: var(--radius-md);
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    transition: all var(--duration-fast) var(--ease-out);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 6px -1px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.3);
}

.btn-primary:hover {
    box-shadow: 0 8px 12px -3px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-surface-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-surface-tertiary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* 6. Notifications (UI Part) - Positioning fixed via JS */
.dropdown-menu {
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-xl);
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

.notification-item {
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--duration-fast);
}

.notification-item:hover {
    background-color: var(--bg-surface-secondary);
}

/* 7. Forms (Modern & Minimal) */
.form-control,
.form-select,
.ts-control {
    background-color: var(--bg-surface-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all var(--duration-fast);
    box-shadow: var(--shadow-xs);
}

.form-control:focus,
.form-select:focus,
.ts-control.focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-glass);
    background-color: var(--bg-surface);
}

/* 8. Tables (Floating Rows) */
.table-responsive {
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table {
    --bs-table-bg: transparent;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    /* Space between rows */
}

.table thead th {
    background-color: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
    padding: 0 1rem;
}

.table tbody tr {
    background-color: var(--bg-surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-fast), box-shadow var(--duration-fast);
    border-radius: var(--radius-md);
    /* Requires specific TD styling to work */
}

.table tbody tr:hover {
    transform: scale(1.005);
    box-shadow: var(--shadow-md);
    z-index: 10;
    position: relative;
}

.table td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

/* First and Last cells rounded corners for floating effect */
.table tbody td:first-child {
    border-top-right-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.table tbody td:last-child {
    border-top-left-radius: var(--radius-md);
    border-bottom-left-radius: var(--radius-md);
}

/* 9. Status Badges (Pills) */
.badge {
    padding: 0.4em 0.8em;
    font-weight: 600;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    letter-spacing: 0.02em;
}

.bg-success,
.badge-delivered {
    background-color: var(--success-bg) !important;
    color: var(--success-text) !important;
}

.bg-warning,
.badge-warning {
    background-color: var(--warning-bg) !important;
    color: var(--warning-text) !important;
}

.bg-danger,
.badge-danger {
    background-color: var(--danger-bg) !important;
    color: var(--danger-text) !important;
}

.bg-info,
.badge-info {
    background-color: var(--info-bg) !important;
    color: var(--info-text) !important;
}

.bg-secondary,
.badge-secondary {
    background-color: var(--neutral-bg) !important;
    color: var(--neutral-text) !important;
}

/* 10. Modals (Glass Center) */
.modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
}

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

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

.modal-backdrop.show {
    opacity: 0.7;
    /* Darker backdrop for focus */
    backdrop-filter: blur(4px);
}

.modal-body-scrollable {
    max-height: 65vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    /* Avoid scrollbar overlap content */
}

/* Scrollbar styling for modal body */
.modal-body-scrollable::-webkit-scrollbar {
    width: 6px;
}

.modal-body-scrollable::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body-scrollable::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

.modal-sticky-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    backdrop-filter: blur(12px);
    /* Maintain glass effect */
}

/* 11. Order Specific Styles */
.orders-container {
    padding: 2rem !important;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.order-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
    overflow: hidden;
    transition: transform var(--duration-fast);
}

.order-card:hover {
    box-shadow: var(--shadow-md);
}

.order-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-left: 4px solid transparent;
}

/* Status Semantics using Pastel Colors */
.status-new {
    border-left-color: var(--primary-color);
    background: linear-gradient(to right, var(--primary-subtle), transparent);
}

.status-waiting {
    border-left-color: var(--warning-text);
    background: linear-gradient(to right, var(--warning-bg), transparent);
}

.status-audited {
    border-left-color: var(--success-text);
    background: linear-gradient(to right, var(--success-bg), transparent);
}

.status-canceled {
    border-left-color: var(--danger-text);
    background: linear-gradient(to right, var(--danger-bg), transparent);
    opacity: 0.8;
}

.purple {
    /* Hold - Using Info/Secondary mix */
    border-left-color: #8B5CF6;
    background: linear-gradient(to right, #F3F0FF, transparent);
}

.filter-card {
    background: var(--bg-surface);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.filter-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* 12. Product Card Variants - Explicit Pastels */
.card-danger {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), #fee2e2) !important;
    border: 1px solid #fecaca !important;
}

.card-danger .card-header {
    background-color: rgba(239, 68, 68, 0.1) !important;
    color: #991b1b !important;
    border-bottom: 1px solid #fecaca !important;
}

.card-warning {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), #fef3c7) !important;
    border: 1px solid #fde68a !important;
}

.card-warning .card-header {
    background-color: rgba(245, 158, 11, 0.1) !important;
    color: #92400e !important;
    border-bottom: 1px solid #fde68a !important;
}

.card-success {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), #d1fae5) !important;
    border: 1px solid #a7f3d0 !important;
}

.card-success .card-header {
    background-color: rgba(16, 185, 129, 0.1) !important;
    color: #065f46 !important;
    border-bottom: 1px solid #a7f3d0 !important;
}

/* 13. Custom Role Hierarchy Tree */
.role-tree {
    list-style: none;
    padding-left: 20px;
    position: relative;
    margin-top: 10px;
}

.role-tree-item {
    margin: 10px 0;
    position: relative;
}

/* Connecting Lines */
.role-tree-item::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -20px;
    border-left: 2px solid var(--border-color);
    border-bottom: 2px solid var(--border-color);
    width: 20px;
    height: 30px;
    border-radius: 0 0 0 10px;
}

.role-tree>.role-tree-item::before {
    display: none;
    /* Hide for root */
}

/* Node/Card Style */
.role-node-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 15px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all var(--duration-fast);
    box-shadow: var(--shadow-sm);
    min-width: 200px;
}

.role-node-content:hover {
    transform: translateX(5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.role-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-subtle);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 11. Redesigned Order Card (Vertical Stack) */
.order-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Ensure rounded corners */
}

.order-header {
    background: var(--bg-surface);
    /* Pastel default */
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Stacked Sections with "Glass Layer" Depth */
.order-section {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--duration-fast);
}

.order-section:last-child {
    border-bottom: none;
}

.customer-section {
    background-color: var(--bg-glass-layer-1);
}

.details-section {
    background-color: var(--bg-glass-layer-2);
}

.staff-section {
    background-color: var(--bg-glass-layer-3);
}

.order-action-panel {
    background-color: var(--bg-action-panel);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
}

/* Internal Layouts for Sections */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.order-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.order-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.order-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

/* =========================================
   MIGRATED STYLES FOR CORE FUNCTIONALITY
   ========================================= */

/* --- Notification System --- */
#notification-list {
    max-height: 70vh;
    overflow-y: auto;
    width: 300px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0;
    margin: 0;
    border: none;
    direction: rtl;
    background: var(--bg-surface);
}

[data-theme="dark"] #notification-list {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

#notification-list .dropdown-header {
    background: linear-gradient(135deg, hsl(var(--primary-h), var(--primary-s), 60%), hsl(var(--primary-h), var(--primary-s), 50%));
    color: white;
    font-weight: bold;
    padding: 1rem;
    font-size: 1rem;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    text-align: center;
}

#clear-all-notifications {
    color: var(--danger);
    font-weight: 500;
    text-align: center;
    padding: 0.75rem;
    transition: all var(--duration-fast);
    cursor: pointer;
    font-size: 0.9rem;
}

#clear-all-notifications:hover {
    background-color: rgba(var(--danger-rgb), 0.1);
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    transition: background-color var(--duration-fast);
    cursor: pointer;
    display: block;
    color: var(--text-primary);
}

.notification-item:hover {
    background-color: var(--bg-surface-secondary);
}

.notification-item.unread {
    background-color: rgba(var(--primary-rgb), 0.05);
    border-right: 3px solid var(--primary);
}

.notification-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.notification-actions {
    display: flex;
    gap: 0.5rem;
}

.notification-dismiss {
    color: var(--danger);
    cursor: pointer;
}


/* --- End Day Banner --- */
.end-day-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    opacity: 0.95;
    background: linear-gradient(135deg, var(--danger), #c82333);
    color: white;
    z-index: 9999;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.5s ease-out;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    gap: 1rem;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .banner-content {
        flex-direction: row;
        /* Keep row to save vertical space if possible, or compact col */
        gap: 0.5rem;
        padding: 0.25rem 0.5rem;
        /* Much smaller padding */
        font-size: 0.85rem;
        /* Smaller font */
        justify-content: space-between;
    }

    .banner-content h4 {
        margin: 0;
        font-size: 0.9rem;
    }

    .banner-content .btn {
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Padding for body when banner is present */
body.has-end-day-banner {
    padding-bottom: 80px;
}

@media (max-width: 768px) {
    body.has-end-day-banner {
        padding-bottom: 120px;
    }
}

/* Ensure Navbar Spacer has default height to prevent overlap before JS loads */
.navbar-spacer {
    display: block;
    height: var(--navbar-height, 76px);
    /* Default fallback */
    width: 100%;
}



/* --- Print Styles --- */
@media print {

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
    }

    .d-print-none,
    .navbar,
    .navbar-spacer,
    .btn,
    button,
    #sizer {
        display: none !important;
    }

    .container,
    .container-fluid {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .bill {
        width: 100%;
        height: 33vh;
        border-bottom: 2px dashed #000;
        padding: 5mm;
        page-break-inside: avoid;
    }
}


/* --- TomSelect / Modal Fixes --- */
.ts-dropdown {
    z-index: 9999 !important;
}

.modal .ts-dropdown {
    z-index: 99999 !important;
}

/* =========================================
   MIGRATED CORE LAYOUT (from style.css)
   ========================================= */

/* --- Navbar & Spacing --- */
:root {
    --navbar-height: 70px;
    --navbar-height-mobile: 60px;
}

.navbar-spacer {
    height: var(--navbar-height);
    transition: height var(--duration-normal);
}

body.navbar-hidden .navbar-spacer {
    height: 0;
}

.navbar.fixed-top {
    height: var(--navbar-height);
    transition: all var(--duration-normal);
    background: transparent !important;
    z-index: 1030;
}

.navbar.fixed-top.navbar-scrolled {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .navbar.fixed-top.navbar-scrolled {
    background: rgba(0, 0, 0, 0.85) !important;
    border-bottom: 1px solid var(--border-color);
}

.navbar.fixed-top.navbar-scrolled .navbar-nav .nav-link,
.navbar.fixed-top.navbar-scrolled .navbar-brand {
    color: var(--text-primary) !important;
}

/* --- Tooltips --- */
.tooltip .tooltip-inner {
    background: var(--primary) !important;
    color: white !important;
    border-radius: var(--radius-md) !important;
    padding: 0.5rem 1rem !important;
    box-shadow: var(--shadow-md) !important;
}

.tooltip .tooltip-arrow {
    --bs-tooltip-bg: var(--primary) !important;
}

/* --- Flash Messages Container --- */
.flash-messages-container {
    top: calc(var(--navbar-height) + 10px);
    transition: top var(--duration-normal);
}

body.navbar-hidden .flash-messages-container {
    top: 10px;
}

/* --- Print Styles --- */

/* Visual style for printed orders on screen */
.printed {
    background-color: #e8f5e9 !important;
    /* Light green background */
    border: 2px solid #28a745 !important;
    /* Green border */
    position: relative;
    opacity: 0.4;
    /* Slightly faded */
}

.printed::after {
    content: "تم الطباعة";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-15deg);
    background-color: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 10px 30px;
    border-radius: 5px;
    font-size: 50px;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
    border: 2px solid white;
}

/* ========================================
   Complaint Section Styles
   ======================================== */

.complaint-section {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1), rgba(220, 53, 69, 0.05));
    border: 2px solid var(--bs-danger, #dc3545);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
}

.complaint-section .complaint-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(220, 53, 69, 0.3);
}

.complaint-section .section-title {
    margin: 0;
    font-weight: 600;
}

/* Important Alerts - Prominent Red Style */
.important-alert {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
    animation: pulse-alert 2s infinite;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

@keyframes pulse-alert {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.01);
    }
}

.important-alert i {
    font-size: 1.5rem;
    margin-left: 10px;
}

/* Regular Complaint Notes */
.complaint-notes {
    margin-top: 10px;
}

.complaint-note-card {
    background: var(--glass-background, rgba(255, 255, 255, 0.1));
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-right: 4px solid var(--bs-warning, #ffc107);
}

.complaint-note-card p {
    margin-bottom: 5px;
}

/* Allowed Users Section */
.allowed-users-section {
    margin-top: 15px;
    padding: 10px;
    background: rgba(13, 202, 240, 0.1);
    border-radius: 8px;
}

.allowed-users-section h6 {
    margin-bottom: 10px;
    color: var(--bs-info, #0dcaf0);
}

/* Complaint Actions */
.complaint-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Customer Card with Complaint Status */
.customer-main-card.customer-complaint {
    border-color: var(--bs-warning, #ffc107) !important;
}

.customer-main-card.customer-restricted {
    border-color: var(--bs-info, #0dcaf0) !important;
}

@media print {

    html,
    body {
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box;
    }

    .d-print-none,
    .navbar,
    .navbar-spacer,
    .btn,
    button,
    #sizer,
    .flash-messages-container {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        font-size: 12pt;
        /* Reduced from 12pt */
        line-height: 1.4;
        /* Tightened line height */
        margin: 0 !important;
        padding: 0 !important;
    }

    .container,
    .container-fluid {
        margin: 0 !important;
        padding: 2px !important;
        max-width: 100% !important;
        /* Full width */
    }

    body>*:first-child,
    .container>*:first-child,
    body>div:first-of-type {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .page {
        page-break-after: always !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .bill {
        height: 33% !important;
        overflow: hidden !important;
        border-bottom: 2px solid #000;
        padding: 10px !important;
        /* Drastically reduced padding */
        margin: 0 !important;
        height: calc(100vh / 3) !important;
    }



    .bill table {
        margin-bottom: 10px !important;
        border-collapse: collapse;
        border-spacing: 2px;
        border-color: gray;
    }

    .bill .table th,
    .bill .table td {
        padding: 4px 6px !important;
        border-bottom: 1px dashed gray !important;
        font-size: 11pt !important;

        /* Very tight table cells */
    }

    @page {
        size: A4 portrait !important;
        margin: 5mm;
        /* Reduced standard margin */
    }

    .bill * {
        page-break-inside: avoid;
    }

    * {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* =========================================
   MIGRATED MODULE: DASHBOARD (from dashboard.css)
   ========================================= */

/* Dashboard Container */
.dashboard-container {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    color: white;
}

h2 {
    box-shadow: 0 10px 30px -10px rgba(var(--primary-rgb), 0.4);
}

.dashboard-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.last-update {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Quick Stats */
.quick-stats {
    margin-bottom: 30px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.quick-stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--duration-normal);
    border-left: 5px solid;
}

[data-theme="dark"] .quick-stat-card {
    background: var(--bg-surface);
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.quick-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.quick-stat-card.new {
    border-left-color: var(--primary);
}

.quick-stat-card.processing {
    border-left-color: var(--warning);
}

.quick-stat-card.completed {
    border-left-color: var(--success);
}

.quick-stat-card.revenue {
    border-left-color: var(--info);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.quick-stat-card.new .stat-icon {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.quick-stat-card.processing .stat-icon {
    background: linear-gradient(135deg, var(--warning), #e0a800);
}

.quick-stat-card.completed .stat-icon {
    background: linear-gradient(135deg, var(--danger), #C75773);
}

/* Note: Original was red/pink for completed? keeping original intent but using var */
.quick-stat-card.revenue .stat-icon {
    background: linear-gradient(135deg, var(--success), #4FB36D);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.stat-title {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Charts & Activity Base */
.charts-section,
.recent-activity {
    margin-bottom: 30px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

[data-theme="dark"] .charts-section,
[data-theme="dark"] .recent-activity {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    box-shadow: none;
}

.chart-header,
.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-surface-secondary);
    border-bottom: 1px solid var(--border-color);
}

.chart-title,
.activity-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.chart-body {
    padding: 20px;
    height: 400px;
    position: relative;
}

.activity-list {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.9rem;
}

.activity-icon.new_order {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.activity-icon.order_completed {
    background: linear-gradient(135deg, var(--success), #1e7e34);
}

.activity-icon.order_cancelled {
    background: linear-gradient(135deg, var(--danger), #c82333);
}

.activity-icon.status_changed {
    background: linear-gradient(135deg, var(--warning), #e0a800);
}

.activity-text {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive Dashboard */
@media (max-width: 768px) {

    .dashboard-header,
    .chart-header,
    .activity-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   MIGRATED MODULE: ORDERS (from orders.css)
   ========================================= */

/* Header & Filters */
.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin-bottom: 30px; */
    padding: 10px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    /* color: white; */
}

.page-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.orders-stats .total-badge {
    /* background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px; */
    border-radius: 25px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

/* Filters Section */
.filters-section {
    background: var(--bg-surface);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
}

[data-theme="dark"] .filters-section {
    box-shadow: none;
    border: 1px solid var(--border-color);
}

.filter-card {
    background: var(--bg-surface-secondary);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.filter-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Status Filter Buttons */
.status-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.status-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--duration-fast);
    border: 2px solid transparent;
}

.status-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    color: inherit;
}

.status-btn.active {
    border-color: white;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Status Colors (Mapped to Vars) */
.status-btn.all {
    background: var(--secondary);
    color: white;
}

.status-btn.new {
    background: var(--primary);
    color: white;
}

.status-btn.audited {
    background: var(--success);
    color: white;
}

.status-btn.waiting {
    background: var(--warning);
    color: var(--dark);
}

.status-btn.canceled {
    background: var(--danger);
    color: white;
}

.status-btn.processing {
    background: var(--info);
    color: white;
}

.status-btn.blocked {
    background: #6f42c1;
    color: white;
}

/* Purple doesnt have var yet */
.status-btn.btnin {
    background: linear-gradient(135deg, #9B2A53, #C7579A);
    color: white;
}

.status-btn.btnout {
    background: linear-gradient(135deg, #2A4C9B, #57A7C7);
    color: white;
}

/* Neutral status button - for inactive/non-selected filters */
.status-btn.neutral {
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.status-btn.neutral:hover {
    background: var(--bg-surface);
    border-color: var(--primary);
}

/* Dark mode fixes for status buttons */
[data-bs-theme="dark"] .status-btn.neutral {
    background: rgba(55, 65, 81, 0.8);
    color: #e5e7eb;
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .status-btn.neutral:hover {
    background: rgba(75, 85, 99, 0.9);
}

[data-bs-theme="dark"] .status-btn.waiting {
    background: #92400e;
    color: #fef3c7;
}

[data-bs-theme="dark"] .status-btn.audited {
    background: #065f46;
    color: #d1fae5;
}

[data-bs-theme="dark"] .status-btn.new {
    background: #1e40af;
    color: #dbeafe;
}

/* Important note alert styling */
.important-note-alert {
    background-color: #dc3545 !important;
    color: white !important;
    border: none !important;
}

.important-note-meta {
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .important-note-alert {
    background-color: #7f1d1d !important;
}

[data-bs-theme="dark"] .important-note-meta {
    color: rgba(255, 255, 255, 0.6);
}

/* Status Timeline (For Order Details) */
.status-timeline {
    position: relative;
    padding-left: 30px;
}

.timeline-item {
    position: relative;
    padding-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -23px;
    top: 8px;
    bottom: -12px;
    width: 2px;
    background: var(--border-color);
}

.timeline-item:last-child::before {
    display: none;
}

.timeline-marker {
    position: absolute;
    left: -30px;
    top: 5px;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-surface);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-content {
    background: var(--bg-surface);
    padding: 5px 10px;
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary);
}

.timeline-status {
    font-weight: 300;
    color: var(--text-secondary);
}

.timeline-meta {
    display: flex;
    gap: 15px;
    margin-top: 5px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* =========================================
   REFACTORED ORDER HEADERS (New Pastel Design)
   ========================================= */

/* Base Header Style */
.order-header {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--duration-normal);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-surface);
    /* Default fallback */
}

/* Hover Effect */
.order-header:hover {
    background: var(--bg-surface-secondary);
    padding-left: 25px;
    /* Slight slide effect */
}

/* 1. Status: New (Default / Blue-ish) */
.order-header.status-new {
    background: linear-gradient(to right, var(--info-bg), var(--info-border));
    border-left: 5px solid var(--info-text);
}

.order-header.status-new i,
.order-header.status-new .fw-bold {
    color: var(--info-text);
}

/* 2. Status: Waiting (Orange/Warning) */
.order-header.status-waiting {
    background: linear-gradient(to right, var(--warning-bg), var(--warning-border));
    border-left: 5px solid var(--warning-text);
}

.order-header.status-waiting i,
.order-header.status-waiting .fw-bold {
    color: var(--warning-text);
}

/* 3. Missing Order Card Layout */
.order-card {
    background: var(--bg-surface);
}

.order-section {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--duration-fast);
}

.order-section:last-child {
    border-bottom: none;
}

/* Layered depth effect for sections */
.order-section.customer-section {
    background: var(--bg-surface-secondary);
}

.order-section.details-section {
    background: var(--bg-surface);
}

.order-section.staff-section {
    background: rgba(var(--primary-rgb), 0.02);
}

/* Action Panel similar to btn-group-custom */
.order-action-panel {
    background: var(--bg-surface-secondary);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
}

/* 3. Status: Audited (Green/Success) */
.order-header.status-audited {
    background: linear-gradient(to right, var(--success-bg), var(--success-border));
    border-left: 5px solid var(--success-text);
}

.order-header.status-audited i,
.order-header.status-audited .fw-bold {
    color: var(--success-text);
}

/* 4. Status: Canceled (Red/Danger) */
.order-header.status-canceled {
    background: linear-gradient(to right, var(--danger-bg), var(--danger-border));
    border-left: 5px solid var(--danger-text);
}

.order-header.status-canceled i,
.order-header.status-canceled .fw-bold {
    color: var(--danger-text);
}

/* 5. Status: Purple (Hold/Special) */
.order-header.purple {
    background: linear-gradient(to right, rgba(168, 85, 247, 0.15), rgba(147, 51, 234, 0.25));
    border-left: 5px solid #9333ea;
}

.order-header.purple i,
.order-header.purple .fw-bold {
    color: #9333ea;
}

/* 6. Status: Followed (Gray) */
.order-header.followed {
    background: linear-gradient(to right, #f3f4f6, #e5e7eb);
    border-left: 5px solid #6b7280;
}

.order-header.followed i,
.order-header.followed .fw-bold {
    color: #6b7280;
}

/* Expanded State - Add subtle glow */
.order-header[aria-expanded="true"] {
    background: var(--bg-surface-tertiary);
    box-shadow: inset 0 -2px 5px rgba(0, 0, 0, 0.05);
}

/* Dark Mode Overrides */
[data-theme="dark"] .order-header.status-new {
    background: linear-gradient(to right, var(--bg-surface), var(--info-bg));
    border-left-color: var(--info-text);
}

[data-theme="dark"] .order-header.status-new i,
[data-theme="dark"] .order-header.status-new .fw-bold {
    color: var(--info-text);
}

[data-theme="dark"] .order-header.status-waiting {
    background: linear-gradient(to right, var(--bg-surface), var(--warning-bg));
    border-left-color: var(--warning-text);
}

[data-theme="dark"] .order-header.status-waiting i,
[data-theme="dark"] .order-header.status-waiting .fw-bold {
    color: var(--warning-text);
}

[data-theme="dark"] .order-header.status-audited {
    background: linear-gradient(to right, var(--bg-surface), var(--success-bg));
    border-left-color: var(--success-text);
}

[data-theme="dark"] .order-header.status-audited i,
[data-theme="dark"] .order-header.status-audited .fw-bold {
    color: var(--success-text);
}

[data-theme="dark"] .order-header.status-canceled {
    background: linear-gradient(to right, var(--bg-surface), var(--danger-bg));
    border-left-color: var(--danger-text);
}

[data-theme="dark"] .order-header.status-canceled i,
[data-theme="dark"] .order-header.status-canceled .fw-bold {
    color: var(--danger-text);
}

[data-theme="dark"] .order-header.purple {
    background: linear-gradient(to right, var(--bg-surface), rgba(168, 85, 247, 0.25));
    border-left-color: #c084fc;
}

[data-theme="dark"] .order-header.purple i,
[data-theme="dark"] .order-header.purple .fw-bold {
    color: #D8B4FE;
}

/* Typography Adjustments inside Headers */
.order-header .text-muted {
    color: var(--text-secondary) !important;
}

.order-header .small {
    font-size: 0.85rem;
}

/* Responsive Order Header - Small Screens */
@media (max-width: 576px) {
    .order-header {
        display: grid !important;
        grid-template-columns: 1fr auto;
        /* Content (Left/Date/Price) | Title (Right/Code/Name) */
        row-gap: 4px;
        /* Tight vertical spacing */
        column-gap: 12px;
        padding: 10px 15px;
        /* Reduced vertical padding */
        align-items: center;
    }

    /* 1. Flatten the structure */
    .order-header>.d-flex.flex-column,
    .order-header>.d-flex.align-items-center:last-child,
    .order-header .d-flex.align-items-center.gap-3 {
        display: contents !important;
    }

    /* 2. Grid Placement (RTL: Col 1 is Right, Col 2 is Left) */

    /* CODE (Right, Row 1) */
    .order-header .fw-bold:not(.text-primary) {
        grid-column: 1;
        grid-row: 1;
        font-size: 0.95rem;
        text-align: right;
    }

    /* DATE (Left, Row 1) */
    .order-header .text-muted.small {
        grid-column: 2;
        grid-row: 1;
        font-size: 0.75rem;
        text-align: left;
    }

    /* CUSTOMER NAME (Right, Row 2) */
    .order-header .fw-medium {
        grid-column: 1;
        grid-row: 2;
        font-size: 0.85rem;
        text-align: right;
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* PRICE (Left, Row 2) */
    .order-header .fw-bold.text-primary {
        grid-column: 2;
        grid-row: 2;
        font-size: 1rem !important;
        text-align: left;
    }

    /* BADGE & ICONS (Row 3, Span Full) */
    .order-header .badge {
        grid-column: 1 / -1;
        grid-row: 3;
        width: fit-content;
        margin-top: 4px;
        /* Small gap for badge */
        justify-self: end;
        /* Align to right? or start? Usually badges look good full width or start */
    }

    /* Hide specific desktop-only elements */
    .order-header .fa-chevron-down {
        display: none;
    }

    /* Fix icons inside name/code if they cause layout issues */
    .order-header i {
        display: inline-block;
    }
}

/* =========================================
   MIGRATED MODULE: PRODUCTS (Refactored to Glass Modal)
   ========================================= */

/* Modal Z-Index Fix */
#selectProductsModal .modal-dialog {
    pointer-events: auto !important;
}

/* Glass Modal Theme - Light Mode (Default) */
.glass-modal {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
    color: var(--text-primary);
}

.glass-modal .modal-header {
    background: linear-gradient(to right, rgba(0, 0, 0, 0.02), transparent);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem 1.5rem;
}

.glass-modal .modal-title {
    color: var(--primary);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.glass-modal .modal-body {
    padding: 1.5rem;
}

.glass-modal .modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: rgba(0, 0, 0, 0.02);
    padding: 1rem 1.5rem;
}

.glass-modal .btn-close {
    /* Default is dark, no filter needed for light mode */
    opacity: 0.5;
}

/* Glass Inputs - Light Mode */
.glass-input {
    background: rgba(0, 0, 0, 0.03) !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    color: var(--text-primary) !important;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.15) !important;
    border-color: var(--primary) !important;
}

.glass-input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

/* Glass Modal Theme - Dark Mode Overrides */
[data-theme="dark"] .glass-modal {
    background: rgba(20, 10, 30, 0.85);
    /* Deep Violet Dark Glass */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

[data-theme="dark"] .glass-modal .modal-header {
    background: linear-gradient(to right, rgba(255, 255, 255, 0.05), transparent);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .glass-modal .modal-title {
    color: var(--primary-light);
}

[data-theme="dark"] .glass-modal .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .glass-modal .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

[data-theme="dark"] .glass-input {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: white !important;
}

[data-theme="dark"] .glass-input:focus {
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 0 0 0.25rem rgba(var(--primary-rgb), 0.25) !important;
}

[data-theme="dark"] .glass-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Product Selection Specifics (Preserving JS Hooks) */
.pselected-products-zone {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-top: 20px;
    border: 1px solid var(--border-color);
}

.pselected-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 15px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
}

/* Product Card Item (In Selection Modal) */
.pproduct-card-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.pproduct-card-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary);
}

.pproduct-card-item.pproduct-selected {
    background: rgba(var(--primary-rgb), 0.05);
    /* Very light primary tint */
    border: 2px solid var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
}

.pproduct-card-item.pproduct-selected::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    color: var(--primary);
    font-size: 1rem;
    background: var(--bg-surface);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.pproduct-header {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pproduct-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.pproduct-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--success);
}

.pquantity-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface-secondary);
    border-radius: var(--radius-pill);
    padding: 5px;
    border: 1px solid var(--border-color);
}

.pquantity-btn-control {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: var(--bg-surface);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}

.pquantity-btn-control:hover {
    background: var(--primary);
    color: white;
}

.pquantity-input-field {
    width: 50px;
    border: none;
    background: transparent;
    text-align: center;
    font-weight: 600;
    color: var(--text-primary);
    padding: 0;
    padding: 0;
    appearance: textfield;
    -moz-appearance: textfield;
    -webkit-appearance: textfield;
}

.pquantity-input-field::-webkit-outer-spin-button,
.pquantity-input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Dark Mode Overrides for Product Cards */
[data-theme="dark"] .pproduct-card-item {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

[data-theme="dark"] .pproduct-card-item:hover {
    border-color: var(--primary-light);
}

[data-theme="dark"] .pproduct-card-item.pproduct-selected {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary-light);
    background: var(--bg-surface-tertiary);
}



.pselected-product-item .pproduct-name {
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.pselected-product-item .pproduct-quantity {
    color: var(--primary);
    font-weight: 600;
    margin: 0 10px;
}

.pselected-product-item .pproduct-price {
    color: var(--success-text);
    font-weight: 700;
}

.pempty-selection-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
}

.pempty-selection-state i {
    font-size: 2.5rem;
    opacity: 0.5;
    margin-bottom: 10px;
}

/* =========================================
   MIGRATED MODULE: CUSTOMER (from customer.css)
   ========================================= */

/* Customer Stats Grid */
.customer-container {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    padding: 15px 5px;
    border-top: 4px solid var(--border-color);
    /* Default fallback */
    background-clip: padding-box;
    /* Fix border radius issue */
}

[data-theme="dark"] .stat-card {
    background: var(--bg-surface);
    box-shadow: none;
    border: 1px solid var(--border-color);
    border-top-width: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card.total {
    border-top-color: var(--primary);
}

.stat-card.delivered {
    border-top-color: var(--success);
}

.stat-card.canceled {
    border-top-color: var(--danger);
}

.stat-card.returned {
    border-top-color: var(--warning);
}

.stat-card.percent {
    border-top-color: var(--info);
}

/* Customer Main Card */
.customer-main-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.customer-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    /* color: white; */
    padding: 25px;
}

.customer-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.customer-body {
    padding: 25px;
}

/* Contact Info Items */
.contact-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 15px;
    background: var(--bg-surface-secondary);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
}

.contact-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.contact-value {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.contact-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Refined Customer Layout */
.customer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.info-section {
    margin: 0px;
    padding: 2px;
}

.contact-section,
.address-section,
.additional-info-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.contact-section:last-child,
.address-section:last-child,
.additional-info-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    /* Deep Violet for titles */
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.contact-grid,
.address-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.address-item {
    background: var(--bg-surface-secondary);
    padding: 15px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.address-item i {
    color: var(--primary);
    margin-top: 4px;
}

.address-item p {
    margin: 0;
    color: var(--text-primary);
    line-height: 1.5;
}

/* Info Grid for Additional Info */
.additional-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.info-item {
    background: var(--bg-surface-secondary);
    padding: 12px 15px;
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-item.wide {
    grid-column: 1 / -1;
}

.info-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.info-value {
    font-weight: 600;
    color: var(--text-primary);
}


/* =========================================
   MIGRATED MODULE: FLASH & PROGRESS (Components)
   ========================================= */

/* Flash Messages */
.flash-message {
    position: relative;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(var(--blur-intensity));
    border-left: 4px solid var(--info);
    /* Default */
    overflow: hidden;
    animation: slideInRight var(--duration-normal) var(--ease-out);
}

.flash-message.success {
    border-left-color: var(--success);
}

.flash-message.error {
    border-left-color: var(--danger);
}

.flash-message.warning {
    border-left-color: var(--warning);
}

.flash-content {
    display: flex;
    align-items: center;
    padding: 15px;
    gap: 15px;
}

.flash-text {
    color: var(--text-primary);
    font-weight: 500;
}

.flash-close {
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

/* Progress Bar (Welcome Header) */
.welcome-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 25px;
    color: white;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.progress-section {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 1px solid var(--border-color);
}

.progress-bar {
    background: linear-gradient(90deg, var(--success), #20c997);
}

/* =========================================
   MIGRATED MODULE: CONFIRMED (from confirmed.css)
   ========================================= */
.order-confirmed {
    background: linear-gradient(135deg, var(--success) 0%, #10b981 100%);
    border: 2px solid var(--success);
    border-radius: var(--radius-md);
    padding: 15px;
    color: white;
    position: relative;
    overflow: hidden;
    animation: confirmPulse 2s ease-in-out;
}

@keyframes confirmPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

/* =========================================
   MIGRATED MODULE: CUSTOMER DETAIL (Internal Styles)
   ========================================= */

/* Collections Table */
.collections-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.collections-table thead {
    background: linear-gradient(135deg, var(--success), #20c997);
    color: white;
}

.collections-table thead th {
    padding: 12px 8px;
    font-weight: 600;
    text-align: center;
    font-size: 0.85rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.collections-table tbody tr {
    transition: all var(--duration-fast);
    border-bottom: 1px solid var(--border-color);
}

.collections-table tbody tr:hover {
    background-color: var(--bg-surface-secondary);
    transform: scale(1.01);
}

.collections-table tbody td {
    padding: 10px 8px;
    text-align: center;
    vertical-align: middle;
}

/* Status Badge in Collections */
.collections-table .status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 500;
}

.collections-table .status-badge.COMPLETED {
    background-color: var(--success-bg);
    color: var(--success-text);
}

.collections-table .status-badge.PENDING {
    background-color: var(--warning-bg);
    color: var(--warning-text);
}

.collections-table .status-badge.REJECTED {
    background-color: var(--danger-bg);
    color: var(--danger-text);
}

/* Transaction Row States */
.collections-table .transaction-row.COMPLETED {
    background-color: rgba(40, 167, 69, 0.05);
}

[data-theme="dark"] .collections-table .transaction-row.COMPLETED {
    background-color: rgba(40, 167, 69, 0.1);
}

.collections-table .transaction-row.PENDING {
    background-color: rgba(255, 193, 7, 0.05);
}

[data-theme="dark"] .collections-table .transaction-row.PENDING {
    background-color: rgba(255, 193, 7, 0.1);
}

.collections-table .transaction-row.REJECTED {
    background-color: rgba(220, 53, 69, 0.05);
    text-decoration: line-through;
    opacity: 0.7;
}

[data-theme="dark"] .collections-table .transaction-row.REJECTED {
    background-color: rgba(220, 53, 69, 0.1);
}


/* =========================================
   MIGRATED MODULE: ORDER CARDS (Fixing Uncoordinated Layout)
   ========================================= */

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.order-card {
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all 0.2s ease;
}

.order-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.order-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: var(--bg-surface);
    border-left: 4px solid transparent;
}

.order-header:hover {
    background: var(--bg-surface-secondary);
}

.order-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.order-code {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.order-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
}

.order-meta {
    display: flex;
    align-items: center;
    gap: 20px;
}

.order-price {
    font-weight: 600;
    color: var(--success);
    font-size: 1rem;
}

.expand-icon {
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.order-header[aria-expanded="true"] .expand-icon {
    transform: rotate(180deg);
}

.order-details {
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface-secondary);
    padding: 0;
}

.order-body {
    padding: 20px;
    position: relative;
    /* Ensure z-index works on children if needed */
}

/* Order Status Colors (Border Left) */
.order-header.status-new {
    border-left-color: var(--info);
}

.order-header.status-waiting {
    border-left-color: var(--warning);
}

.order-header.status-audited {
    border-left-color: var(--success);
}

.order-header.purple {
    border-left-color: #6f42c1;
}

.order-header.status-canceled {
    border-left-color: var(--danger);
    opacity: 0.8;
}

/* Timeline/History styles */
.cust-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.orders-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
}

/* Dark Mode Overrides for Order Cards */
[data-theme="dark"] .order-card {
    background: var(--bg-surface);
    border-color: var(--border-color);
}

[data-theme="dark"] .order-header {
    background: var(--bg-surface);
}

[data-theme="dark"] .order-header:hover {
    background: var(--bg-surface-secondary);
}

[data-theme="dark"] .order-details {
    background: rgba(0, 0, 0, 0.2);
}

/* =========================================
   MIGRATED MODULE: CUSTOMER DETAIL (Internal Styles)
   ========================================= */

/* Customer Actions Top Right */
.customer-actions {
    display: flex;
    justify-content: flex;
    margin: 15px;
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

/* Customer Orders Header */
.cust-orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

/* Financial Items */
.financial-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.financial-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.financial-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.financial-value {
    font-weight: 700;
    color: var(--text-primary);
}

/* Add Order Button specific styling */
.add-order-btn {
    width: auto;
    /* Override fixed width */
    height: auto;
    /* Override fixed height */
    padding: 10px 20px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(var(--success-rgb), 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.add-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(var(--success-rgb), 0.3);
}

/* Note Action Buttons */
.edit-privatenotes-btn,
.add-privatenotes-btn,
.edit-shippingNotes-btn,
.add-shippingNotes-btn,
.add-custinfo-btn {
    width: auto;
    /* Override fixed width */
    height: auto;
    /* Override fixed height */
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.edit-privatenotes-btn:hover,
.add-privatenotes-btn:hover,
.edit-shippingNotes-btn:hover,
.add-shippingNotes-btn:hover,
.add-custinfo-btn:hover {
    transform: translateY(-1px);
}

/* Specific button colors for notes */
/* =========================================
   PREMIUM DASHBOARD STYLES (NEW)
   ========================================= */

/* 1. Hero Welcome Card */
.hero-card {
    /* Glass effect with dark overlay for readability */
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.85) 0%, rgba(var(--primary-rgb), 0.65) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    color: white;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px -10px rgba(var(--primary-rgb), 0.4);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    /* Glass Support */
    backdrop-filter: blur(var(--blur-intensity));
    -webkit-backdrop-filter: blur(var(--blur-intensity));
}

/* Light Mode Override for Hero Card Contrast */
[data-bs-theme="light"] .hero-card {
    /* Stronger violet gradient in light mode to make white text pop */
    background: linear-gradient(135deg, rgba(76, 29, 149, 0.85) 0%, rgba(124, 58, 237, 0.75) 100%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px -10px rgba(124, 58, 237, 0.5);
}

/* Background Pattern Overlay */
.hero-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Subtle geometric pattern */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    pointer-events: none;
}

.hero-content-left {
    flex: 1;
    min-width: 300px;
    z-index: 2;
}

.hero-greeting {
    font-size: 0.9rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-username {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-stats-row {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.hero-stat-pill {
    background: rgba(255, 255, 255, 0.15);
    /* WebKit Prefix for Safari Support */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-pill);
    padding: 0.6rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: transform var(--duration-fast);
}

.hero-stat-pill:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.25);
}

.hero-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
}

.hero-stat-label {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Circular Progress for Dashboard (Optional future use) */
.hero-progress-circle {
    width: 60px;
    height: 60px;
    position: relative;
    /* ... specific circle styles if needed ... */
    /* ... specific circle styles if needed ... */
}

/* Mobile Hero Card Optimization */
@media (max-width: 768px) {
    .hero-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .hero-content-left {
        min-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-username {
        font-size: 1.8rem;
    }

    /* Reset width for progress bar container on mobile */
    .hero-content-left .d-flex {
        width: 100%;
        justify-content: center;
        max-width: None !important;
        /* Override inline style */
    }

    .hero-stats-row {
        margin-top: 1rem;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .hero-stat-pill {
        padding: 0.5rem 1rem;
        flex: 1 1 auto;
        /* Allow pills to grow/shrink properly */
        justify-content: center;
        min-width: 140px;
        /* Ensure they don't get too squashed */
    }
}

/* 2. Refined Quick Stats Cards */
.quick-stat-card {
    border: none;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: all var(--duration-normal);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.quick-stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--duration-normal);
    z-index: -1;
}

.quick-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.quick-stat-card:hover::after {
    opacity: 1;
}

/* Icon Containers with Gradients */
.stat-icon-wrapper {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.stat-icon-wrapper.blue {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.stat-icon-wrapper.yellow {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon-wrapper.red {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-icon-wrapper.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon-wrapper.purple {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.stat-info h3 {
    font-size: 1.75rem;
    font-weight: 800;
    margin: 0;
    line-height: 1;
    color: var(--text-primary);
}

.stat-info p {
    margin: 0.5rem 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

/* 3. Dashboard Chart Cards */
.dashboard-chart-card {
    background: var(--bg-surface);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    height: 100%;
    border: 1px solid var(--border-color);
}

.chart-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.chart-title-modern {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Notification Dropdown Fixes */
.notification-item {
    white-space: normal !important;
    /* Allow text wrapping */
    min-width: 300px;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

/* Role Hierarchy Premium Styles */
.role-hierarchy-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.role-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--duration-normal);
    box-shadow: var(--shadow-sm);
}

.role-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.role-header {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--primary-rgb), 0.05));
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.role-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.role-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    color: var(--primary-color);
}

.role-count-badge {
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.role-users-list {
    padding: 0.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.user-node {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    transition: background-color var(--duration-fast);
}

.user-node:hover {
    background-color: var(--bg-surface-secondary);
}

.user-avatar-small {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-surface-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.user-name {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Dark Mode Overrides */
[data-bs-theme="dark"] .role-card {
    background: rgba(30, 41, 59, 0.4);
    /* Darker, semi-transparent */
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .role-header {
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.2), rgba(var(--primary-rgb), 0.05));
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .role-icon-wrapper {
    background: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .role-count-badge {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .user-node:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .user-avatar-small {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}

/* Product Cards Dark Mode Overrides */
[data-bs-theme="dark"] .card-success {
    background-color: rgba(20, 83, 45, 0.2) !important;
    border: 1px solid rgba(34, 197, 94, 0.2) !important;
}

[data-bs-theme="dark"] .card-success .card-title {
    color: #4ade80 !important;
    /* Green-400 */
}

[data-bs-theme="dark"] .card-success .text-dark {
    color: #e2e8f0 !important;
    /* Slate-200 */
}

[data-bs-theme="dark"] .card-success .text-muted {
    color: #94a3b8 !important;
    /* Slate-400 */
}

[data-bs-theme="dark"] .card-warning {
    background-color: rgba(120, 53, 15, 0.2) !important;
    border: 1px solid rgba(245, 158, 11, 0.2) !important;
}

[data-bs-theme="dark"] .card-warning .card-title {
    color: #fbbf24 !important;
    /* Amber-400 */
}

[data-bs-theme="dark"] .card-warning .text-dark {
    color: #e2e8f0 !important;
    /* Slate-200 */
}

[data-bs-theme="dark"] .card-warning .text-muted {
    color: #94a3b8 !important;
    /* Slate-400 */
}

[data-bs-theme="dark"] .card-danger {
    background-color: rgba(127, 29, 29, 0.2) !important;
    border: 1px solid rgba(239, 68, 68, 0.2) !important;
}

[data-bs-theme="dark"] .card-danger .card-title {
    color: #f87171 !important;
    /* Red-400 */
}

[data-bs-theme="dark"] .card-danger .text-dark {
    color: #e2e8f0 !important;
    /* Slate-200 */
}

[data-bs-theme="dark"] .card-danger .text-muted {
    color: #94a3b8 !important;
    /* Slate-400 */
}

/* Category Title Dark Mode */
[data-bs-theme="dark"] .category-title {
    color: #e2e8f0 !important;
}

/* Low Stock Product Selection Style */
.pproduct-low-stock {
    background-color: rgba(255, 247, 237, 0.9);
    /* Light Orange/Yellow tint */
    border: 1px solid rgba(251, 191, 36, 0.5);
}

.pproduct-low-stock .pproduct-header {
    border-bottom-color: rgba(251, 191, 36, 0.3);
}

/* Dark Mode Low Stock */
[data-bs-theme="dark"] .pproduct-low-stock {
    background-color: rgba(120, 53, 15, 0.3) !important;
    border-color: rgba(217, 119, 6, 0.4) !important;
}

/* =========================================
   Roadmap Navigation (Sidebar & Mobile)
   ========================================= */
.roadmap-sticky-container {
    top: 1rem;
    z-index: 999;
}

.scrollable-sidebar {
    overflow-y: auto;
    max-height: 70vh;
}

.scrollable-sidebar::-webkit-scrollbar {
    width: 6px;
}

.scrollable-sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.scrollable-sidebar::-webkit-scrollbar-thumb {
    background: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.2);
    border-radius: 10px;
}

.scrollable-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.4);
}

.seller-nav-link {
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.seller-nav-link:hover,
.seller-nav-link.active {
    background-color: var(--bg-surface-secondary);
    border-left-color: var(--primary-color);
    padding-left: 1.5rem !important;
}

/* Flash Animation */
@keyframes highlightPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.4);
    }

    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 10px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0);
    }
}

.highlight-flash {
    animation: highlightPulse 1s ease-out;
    border-color: var(--primary-color) !important;
}

/* Mobile Responsive Roadmap */
@media (max-width: 991.98px) {
    .roadmap-sticky-container {
        top: 0.5rem !important;
        margin-bottom: 0.5rem;
    }

    .roadmap-sticky-container .card {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
    }

    .roadmap-list {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        padding: 0.5rem 0.2rem;
        max-height: auto !important;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .roadmap-list::-webkit-scrollbar {
        display: none;
    }

    .seller-nav-link {
        width: auto !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 50rem !important;
        padding: 0.4rem 1rem !important;
        font-size: 0.9rem;
        min-width: auto;
        flex-shrink: 0;
        background: var(--bg-surface);
        border-left: 1px solid var(--border-color) !important;
        display: inline-flex !important;
        align-items: center;
    }

    .seller-nav-link.active {
        background-color: var(--primary-color) !important;
        color: white !important;
        border-color: var(--primary-color) !important;
        box-shadow: 0 4px 6px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.3);
    }

    .seller-nav-link.active .badge {
        background-color: rgba(255, 255, 255, 0.2) !important;
        color: white !important;
    }

    .seller-nav-link:hover {
        padding-left: 1rem !important;
    }
}

/* =========================================
   SEARCH MODAL STYLES (PREMIUM)
   ========================================= */

/* Modal Content & Glassmorphism */
#searchModal .modal-content {
    background: var(--bg-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

[data-bs-theme="dark"] #searchModal .modal-content {
    background: rgba(30, 41, 59, 0.9);
    /* Darker surface for dark mode */
    border: 1px solid rgba(255, 255, 255, 0.08);
}

#searchModal .modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 1.75rem;
    background: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.03);
}

#searchModal .modal-body {
    padding: 1.75rem;
}

/* Search Input Styling */
#searchModal .input-group {
    background: var(--bg-surface-tertiary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

#searchModal .input-group:focus-within {
    box-shadow: 0 0 0 4px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.15);
    border-color: var(--primary);
}

#searchModal .input-group-text {
    background: transparent;
    border: none;
    padding-left: 1.25rem;
    color: var(--text-secondary);
}

#modalSearchInput {
    border: none;
    background: transparent;
    padding: 1rem 1rem 1rem 0;
    font-size: 1.1rem;
    color: var(--text-primary);
    font-weight: 500;
}

#modalSearchInput:focus {
    box-shadow: none;
    background: transparent;
}

/* Search Type Chips (Radio Buttons) */
#searchModal .form-check {
    padding: 0;
    margin: 0;
}

#searchModal .form-check-input {
    display: none;
}

#searchModal .form-check-label {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.2rem;
    background: var(--bg-surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
    user-select: none;
}

#searchModal .form-check-label:hover {
    background: var(--bg-surface-tertiary);
    transform: translateY(-1px);
}

#searchModal .form-check-input:checked+.form-check-label {
    background: var(--primary);
    color: white;
    /* Always white text on primary */
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.3);
    transform: translateY(-1px);
}

/* Dark Mode Specifics for Chips */
[data-bs-theme="dark"] #searchModal .form-check-input:checked+.form-check-label {
    background: var(--primary);
    color: white;
}

[data-bs-theme="dark"] #searchModal .form-check-label {
    background: rgba(255, 255, 255, 0.05);
}

/* Search Results Cards */
#modalSearchResults .card {
    border: 1px solid var(--border-color) !important;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    transition: all 0.2s ease;
    overflow: hidden;
}

#modalSearchResults .card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary) !important;
}

[data-bs-theme="dark"] #modalSearchResults .card {
    background: var(--bg-surface-secondary);
}

/* Result Items */
#modalSearchResults .order-item {
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    background: var(--bg-body);
    margin-bottom: 0.75rem !important;
    transition: all 0.2s;
}

#modalSearchResults .order-item:hover {
    background: var(--bg-surface-tertiary);
    border-color: var(--primary-color) !important;
}

[data-bs-theme="dark"] #modalSearchResults .order-item {
    background: rgba(0, 0, 0, 0.2);
}

[data-bs-theme="dark"] #modalSearchResults .order-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Badges in Results */
#modalSearchResults .badge {
    padding: 0.5em 0.8em;
    font-weight: 600;
    border-radius: var(--radius-sm);
}

/* Loading State */
#modalLoading .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.25em;
    color: var(--primary) !important;
}

/* Squircle Button */
.btn-squircle {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    /* Approx squircle curvature */
    flex-shrink: 0;
}

/* =========================================
   TOASTR NOTIFICATIONS CUSTOMIZATION
   ========================================= */
#toast-container>div {
    opacity: 1 !important;
    /* Force full opacity for the container */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 15px 40px 15px 15px !important;
    /* Adjusted padding for RTL */
    background-image: none !important;
    width: 350px !important;
    transition: all 0.3s ease;
}

/* Light Mode Background */
#toast-container>.toast-success {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-right: 5px solid #10b981 !important;
    color: #064e3b !important;
}

#toast-container>.toast-error {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-right: 5px solid #ef4444 !important;
    color: #7f1d1d !important;
}

#toast-container>.toast-info {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-right: 5px solid #0ea5e9 !important;
    color: #0c4a6e !important;
}

#toast-container>.toast-warning {
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-right: 5px solid #f59e0b !important;
    color: #78350f !important;
}

/* Icons styling for RTL (Placed on Right) */
#toast-container>div::before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 18px;
    font-size: 1.2rem;
}

#toast-container>.toast-success::before {
    content: "\f00c";
    color: #10b981;
}

#toast-container>.toast-error::before {
    content: "\f00d";
    color: #ef4444;
}

#toast-container>.toast-info::before {
    content: "\f05a";
    color: #0ea5e9;
}

#toast-container>.toast-warning::before {
    content: "\f071";
    color: #f59e0b;
}


/* Dark Mode Styles */
[data-bs-theme="dark"] #toast-container>div {
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-bs-theme="dark"] #toast-container>.toast-success {
    background-color: rgba(30, 41, 59, 0.95) !important;
    color: #ecfdf5 !important;
}

[data-bs-theme="dark"] #toast-container>.toast-error {
    background-color: rgba(30, 41, 59, 0.95) !important;
    color: #fef2f2 !important;
}

[data-bs-theme="dark"] #toast-container>.toast-info {
    background-color: rgba(30, 41, 59, 0.95) !important;
    color: #f0f9ff !important;
}

[data-bs-theme="dark"] #toast-container>.toast-warning {
    background-color: rgba(30, 41, 59, 0.95) !important;
    color: #fffbeb !important;
}

/* Hover Effect */
#toast-container>div:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
}

.toast-title {
    font-weight: 700 !important;
    margin-bottom: 5px !important;
}

/* =========================================
   NOTIFICATIONS DROPDOWN CUSTOMIZATION
   ========================================= */
#notification-list {
    opacity: 1 !important;
    /* Subtle gradient tint based on primary color to be "colored" but readable */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(240, 240, 255, 0.98)) !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.2) !important;
    border-radius: 16px !important;
    padding: 0 !important;
    /* Reset padding for cleaner list */
    min-width: 400px !important;
    /* Wider as requested */
    max-height: 500px;
    overflow-y: auto;
}

#notification-list .dropdown-header {
    background: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.1);
    color: var(--primary);
    font-weight: 700;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0;
}

#notification-list .notification-item {
    background: transparent !important;
    /* Transparent items */
    border-radius: 0;
    margin: 0;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    white-space: normal;
    transition: background-color 0.2s;
    color: var(--text-primary);
}

#notification-list .notification-item:hover {
    background-color: rgba(var(--primary-h), var(--primary-s), var(--primary-l), 0.08) !important;
    cursor: pointer;
}

#notification-list .notification-item:last-child {
    border-bottom: none;
}

/* Dark Mode for Notifications Dropdown */
[data-bs-theme="dark"] #notification-list {
    /* Dark gradient tint */
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.98), rgba(20, 20, 40, 0.98)) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0;
}

[data-bs-theme="dark"] #notification-list .dropdown-header {
    background: rgba(255, 255, 255, 0.05);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    color: var(--primary-light, #a5b4fc);
}

[data-bs-theme="dark"] #notification-list .notification-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: #f1f5f9;
}

[data-bs-theme="dark"] #notification-list .notification-item:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Mobile Optimization for Notifications Dropdown */
@media (max-width: 576px) {
    #notification-list {
        min-width: unset !important;
        width: 92vw !important;
        /* Take almost full width */
        position: fixed !important;
        top: 60px !important;
        /* Below navbar */
        left: 50% !important;
        transform: translateX(-50%) !important;
        /* Center horizontally */
        right: auto !important;
        max-height: 70vh !important;
    }
}