/* Quick Lube Shop Management System - Main Stylesheet */

:root {
    --primary-color: #3b82f6;
    /* Lighter blue */
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #334155;
    /* Softer dark */
    --light-color: #f1f5f9;
    --body-bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --sidebar-width: 260px;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --border-color: #e2e8f0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    color: var(--dark-color);
    line-height: 1.6;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: var(--dark-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.02);
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.sidebar-header h2 {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0;
    color: var(--dark-color);
    font-weight: 700;
    letter-spacing: -0.025em;
}

.sidebar-header h2 i {
    color: var(--primary-color);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
    z-index: 1000;
}

.user-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 6px 6px 6px;
    /* Less left padding for avatar */
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    /* Pill shape */
    color: var(--dark-color);
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
    height: 48px;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.user-dropdown-btn:hover {
    background: #f9fafb;
    border-color: #cbd5e1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.user-dropdown-btn:active {
    transform: translateY(0);
}

.user-info-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.2;
    text-align: left;
    overflow: hidden;
    padding-right: 8px;
}

.user-info-text .name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-info-text .role {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.user-dropdown-btn i:last-child {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-right: 12px;
    /* Add right margin for chevron */
}

/* Avatar Circle */
.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    user-select: none;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.avatar-circle.large {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    /* Fixed width */
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    /* Ensure it's on top of everything */
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header-user {
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(to right, #f8fafc, #ffffff);
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header-user .user-details {
    flex: 1;
    overflow: hidden;
}

.dropdown-header-user .name {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 1rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dropdown-header-user .role {
    font-size: 0.85rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--dark-color);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary-color);
    padding-left: 20px;
    /* Slide effect */
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    color: var(--secondary-color);
    transition: color 0.2s;
}

.dropdown-item:hover i {
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 4px 0;
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: var(--danger-color);
}

.dropdown-item.text-danger:hover i {
    color: var(--danger-color);
}


/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.75rem 1.5rem;
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    /* Highlight marker */
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.nav-item:hover {
    background: #f8fafc;
    color: var(--primary-color);
}

.nav-item.active {
    background: #eff6ff;
    /* Very light blue bg */
    color: var(--primary-color);
    font-weight: 600;
    border-left-color: var(--primary-color);
}

.nav-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.75rem 1.5rem;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #f9fafb;
}

.user-info .name {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 0.9rem;
}

.user-info .role {
    font-size: 0.8rem;
    color: var(--secondary-color);
}

/* Main Layout */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 2rem;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.header-left {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark-color);
    margin: 0;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Header Search */
.header-search {
    position: relative;
    margin-right: auto;
    /* Push to left/center */
    margin-left: 2rem;
    width: 300px;
    display: none;
    /* Hidden on mobile by default */
}

@media (min-width: 1024px) {
    .header-search {
        display: block;
    }
}

.header-search input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--light-color);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.header-search input:focus {
    background: white;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    border-color: var(--primary-color);
    outline: none;
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-size: 0.9rem;
}

/* Header Buttons */
.btn {
    padding: 0 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    height: 40px;
    /* Reduced from 48px */
    line-height: 1;
    box-sizing: border-box;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.8rem;
    height: 32px;
}

/* Dashboard Stats Grid */
.dashboard-stats {
    display: grid !important;
    /* Force Grid */
    grid-template-columns: repeat(4, 1fr);
    /* Force 4 columns */
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1200px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    background: #ffffff !important;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-top: 3px solid transparent;
    /* Top border accent */
    height: 100%;
}

.stat-card:nth-child(1) {
    background: var(--primary-color) !important;
    border-color: var(--primary-color);
}

.stat-card:nth-child(1) h3,
.stat-card:nth-child(1) .value,
.stat-card:nth-child(1) .icon {
    color: white !important;
    opacity: 0.9;
}

.stat-card:nth-child(1) .icon {
    opacity: 0.4;
}

/* Card 2: Sales (Red) */
.stat-card:nth-child(2) {
    background: var(--danger-color) !important;
    border-color: var(--danger-color);
}

.stat-card:nth-child(2) h3,
.stat-card:nth-child(2) .value,
.stat-card:nth-child(2) .icon {
    color: white !important;
    opacity: 0.9;
}

.stat-card:nth-child(2) .icon {
    opacity: 0.4;
}

/* Card 3: Low Stock (Yellow) */
.stat-card:nth-child(3) {
    background: var(--warning-color) !important;
    border-color: var(--warning-color);
}

.stat-card:nth-child(3) h3,
.stat-card:nth-child(3) .value,
.stat-card:nth-child(3) .icon {
    color: white !important;
    opacity: 0.9;
}

.stat-card:nth-child(3) .icon {
    opacity: 0.4;
}

/* Card 4: Pending (Green) */
.stat-card:nth-child(4) {
    background: var(--success-color) !important;
    border-color: var(--success-color);
}

.stat-card:nth-child(4) h3,
.stat-card:nth-child(4) .value,
.stat-card:nth-child(4) .icon {
    color: white !important;
    opacity: 0.9;
}

.stat-card:nth-child(4) .icon {
    opacity: 0.4;
}

.stat-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-card h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.stat-card .value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--dark-color);
}

