/* ==========================================================================
   SAMAL ENTERPRISES - Professional POS System CSS
   Modern, Premium UI for Stationary Shop Management System
   ========================================================================== */

/* ===== CSS Variables ===== */
:root {
    /* Primary Colors */
    --primary: #4361ee;
    --primary-light: #7b8ef5;
    --primary-dark: #2e3fa8;
    --primary-gradient: linear-gradient(135deg, #4361ee 0%, #3a56d4 50%, #2e3fa8 100%);
    
    /* Secondary Colors */
    --secondary: #f72585;
    --secondary-light: #ff6b9d;
    --secondary-dark: #b5176a;
    
    /* Accent Colors */
    --success: #06d6a0;
    --success-light: #7ae9c5;
    --success-dark: #04967c;
    --warning: #ffb703;
    --warning-light: #ffd966;
    --warning-dark: #e6a100;
    --danger: #e63946;
    --danger-light: #f28b92;
    --danger-dark: #b91c1c;
    --info: #4cc9f0;
    --info-light: #8de0f5;
    --info-dark: #2b8db5;
    
    /* Neutral Colors */
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray: #64748b;
    --gray-light: #94a3b8;
    --gray-lighter: #cbd5e1;
    --light: #f1f5f9;
    --lighter: #f8fafc;
    --white: #ffffff;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #4361ee 0%, #3a56d4 50%, #2e3fa8 100%);
    --gradient-success: linear-gradient(135deg, #06d6a0 0%, #04967c 100%);
    --gradient-warning: linear-gradient(135deg, #ffb703 0%, #fb8500 100%);
    --gradient-danger: linear-gradient(135deg, #e63946 0%, #b91c1c 100%);
    --gradient-info: linear-gradient(135deg, #4cc9f0 0%, #4895ef 100%);
    --gradient-secondary: linear-gradient(135deg, #f72585 0%, #b5176a 100%);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.03);
    --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.02);
    --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.15);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.04);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-xxl: 24px;
    --radius-full: 9999px;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.25;
    color: var(--dark);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--font-size-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--font-size-3xl); letter-spacing: -0.015em; }
h3 { font-size: var(--font-size-2xl); letter-spacing: -0.01em; }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
    margin-bottom: var(--space-4);
    color: var(--gray);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--lighter);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-light);
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray);
}

/* ===== Sidebar - POS Style ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 270px;
    background: var(--white);
    color: var(--dark);
    overflow-y: auto;
    overflow-x: hidden;
    transition: all var(--transition-base);
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-xl);
    border-right: 1px solid rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--gray-lighter);
    border-radius: var(--radius-full);
}

/* Sidebar Header */
.sidebar .sidebar-header {
    padding: var(--space-6) var(--space-5);
    text-align: center;
    border-bottom: 1px solid var(--lighter);
    background: var(--gradient-primary);
    flex-shrink: 0;
}

.sidebar .sidebar-header .logo-icon {
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.2);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-3);
    font-size: 28px;
    color: var(--white);
    backdrop-filter: blur(10px);
}

.sidebar .sidebar-header h5 {
    color: var(--white);
    margin-bottom: var(--space-1);
    font-weight: 700;
    font-size: var(--font-size-lg);
    letter-spacing: 0.5px;
}

.sidebar .sidebar-header p {
    color: rgba(255,255,255,0.8);
    font-size: var(--font-size-xs);
    margin-bottom: 0;
    background: rgba(255,255,255,0.15);
    display: inline-block;
    padding: 2px 16px;
    border-radius: var(--radius-full);
}

/* Sidebar Navigation */
.sidebar .nav-section {
    padding: var(--space-4) var(--space-3);
    flex: 1;
}

.sidebar .nav-section .nav-label {
    font-size: var(--font-size-xs);
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 var(--space-4);
    margin-bottom: var(--space-3);
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    color: var(--gray);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    margin-bottom: 2px;
    font-weight: 500;
    font-size: var(--font-size-sm);
    position: relative;
}

.sidebar .nav-link i {
    width: 22px;
    margin-right: var(--space-3);
    font-size: var(--font-size-lg);
    text-align: center;
    transition: all var(--transition-fast);
}

.sidebar .nav-link:hover {
    background: var(--lighter);
    color: var(--primary);
    transform: translateX(4px);
}

