/* assets/css/style.css */
:root {
    /* Light Theme Colors */
    --bg-color: #f4f6f8;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    --primary-color: #3b82f6; /* Blue */
    --primary-hover: #2563eb;
    --success-color: #10b981; /* Green */
    --danger-color: #ef4444; /* Red */
    --warning-color: #f59e0b; /* Orange */
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --border-radius-sm: 0.375rem;
    --border-radius-md: 0.5rem;
    --border-radius-lg: 0.75rem;
    
    --transition: all 0.3s ease;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
    overflow: hidden; /* Prevent body scroll, handle scroll in main-content */
}

/* App Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--primary-color);
    color: #ffffff;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
}

.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 1.25rem;
}

.sidebar-header .icon-btn {
    color: rgba(255, 255, 255, 0.8);
}

.sidebar-header .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sidebar-header .logo-icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
}

.nav-group {
    margin-bottom: 16px;
}

.nav-group-title {
    padding: 0 24px;
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item i {
    width: 24px;
    margin-right: 12px;
    font-size: 1.1rem;
}

.nav-item:hover, .nav-item.active {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.nav-item.active {
    border-left-color: #ffffff;
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    color: #ffffff;
}

.user-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.sidebar-footer .user-details a {
    color: rgba(255, 255, 255, 0.7) !important;
}

.sidebar-footer .user-details a:hover {
    color: #ff8a8a !important;
}

/* Collapsed Sidebar Styles */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .sidebar-header h2,
.sidebar.collapsed .sidebar-header .logo-icon {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    justify-content: center !important;
    padding: 0 16px;
}

.sidebar.collapsed .nav-group-title span {
    display: none;
}

.sidebar.collapsed .sidebar-nav {
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.sidebar.collapsed .sidebar-nav::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Webkit */
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding: 12px 0;
    position: relative;
}