.stat-card .icon {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    font-size: 1.5rem;
    opacity: 0.15;
    color: var(--dark-color);
}

.dashboard-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 1.5rem;
}

.section {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

/* Tables */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--light-color);
}

table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--border-color);
}

table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background: var(--light-color);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-pending {
    background: #fef3c7;
    color: #92400e;
}

.badge-in_progress {
    background: #dbeafe;
    color: #1e40af;
}

.badge-completed {
    background: #d1fae5;
    color: #065f46;
}

.badge-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 0.5rem;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, #1e40af 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: white;
    border-radius: 0.5rem;
    padding: 2.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--secondary-color);
}

/* Error Message */
.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 0.75rem;
    border-radius: 0.375rem;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* Search Bar */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-bar input,
.search-bar select {
    flex: 1;
    padding: 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: white;
    /* Ensure white background */
    font-size: 0.9rem;
    /* Match universal font size or form-group size */
}

/* Cards */
.card {
    background: white;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .dashboard-sections {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {

    .sidebar,
    .header-actions,
    .btn {
        display: none;
    }

    .main-content {
        margin-left: 0;
    }
}

/* Search Dropdown (Global) */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    margin-top: 5px;
    border: 1px solid var(--border-color);
}

.search-dropdown.active {
    display: block;
}

.search-section {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
}

.search-section:last-child {
    border-bottom: none;
}

.search-header {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--secondary-color);
    margin-bottom: 5px;
    font-weight: 600;
}

.search-item {
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.search-item:hover {
    background-color: var(--light-color);
}

.item-main {
    font-weight: 500;
    color: var(--dark-color);
}

.item-sub {
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.no-results {
    padding: 15px;
    text-align: center;
    color: var(--secondary-color);
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-bar input {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--dark-color);
}

/* Responsive Styles */

/* Mobile Sidebar & Header Adjustments */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
        /* Collapse by default on mobile */
    }

    /* Sidebar Hidden */
    .sidebar {
        width: 260px;
        /* Fixed width when shown */
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 2000;
        /* Higher than modal */
        box-shadow: none;
    }

    .sidebar.show {
        transform: translateX(0);
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    /* Main Content spans full width */
    .main-content {
        margin-left: 0;
        padding: 1rem;
        width: 100%;
    }

    /* Header adjustments */
    .header {
        position: sticky;
        top: 0;
        z-index: 900;
        margin-bottom: 1.5rem;
        padding: 0.75rem 0.5rem;
        /* Reduced horizontal padding */
        gap: 0.5rem;
        flex-wrap: wrap;
        /* Allow wrapping if needed */
    }

    .header-left {
        flex: 1;
        /* Allow it to take space but shrink if needed */
        min-width: 0;
        /* Allow text truncation */
    }

    .header-left h1 {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 1.1rem;
    }

    .header-actions {
        flex-shrink: 0;
        /* Prevent actions from collapsing */
    }

    .breadcrumbs {
        display: none;
        /* Hide breadcrumbs on very small screens to save space */
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1900;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
    }

    .sidebar-overlay.show {
        opacity: 1;
        visibility: visible;
    }

    /* Mobile Toggle Button (Injected by JS) */
    .mobile-toggle-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        color: var(--dark-color);
        font-size: 1.25rem;
        cursor: pointer;
        margin-right: 0.5rem;
        border-radius: 50%;
    }

    .mobile-toggle-btn:active {
        background: var(--light-color);
    }

    /* Search Bar hidden on small mobile */
    .header-search {
        display: none !important;
    }
}

/* Data Tables */
@media (max-width: 1024px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 0.5rem;
        border: 1px solid var(--border-color);
    }

    table {
        min-width: 800px;
        /* Ensure table doesn't squash too much */
    }
}

/* Dashboard Grid */
@media (max-width: 640px) {
    .dashboard-stats {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .dashboard-sections {
        grid-template-columns: 1fr !important;
    }

    .header-actions .btn span {
        display: none !important;
        /* Force hide text */
    }

    /* Compact 'Low Stock' button specifically if it has a class like btn-warning */
    .header-actions .btn-warning {
        padding: 0 0.5rem;
    }

    /* Ensure icons are visible and centered */
    .header-actions .btn i {
        margin-right: 0;
    }

    .header-actions .btn {
        padding: 0 0.5rem;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Exception for User Dropdown which is different */
    .user-dropdown-btn {
        width: 40px;
        /* Small circle */
        min-width: 0;
        height: 40px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .avatar-circle {
        margin: 0;
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .user-info-text {
        display: none !important;
    }

    .user-dropdown-btn {
        min-width: auto;
        padding: 4px;
        border: none;
        background: transparent;
        box-shadow: none;
    }

    .user-dropdown-btn:hover {
        background: transparent;
        box-shadow: none;
    }

    .user-dropdown-btn i:last-child {
        display: none;
        /* Hide chevron */
    }

    .user-dropdown-menu {
        width: 260px;
        right: -10px;
        /* Adjust positioning */
    }

    /* Search Bar Responsive */
    .search-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .search-bar input,
    .search-bar select,
    .search-bar button {
        width: 100%;
        margin-right: 0 !important;
    }
}