.sidebar .nav-link:hover i {
    color: var(--primary);
}

.sidebar .nav-link.active {
    background: var(--primary-gradient);
    color: var(--white);
    box-shadow: var(--shadow-md);
}

.sidebar .nav-link.active i {
    color: var(--white);
}

.sidebar .nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 24px;
    background: var(--white);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.sidebar .nav-link .badge-nav {
    margin-left: auto;
    background: var(--danger);
    color: var(--white);
    font-size: var(--font-size-xs);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.sidebar .nav-link.logout {
    margin-top: auto;
    border-top: 1px solid var(--lighter);
    color: var(--danger);
}

.sidebar .nav-link.logout:hover {
    background: var(--danger);
    color: var(--white);
}

.sidebar .nav-link.logout:hover i {
    color: var(--white);
}

/* ===== Main Content ===== */
.main-content {
    margin-left: 270px;
    padding: var(--space-6);
    min-height: 100vh;
    background: var(--light);
    transition: margin var(--transition-base);
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.page-header h2 {
    margin-bottom: 0;
    font-size: var(--font-size-2xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-header h2 .header-icon {
    width: 44px;
    height: 44px;
    background: var(--primary-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: var(--font-size-xl);
}

.page-header .header-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
}

/* ===== Cards ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all var(--transition-base);
    overflow: hidden;
    margin-bottom: var(--space-4);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: var(--white);
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.card-header h5 {
    margin-bottom: 0;
    font-weight: 600;
    font-size: var(--font-size-base);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.card-header .card-header-actions {
    display: flex;
    gap: var(--space-2);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    background: var(--lighter);
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--lighter);
}

/* ===== Stat Cards ===== */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
    height: 100%;
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0.03;
    border-radius: 50%;
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: var(--space-3);
    color: var(--white);
}

.stat-card .stat-icon.primary { background: var(--gradient-primary); }
.stat-card .stat-icon.success { background: var(--gradient-success); }
.stat-card .stat-icon.warning { background: var(--gradient-warning); }
.stat-card .stat-icon.danger { background: var(--gradient-danger); }
.stat-card .stat-icon.info { background: var(--gradient-info); }
.stat-card .stat-icon.secondary { background: var(--gradient-secondary); }

.stat-card .stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: var(--space-1);
    line-height: 1.2;
}

.stat-card .stat-label {
    color: var(--gray);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.stat-card .stat-change {
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    display: inline-block;
    margin-top: var(--space-2);
}

.stat-card .stat-change.up {
    background: var(--success-light);
    color: var(--success-dark);
}

.stat-card .stat-change.down {
    background: var(--danger-light);
    color: var(--danger-dark);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    font-size: var(--font-size-sm);
    font-weight: 600;
    line-height: 1.5;
    border: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn i {
    font-size: var(--font-size-base);
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition-fast);
}

.btn:hover::after {
    background: rgba(255,255,255,0.1);
}

.btn:active {
    transform: scale(0.96);
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(67, 97, 238, 0.35);
}

.btn-primary:hover {
    color: var(--white);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.45);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--gradient-success);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(6, 214, 160, 0.35);
}

.btn-success:hover {
    color: var(--white);
    box-shadow: 0 6px 20px rgba(6, 214, 160, 0.45);
    transform: translateY(-2px);
}

.btn-warning {
    background: var(--gradient-warning);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(255, 183, 3, 0.35);
}

.btn-warning:hover {
    color: var(--white);
    box-shadow: 0 6px 20px rgba(255, 183, 3, 0.45);
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--gradient-danger);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(230, 57, 70, 0.35);
}

.btn-danger:hover {
    color: var(--white);
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.45);
    transform: translateY(-2px);
}

.btn-info {
    background: var(--gradient-info);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(76, 201, 240, 0.35);
}

.btn-info:hover {
    color: var(--white);
    box-shadow: 0 6px 20px rgba(76, 201, 240, 0.45);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(247, 37, 133, 0.35);
}