.sidebar.collapsed .nav-item span {
    position: fixed;
    left: 80px;
    transform: translateY(-50%) translateX(15px);
    background-color: var(--primary-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.sidebar.collapsed .nav-item span::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-width: 5px 5px 5px 0;
    border-style: solid;
    border-color: transparent var(--primary-color) transparent transparent;
}

.sidebar.collapsed .nav-item:hover span {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(0);
}

.sidebar.collapsed .nav-item i {
    margin-right: 0;
    font-size: 1.25rem;
}

.sidebar.collapsed .nav-group-title {
    text-align: center;
    padding: 0;
    margin-top: 16px;
}

.sidebar.collapsed .user-details {
    display: none !important;
}

.sidebar.collapsed .user-info {
    justify-content: center;
}

.sidebar.collapsed .sidebar-footer {
    padding: 16px 0;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.top-header {
    height: 70px;
    background-color: var(--primary-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    color: #ffffff;
}

.header-search {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: var(--border-radius-lg);
    width: 300px;
}

.header-search i {
    color: rgba(255, 255, 255, 0.8);
    margin-right: 8px;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    color: #ffffff;
    width: 100%;
}

.header-search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.header-actions {
    display: flex;
    gap: 16px;
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.top-header .icon-btn {
    color: rgba(255, 255, 255, 0.85);
}

.top-header .icon-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.action-btns {
    display: flex;
    gap: 8px;
    align-items: center;
    white-space: nowrap;
}

/* Checkboxes */
.bulk-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* View Container */
.view-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

/* UI Components */

/* Cards */
.card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    font-size: 0.875rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-success { background-color: var(--success-color); color: white; }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-outline { background-color: transparent; border: 1px solid var(--border-color); color: var(--text-primary); }

/* Tables */
.table-responsive {
    overflow-x: auto;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius-md);
    background-color: var(--card-bg);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

th {
    text-align: left;
    padding: 14px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--primary-color);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

td {
    padding: 14px 16px;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

tbody tr:nth-child(even) {
    background-color: color-mix(in srgb, var(--primary-color) 6%, var(--card-bg));
}

tbody tr:nth-child(odd) {
    background-color: var(--card-bg);
}

tbody tr:hover {
    background-color: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg)) !important;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border: 1.5px solid var(--primary-color);
    background-color: color-mix(in srgb, var(--primary-color) 8%, transparent);
    color: var(--primary-color);
    transition: var(--transition);
}

.badge-success { 
    background-color: rgba(16, 185, 129, 0.08) !important; 
    color: #10b981 !important; 
    border-color: #10b981 !important; 
}
.badge-warning { 
    background-color: rgba(245, 158, 11, 0.08) !important; 
    color: #f59e0b !important; 
    border-color: #f59e0b !important; 
}
.badge-danger { 
    background-color: rgba(239, 68, 68, 0.08) !important; 
    color: #ef4444 !important; 
    border-color: #ef4444 !important; 
}

/* Forms */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--border-radius-md);
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    color: var(--text-primary);
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.table-input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background-color: var(--bg-color);
    color: var(--text-primary);
    outline: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.table-input:focus {
    border-color: var(--primary-color);
    background-color: var(--card-bg);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 20%, transparent);
}

.input-group {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    background: var(--bg-color);
    transition: var(--transition);
}

.input-group select {
    border: none;
    outline: none;
    background: rgba(0, 0, 0, 0.03);
    padding: 0 12px;
    border-right: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
}

.input-group input {
    border: none;
    width: 100%;
    padding: 10px 12px;
    outline: none;
    background: transparent;
    color: var(--text-primary);
}

.input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Modals */
.modal {
    display: flex;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(0px);
    transition: opacity 0.25s ease, backdrop-filter 0.25s ease;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

@keyframes bounceConfirm {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-body { 
    padding: 24px; 
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.close-btn {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 250px;
    padding: 16px 20px;
    background: var(--card-bg);
    color: var(--text-primary);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    border-left: 4px solid var(--primary-color);
    animation: slideInRight 0.3s ease;
}

.toast.success { border-left-color: var(--success-color); }
.toast.error { border-left-color: var(--danger-color); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* Dashboard Stat Cards */
.stat-card {
    padding: 24px;
    border-radius: var(--border-radius-lg);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue { background-color: rgba(59, 130, 246, 0.1); color: #3b82f6; }
.stat-icon.green { background-color: rgba(16, 185, 129, 0.1); color: #10b981; }
.stat-icon.orange { background-color: rgba(245, 158, 11, 0.1); color: #f59e0b; }

.stat-info h3 { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 4px; }
.stat-info p { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }

/* Responsive Design */
.mobile-menu-btn {
    display: none;
}
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .mobile-menu-btn { display: flex; }
    
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        z-index: 100;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.show {
        left: 0;
    }
    
    .sidebar-overlay.show {
        display: block;
    }
    
    .grid-4, .grid-3, .grid-2 {
        grid-template-columns: 1fr !important;
    }
    
    .top-header .header-search {
        width: 100%;
        max-width: 180px;
    }
    
    .top-header {
        padding: 0 16px;
    }
    
    .view-content {
        padding: 16px;
    }
    
    /* General override for any inline grid layouts inside modals or views to stack on mobile */
    div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        gap: 16px !important;
    }
    
    /* Adjust modal for mobile */
    .modal-content {
        max-width: 95% !important;
        margin: 20px auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .modal-body[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    /* Wrap flex rows inside modal details on mobile */
    .modal-body div[style*="display: flex; justify-content: space-between"],
    .modal-body div[style*="display: flex; justify-content: space-between;"] {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: flex-start !important;
    }
    .modal-body div[style*="display: flex; justify-content: space-between"] div,
    .modal-body div[style*="display: flex; justify-content: space-between;"] div {
        text-align: left !important;
    }

    /* Make summary details block (totals) inside modals full width on mobile */
    .modal-body div[style*="margin-left: auto"] {
        width: 100% !important;
        margin-left: 0 !important;
        border-left: none !important;
        padding-left: 0 !important;
    }

    /* Wrap card headers to columns on mobile */
    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .card-header > div {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    .card-header > div .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    /* Allow search inputs in views to stretch full-width */
    .view-content .form-control {
        max-width: 100% !important;
    }

    /* Keep tables readable and scrollable horizontally instead of squishing */
    .table-responsive table {
        min-width: 800px;
    }
}

/* Branch Dropdown Selector */
.branch-dropdown-container {
    position: relative;
    display: inline-block;
}

.branch-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.branch-dropdown-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.branch-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    z-index: 1000;
    width: 250px;
    display: none;
    animation: fadeInDropdown 0.2s ease;
}

.branch-dropdown-menu.active {
    display: block;
}

.branch-search-box {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 6px 12px;
    margin-bottom: 8px;
}

.branch-search-box i {
    color: var(--text-secondary);
    margin-right: 8px;
    font-size: 0.85rem;
}

.branch-search-box input {
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    width: 100%;
    font-size: 0.85rem;
}

.branch-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.branch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}

.branch-item:hover {
    background-color: color-mix(in srgb, var(--primary-color) 8%, var(--card-bg));
}

.branch-item .checkmark {
    color: var(--primary-color);
    display: none;
    font-size: 0.85rem;
}

.branch-item.selected {
    background-color: color-mix(in srgb, var(--primary-color) 5%, var(--card-bg));
    font-weight: 500;
}

.branch-item.selected .checkmark {
    display: block;
}

/* Theme Dropdown Color Picker */
.theme-dropdown-container {
    position: relative;
    display: inline-block;
}

.theme-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.theme-dropdown-btn:hover {
    background-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.theme-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background-color: var(--sidebar-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 16px;
    z-index: 1000;
    width: 176px; /* 3 columns of 40px + 2 gaps of 12px + 2 paddings of 16px = 120 + 24 + 32 = 176px */
    display: none;
    animation: fadeInDropdown 0.2s ease;
}

.theme-dropdown-menu.active {
    display: block;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(3, 40px);
    gap: 12px;
}

.theme-color-item {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-color-item:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-sm);
}

.theme-color-item .fa-check {
    display: none;
}

.theme-color-item.selected .fa-check {
    display: block;
    animation: scaleCheckmark 0.15s ease;
}

@keyframes scaleCheckmark {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

/* Mobile optimizations for Dashboard */
@media (max-width: 768px) {
    /* Dashboard Stats Grid 2x2 */
    #dashboard-stats.grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    #dashboard-stats .stat-card {
        padding: 14px 12px !important;
        gap: 10px !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    #dashboard-stats .stat-icon {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.1rem !important;
        flex-shrink: 0 !important;
    }

    #dashboard-stats .stat-info h3 {
        font-size: 0.75rem !important;
        margin-bottom: 2px !important;
    }

    #dashboard-stats .stat-info p {
        font-size: 1.15rem !important;
        word-break: break-all !important;
    }

    /* Recent Transactions Table Mobile Fit */
    #recent-transactions-table th:nth-child(2),
    #recent-transactions-table td:nth-child(2),
    #recent-transactions-table th:nth-child(5),
    #recent-transactions-table td:nth-child(5) {
        display: none !important;
    }

    .table-responsive #recent-transactions-table {
        min-width: 100% !important;
    }

    /* Cashbook Mobile Optimizations */
    .grid-3 {
        gap: 12px !important;
    }
    .grid-3 .card {
        padding: 12px 16px !important;
    }
    .grid-3 .card > div[style*="font-size: 1.75rem"] {
        font-size: 1.35rem !important;
        margin-top: 4px !important;
    }

    /* Filters: stretch inputs full width on mobile */
    .card div[style*="margin: 20px 0"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .card div[style*="margin: 20px 0"] > div {
        width: 100% !important;
    }
    .card div[style*="margin: 20px 0"] input {
        width: 100% !important;
    }

    /* Cashbook Table Mobile Fit */
    #cashbook-table th:nth-child(1),
    #cashbook-table td:nth-child(1),
    #cashbook-table th:nth-child(3),
    #cashbook-table td:nth-child(3) {
        display: none !important;
    }

    .table-responsive #cashbook-table {
        min-width: 100% !important;
    }

    /* Pagination Wrap */
    #cashbook-pagination {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    /* Modal footer actions stacked vertically on mobile */
    .modal-footer {
        flex-direction: column-reverse !important;
        align-items: stretch !important;
        gap: 8px !important;
    }
    .modal-footer .btn {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* Global POS and generic search fields styling */
.pos-search {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    padding: 8px 16px;
    border-radius: var(--border-radius-lg);
}
.pos-search i {
    color: var(--text-secondary);
    margin-right: 8px;
}
.pos-search input, .pos-search select {
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-primary);
    width: 100%;
}
.pos-search select {
    cursor: pointer;
}
.pos-search select option {
    background-color: var(--card-bg);
    color: var(--text-primary);
}
.pos-search input::placeholder {
    color: var(--text-secondary);
    opacity: 0.8;
}

/* Global Loading Bar */
.global-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    z-index: 999999;
    background: linear-gradient(90deg, #00f5d4, #00bbf9);
    box-shadow: 0 0 12px #00f5d4, 0 0 6px #00bbf9;
    pointer-events: none;
    opacity: 0;
}