.btn-secondary:hover {
    color: var(--white);
    box-shadow: 0 6px 20px rgba(247, 37, 133, 0.45);
    transform: translateY(-2px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-outline-success {
    background: transparent;
    color: var(--success);
    border: 2px solid var(--success);
}

.btn-outline-success:hover {
    background: var(--success);
    color: var(--white);
}

.btn-outline-danger {
    background: transparent;
    color: var(--danger);
    border: 2px solid var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: var(--white);
}

.btn-sm {
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-3) var(--space-8);
    font-size: var(--font-size-base);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* ===== Forms ===== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--dark);
    margin-bottom: var(--space-2);
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control,
.form-select {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--font-size-base);
    font-weight: 400;
    line-height: 1.5;
    color: var(--dark);
    background: var(--white);
    border: 2px solid var(--gray-lighter);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    appearance: none;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.12);
}

.form-control::placeholder {
    color: var(--gray-light);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(230, 57, 70, 0.12);
}

.form-control.is-valid {
    border-color: var(--success);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 0 4px rgba(6, 214, 160, 0.12);
}

.form-control:disabled,
.form-select:disabled {
    background: var(--lighter);
    cursor: not-allowed;
}

.form-text {
    font-size: var(--font-size-xs);
    color: var(--gray);
    margin-top: var(--space-1);
}

/* ===== Tables ===== */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.table thead {
    background: var(--gradient-primary);
    color: var(--white);
}

.table thead th {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    font-weight: 600;
    font-size: var(--font-size-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: none;
}

.table tbody td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--lighter);
    vertical-align: middle;
    color: var(--dark);
}

.table tbody tr {
    transition: background var(--transition-fast);
}

.table tbody tr:hover {
    background: var(--lighter);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table .badge {
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 3px 12px;
    border-radius: var(--radius-full);
}

.table .badge-success { background: var(--success-light); color: var(--success-dark); }
.table .badge-warning { background: var(--warning-light); color: var(--warning-dark); }
.table .badge-danger { background: var(--danger-light); color: var(--danger-dark); }
.table .badge-info { background: var(--info-light); color: var(--info-dark); }
.table .badge-primary { background: var(--primary-light); color: var(--white); }

.table .action-btns {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}

/* ===== Filter Card ===== */
.filter-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-5) var(--space-6);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    margin-bottom: var(--space-6);
}

.filter-card .filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-4);
    align-items: end;
}

.filter-card .filter-actions {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding-top: var(--space-2);
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: var(--z-modal-backdrop);
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-2xl);
    animation: modalSlideIn 0.3s ease;
}

.modal-container.modal-lg {
    max-width: 720px;
}

.modal-container.modal-xl {
    max-width: 900px;
}

.modal-header {
    padding: var(--space-4) var(--space-6);
    background: var(--gradient-primary);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.modal-header h5 {
    color: var(--white);
    margin-bottom: 0;
    font-weight: 600;
}

.modal-header .btn-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-lg);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.modal-header .btn-close:hover {
    background: rgba(255,255,255,0.3);
}

.modal-body {
    padding: var(--space-6);
}

.modal-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--lighter);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
    flex-wrap: wrap;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ===== Bill / Invoice Styles ===== */
.bill-wrapper {
    max-width: 210mm;
    margin: 0 auto;
}

.bill-container {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(0,0,0,0.04);
    position: relative;
}

.bill-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: 2px dashed var(--gray-lighter);
    margin-bottom: var(--space-6);
}

.bill-header .company-info .company-name {
    font-size: var(--font-size-3xl);
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.bill-header .company-info .company-tagline {
    color: var(--gray);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.bill-header .bill-meta {
    text-align: right;
}

.bill-header .bill-meta .bill-number {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary);
}

.bill-header .bill-meta .bill-date {
    color: var(--gray);
    font-size: var(--font-size-sm);
}

.bill-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
    background: var(--lighter);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    margin-bottom: var(--space-6);
}

.bill-details-grid .detail-item {
    display: flex;
    flex-direction: column;
}

.bill-details-grid .detail-item .label {
    font-size: var(--font-size-xs);
    color: var(--gray);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bill-details-grid .detail-item .value {
    font-weight: 600;
    color: var(--dark);
}

/* Bill Table */
.bill-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-6);
}

.bill-table thead {
    background: var(--primary-gradient);
    color: var(--white);
}

.bill-table thead th {
    padding: var(--space-3) var(--space-3);
    text-align: center;
    font-weight: 600;
    font-size: var(--font-size-xs);
    border: none;
}

.bill-table tbody td {
    padding: var(--space-3);
    border-bottom: 1px solid var(--lighter);
    text-align: center;
    vertical-align: middle;
}

.bill-table tbody td.text-start {
    text-align: left;
}

.bill-table tbody td.text-end {
    text-align: right;
}

/* Bill Summary */
.bill-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px solid var(--lighter);
}

.bill-summary .amount-words {
    background: var(--lighter);
    border-left: 4px solid var(--primary);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    font-style: italic;
    font-size: var(--font-size-sm);
}

.bill-summary .total-box {
    text-align: right;
}

.bill-summary .total-box .total-row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    font-size: var(--font-size-sm);
}

.bill-summary .total-box .total-row.grand-total {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--primary);
    border-top: 2px solid var(--primary);
    padding-top: var(--space-3);
    margin-top: var(--space-2);
}

.bill-footer {
    margin-top: var(--space-6);
    padding-top: var(--space-4);
    border-top: 1px dashed var(--gray-lighter);
    display: flex;
    justify-content: space-between;
    font-size: var(--font-size-xs);
    color: var(--gray);
}

/* ===== Product Grid ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-4);
}

.product-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all var(--transition-base);
    position: relative;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.product-card .product-image {
    width: 100%;
    height: 120px;
    background: var(--lighter);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--gray-light);
    margin-bottom: var(--space-3);
}

.product-card .product-name {
    font-weight: 600;
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card .product-sku {
    font-size: var(--font-size-xs);
    color: var(--gray);
}

.product-card .product-price {
    font-weight: 700;
    color: var(--primary);
    font-size: var(--font-size-lg);
}

.product-card .product-stock {
    font-size: var(--font-size-xs);
    color: var(--gray);
}

.product-card .stock-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

.product-card .stock-badge.in-stock {
    background: var(--success-light);
    color: var(--success-dark);
}

.product-card .stock-badge.low-stock {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.product-card .stock-badge.out-stock {
    background: var(--danger-light);
    color: var(--danger-dark);
}

/* ===== Category Cards ===== */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
}

.category-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all var(--transition-base);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card .category-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-3);
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--white);
}

.category-card .category-name {
    font-weight: 600;
    font-size: var(--font-size-base);
    margin-bottom: var(--space-1);
}

.category-card .category-count {
    font-size: var(--font-size-sm);
    color: var(--gray);
}

/* ===== Alerts ===== */
.alert {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    border: none;
}

.alert i {
    font-size: var(--font-size-xl);
    margin-top: 2px;
}

.alert .alert-content {
    flex: 1;
}

.alert .alert-content .alert-title {
    font-weight: 600;
    margin-bottom: 2px;
}

.alert .alert-content .alert-message {
    font-size: var(--font-size-sm);
    opacity: 0.9;
}

.alert .btn-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
    padding: 0;
    line-height: 1;
}

.alert .btn-close:hover {
    opacity: 1;
}

.alert-success {
    background: var(--success-light);
    color: var(--success-dark);
}

.alert-danger {
    background: var(--danger-light);
    color: var(--danger-dark);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning-dark);
}

.alert-info {
    background: var(--info-light);
    color: var(--info-dark);
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 3px 12px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-align: center;
    line-height: 1.5;
}

.badge-primary { background: var(--primary); color: var(--white); }
.badge-success { background: var(--success); color: var(--white); }
.badge-warning { background: var(--warning); color: var(--white); }
.badge-danger { background: var(--danger); color: var(--white); }
.badge-info { background: var(--info); color: var(--white); }
.badge-secondary { background: var(--secondary); color: var(--white); }
.badge-gray { background: var(--gray); color: var(--white); }

/* ===== Progress ===== */
.progress {
    height: 8px;
    background: var(--lighter);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-base);
}

.progress-bar.primary { background: var(--gradient-primary); }
.progress-bar.success { background: var(--gradient-success); }
.progress-bar.warning { background: var(--gradient-warning); }
.progress-bar.danger { background: var(--gradient-danger); }
.progress-bar.info { background: var(--gradient-info); }

/* ===== Tabs ===== */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--lighter);
    margin-bottom: var(--space-6);
    overflow-x: auto;
    padding-bottom: 0;
}

.tabs .tab {
    padding: var(--space-3) var(--space-6);
    font-weight: 600;
    color: var(--gray);
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-size: var(--font-size-sm);
}

.tabs .tab:hover {
    color: var(--primary);
}

.tabs .tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* ===== POS Specific Styles ===== */
.product-row {
    background: var(--lighter);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-4);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}

.product-row:hover {
    border-color: var(--primary-light);
}

.product-row .remove-product {
    color: var(--danger);
    cursor: pointer;
    font-size: var(--font-size-xl);
    transition: all var(--transition-fast);
    padding: var(--space-2);
}

.product-row .remove-product:hover {
    transform: scale(1.2);
}

.summary-card {
    background: var(--gradient-primary);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin-top: var(--space-4);
}

.summary-card .form-control {
    background: rgba(255,255,255,0.15);
    border: 2px solid rgba(255,255,255,0.2);
    color: var(--white);
}

.summary-card .form-control:focus {
    background: rgba(255,255,255,0.25);
    border-color: var(--white);
    box-shadow: none;
}

.summary-card .form-control::placeholder {
    color: rgba(255,255,255,0.6);
}

.summary-card .form-label {
    color: rgba(255,255,255,0.9);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: var(--space-6);
    right: var(--space-6);
    z-index: var(--z-tooltip);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    max-width: 380px;
    width: 100%;
}

.toast {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    animation: slideInRight 0.4s ease;
    border-left: 4px solid var(--primary);
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info { border-left-color: var(--info); }

.toast .toast-icon {
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.toast .toast-content {
    flex: 1;
}

.toast .toast-content .toast-title {
    font-weight: 600;
    font-size: var(--font-size-sm);
}

.toast .toast-content .toast-message {
    font-size: var(--font-size-sm);
    color: var(--gray);
}

.toast .toast-close {
    background: none;
    border: none;
    font-size: var(--font-size-xl);
    color: var(--gray);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    padding: var(--space-4);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.login-page .login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: var(--space-8) var(--space-10);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-2xl);
    position: relative;
    z-index: 1;
    animation: slideUp 0.5s ease;
}

.login-page .login-card .login-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.login-page .login-card .login-header .logo {
    width: 72px;
    height: 72px;
    
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-4);
    font-size: 32px;
    color: var(--white);
}

.login-page .login-card .login-header h2 {
    margin-bottom: var(--space-1);
}

.login-page .login-card .login-header p {
    color: var(--gray);
    font-size: var(--font-size-sm);
    margin-bottom: 0;
}

.login-page .login-card .login-form .form-group {
    margin-bottom: var(--space-4);
}

.login-page .login-card .login-form .form-group .input-group {
    position: relative;
}

.login-page .login-card .login-form .form-group .input-group .input-icon {
    position: absolute;
    left: var(--space-4);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-light);
    z-index: 1;
}

.login-page .login-card .login-form .form-group .input-group .form-control {
    padding-left: 44px;
}

.login-page .login-card .login-footer {
    text-align: center;
    margin-top: var(--space-6);
    font-size: var(--font-size-sm);
    color: var(--gray);
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

.slide-up {
    animation: slideUp 0.5s ease;
}

.slide-down {
    animation: slideDown 0.5s ease;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ===== Utility Classes ===== */
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-warning { color: var(--warning) !important; }
.text-danger { color: var(--danger) !important; }
.text-info { color: var(--info) !important; }
.text-gray { color: var(--gray) !important; }
.text-white { color: var(--white) !important; }
.text-dark { color: var(--dark) !important; }

.bg-primary { background: var(--gradient-primary) !important; }
.bg-success { background: var(--gradient-success) !important; }
.bg-warning { background: var(--gradient-warning) !important; }
.bg-danger { background: var(--gradient-danger) !important; }
.bg-info { background: var(--gradient-info) !important; }
.bg-light { background: var(--light) !important; }
.bg-white { background: var(--white) !important; }

.shadow-sm { box-shadow: var(--shadow-sm) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-lg { box-shadow: var(--shadow-lg) !important; }
.shadow-xl { box-shadow: var(--shadow-xl) !important; }

.rounded-sm { border-radius: var(--radius-sm) !important; }
.rounded-md { border-radius: var(--radius-md) !important; }
.rounded-lg { border-radius: var(--radius-lg) !important; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.rounded-full { border-radius: var(--radius-full) !important; }

.d-flex { display: flex !important; }
.d-none { display: none !important; }
.d-block { display: block !important; }
.flex-column { flex-direction: column !important; }
.flex-wrap { flex-wrap: wrap !important; }
.justify-content-start { justify-content: flex-start !important; }
.justify-content-end { justify-content: flex-end !important; }
.justify-content-center { justify-content: center !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-end { align-items: flex-end !important; }
.align-items-center { align-items: center !important; }
.gap-1 { gap: var(--space-1) !important; }
.gap-2 { gap: var(--space-2) !important; }
.gap-3 { gap: var(--space-3) !important; }
.gap-4 { gap: var(--space-4) !important; }

.w-100 { width: 100% !important; }
.w-50 { width: 50% !important; }
.h-100 { height: 100% !important; }

.m-0 { margin: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-5 { margin-bottom: var(--space-5) !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: var(--space-1) !important; }
.p-2 { padding: var(--space-2) !important; }
.p-3 { padding: var(--space-3) !important; }
.p-4 { padding: var(--space-4) !important; }
.p-5 { padding: var(--space-5) !important; }

.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }
.text-uppercase { text-transform: uppercase !important; }
.text-lowercase { text-transform: lowercase !important; }
.text-capitalize { text-transform: capitalize !important; }

.fw-300 { font-weight: 300 !important; }
.fw-400 { font-weight: 400 !important; }
.fw-500 { font-weight: 500 !important; }
.fw-600 { font-weight: 600 !important; }
.fw-700 { font-weight: 700 !important; }
.fw-800 { font-weight: 800 !important; }

.fs-xs { font-size: var(--font-size-xs) !important; }
.fs-sm { font-size: var(--font-size-sm) !important; }
.fs-base { font-size: var(--font-size-base) !important; }
.fs-lg { font-size: var(--font-size-lg) !important; }
.fs-xl { font-size: var(--font-size-xl) !important; }
.fs-2xl { font-size: var(--font-size-2xl) !important; }

.cursor-pointer { cursor: pointer !important; }
.cursor-default { cursor: default !important; }

.overflow-hidden { overflow: hidden !important; }
.overflow-auto { overflow: auto !important; }
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

.z-index-1 { z-index: 1 !important; }
.z-index-10 { z-index: 10 !important; }
.z-index-100 { z-index: 100 !important; }

.border { border: 1px solid var(--gray-lighter) !important; }
.border-top { border-top: 1px solid var(--gray-lighter) !important; }
.border-bottom { border-bottom: 1px solid var(--gray-lighter) !important; }
.border-left { border-left: 1px solid var(--gray-lighter) !important; }
.border-right { border-right: 1px solid var(--gray-lighter) !important; }
.border-0 { border: 0 !important; }

/* ===== Print Styles ===== */
@media print {
    .sidebar,
    .no-print,
    .menu-toggle,
    .action-buttons,
    .btn,
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_paginate,
    .filter-card .filter-actions {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        padding: 0 !important;
        background: var(--white) !important;
    }
    
    .bill-container {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        padding: var(--space-4) !important;
        border-radius: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .table thead {
        background: #f8f9fa !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .table thead th {
        background: #f8f9fa !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .badge,
    .status-badge {
        border: 1px solid #000 !important;
        background: transparent !important;
        color: #000 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ===== Responsive Design ===== */

/* Tablets & Smaller Desktops */
@media (max-width: 1200px) {
    .sidebar {
        width: 240px;
    }
    .main-content {
        margin-left: 240px;
    }
    .bill-header {
        grid-template-columns: 1fr;
    }
    .bill-header .bill-meta {
        text-align: left;
    }
    .bill-summary {
        grid-template-columns: 1fr;
    }
    .bill-summary .total-box {
        text-align: left;
    }
}

/* Tablets */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: var(--shadow-2xl);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: var(--space-4);
    }
    
    .menu-toggle {
        display: flex !important;
        position: fixed;
        top: var(--space-4);
        left: var(--space-4);
        z-index: var(--z-fixed);
        background: var(--gradient-primary);
        color: var(--white);
        border: none;
        border-radius: var(--radius-md);
        width: 44px;
        height: 44px;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: var(--shadow-lg);
        font-size: var(--font-size-xl);
    }
    
    .menu-toggle i {
        color: var(--white);
    }
    
    .page-header {
        margin-top: 56px;
    }
    
    .stat-card .stat-value {
        font-size: var(--font-size-xl);
    }
    
    .filter-card .filter-row {
        grid-template-columns: 1fr 1fr;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* Mobile */
@media (max-width: 768px) {
    .main-content {
        padding: var(--space-3);
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-3);
        margin-top: 56px;
    }
    
    .page-header .header-actions {
        flex-wrap: wrap;
    }
    
    .page-header .header-actions .btn {
        flex: 1;
        justify-content: center;
        min-width: 80px;
    }
    
    .card-body {
        padding: var(--space-4);
    }
    
    .stat-card {
        padding: var(--space-4);
    }
    
    .stat-card .stat-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }
    
    .stat-card .stat-value {
        font-size: var(--font-size-xl);
    }
    
    .filter-card .filter-row {
        grid-template-columns: 1fr;
    }
    
    .filter-card {
        padding: var(--space-4);
    }
    
    .modal-container {
        margin: var(--space-4);
        max-width: 100%;
    }
    
    .modal-container.modal-lg,
    .modal-container.modal-xl {
        max-width: 100%;
    }
    
    .modal-body {
        padding: var(--space-4);
    }
    
    .bill-container {
        padding: var(--space-4);
    }
    
    .bill-details-grid {
        grid-template-columns: 1fr;
    }
    
    .bill-table {
        font-size: var(--font-size-xs);
    }
    
    .bill-table thead th,
    .bill-table tbody td {
        padding: var(--space-2);
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .toast-container {
        left: var(--space-4);
        right: var(--space-4);
        bottom: var(--space-4);
        max-width: 100%;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
    
    .page-header h2 {
        font-size: var(--font-size-xl);
    }
    
    .page-header h2 .header-icon {
        width: 36px;
        height: 36px;
        font-size: var(--font-size-base);
    }
    
    .btn {
        font-size: var(--font-size-xs);
        padding: var(--space-2) var(--space-3);
    }
    
    .btn-icon {
        width: 34px;
        height: 34px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .table {
        font-size: var(--font-size-xs);
    }
    
    .table thead th,
    .table tbody td {
        padding: var(--space-2);
        white-space: nowrap;
    }
    
    .product-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }
    
    .product-card {
        padding: var(--space-3);
    }
    
    .product-card .product-image {
        height: 80px;
        font-size: 28px;
    }
    
    .login-page .login-card {
        padding: var(--space-6);
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Dark Mode Support ===== */
@media (prefers-color-scheme: dark) {
    :root {
        --light: #0f172a;
        --lighter: #1e293b;
        --dark: #f8fafc;
        --gray: #94a3b8;
        --gray-light: #64748b;
        --gray-lighter: #334155;
        --white: #1e293b;
    }
    
    .card,
    .stat-card,
    .product-card,
    .category-card,
    .filter-card {
        background: var(--white);
        border-color: var(--gray-lighter);
    }
    
    .card-header {
        background: var(--white);
        border-color: var(--gray-lighter);
    }
    
    .table tbody td {
        border-color: var(--gray-lighter);
        color: var(--dark);
    }
    
    .table tbody tr:hover {
        background: var(--lighter);
    }
    
    .form-control,
    .form-select {
        background: var(--lighter);
        border-color: var(--gray-lighter);
        color: var(--dark);
    }
    
    .form-control:focus,
    .form-select:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 4px rgba(67, 97, 238, 0.15);
    }
    
    .form-control::placeholder {
        color: var(--gray);
    }
    
    .modal-container {
        background: var(--white);
    }
    
    .modal-footer {
        border-color: var(--gray-lighter);
    }
    
    .bill-container {
        background: var(--white);
    }
    
    .bill-details-grid {
        background: var(--lighter);
    }
    
    .bill-summary .amount-words {
        background: var(--lighter);
    }
    
    .product-row {
        background: var(--lighter);
    }
    
    .product-row:hover {
        border-color: var(--primary-light);
    }
    
    .sidebar {
        background: var(--white);
        border-color: var(--gray-lighter);
    }
    
    .sidebar .sidebar-header {
        background: var(--gradient-primary);
    }
    
    .sidebar .nav-link:hover {
        background: var(--lighter);
    }
    
    .sidebar .nav-link.active {
        background: var(--gradient-primary);
    }
    
    .login-page .login-card {
        background: var(--white);
    }
    
    .toast {
        background: var(--white);
    }
    
    .dropdown-menu {
        background: var(--white);
        border-color: var(--gray-lighter);
    }
}