/* ==========================================================================
   SysEz POS System - Main Stylesheet
   ========================================================================== */

/* ==========================================================================
   1. CSS Variables
   ========================================================================== */
:root {
    --primary: #4F46E5;
    --primary-dark: #3730A3;
    --primary-light: #818CF8;
    --secondary: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    --dark: #1E293B;
    --gray: #64748B;
    --light: #F1F5F9;
    --white: #FFFFFF;
    --sidebar-width: 260px;
    --header-height: 64px;
    --border-radius: 8px;
    --shadow: 0 1px 3px rgba(0, 0, 0, .1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, .1);
    --transition: all .3s ease;
}

/* ==========================================================================
   2. Reset / Normalize
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 0.9375rem;
    line-height: 1.6;
    background-color: var(--light);
    color: var(--dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
}

input, select, textarea {
    font-family: inherit;
    font-size: inherit;
}

/* ==========================================================================
   3. Layout - Sidebar
   ========================================================================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--dark);
    color: var(--white);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    transition: var(--transition);
}

/* Brand */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    height: var(--header-height);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.sidebar-brand .brand-icon {
    font-size: 1.75rem;
    color: var(--primary-light);
}

.sidebar-brand .brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand .brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-brand .brand-subtitle {
    font-size: 0.6875rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Sidebar Nav */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 2px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.875rem;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.05);
    border-left-color: var(--primary-light);
}

.nav-link.active {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: var(--primary);
}

.nav-link .material-icons-outlined {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 0.6875rem;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8125rem;
    padding: 6px 10px;
    border-radius: 6px;
    transition: var(--transition);
}

.sidebar-logout:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-logout .material-icons-outlined {
    font-size: 1.125rem;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

body.sidebar-open .sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open .sidebar {
    transform: translateX(0) !important;
}

/* ==========================================================================
   4. Layout - Header
   ========================================================================== */
.header-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    height: var(--header-height);
    background-color: var(--white);
    box-shadow: var(--shadow);
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    transition: var(--transition);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Hamburger / Menu Toggle */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--dark);
    transition: var(--transition);
}

.menu-toggle:hover {
    background-color: var(--light);
}

.header-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
}

/* Header Search */
.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--light);
    border-radius: 6px;
    padding: 6px 14px;
    transition: var(--transition);
    border: 1px solid transparent;
}

.header-search:focus-within {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.header-search .material-icons-outlined {
    font-size: 1.125rem;
    color: var(--gray);
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.8125rem;
    color: var(--dark);
    width: 200px;
}

.header-search input::placeholder {
    color: #94A3B8;
}

/* Header Icon Button */
.header-icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    color: var(--gray);
    transition: var(--transition);
    position: relative;
}

.header-icon-btn:hover {
    background-color: var(--light);
    color: var(--dark);
}

/* User Dropdown */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 4px 4px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.user-dropdown-toggle:hover {
    background-color: var(--light);
}

.user-dropdown-toggle .user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    flex-shrink: 0;
}

.user-dropdown-toggle .user-name {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dark);
}

.user-dropdown-toggle .material-icons-outlined {
    font-size: 1.125rem;
    color: var(--gray);
    transition: var(--transition);
}

.user-dropdown.open .user-dropdown-toggle .material-icons-outlined:last-child {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid #E2E8F0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 1100;
    overflow: hidden;
}

.user-dropdown.open .user-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--dark);
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: var(--light);
}

.dropdown-item .material-icons-outlined {
    font-size: 1.125rem;
    color: var(--gray);
}

.dropdown-item-danger {
    color: var(--danger);
}

.dropdown-item-danger .material-icons-outlined {
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 4px 0;
}

/* ==========================================================================
   5. Layout - Main Content
   ========================================================================== */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--header-height);
    min-height: 100vh;
    transition: var(--transition);
}

.content-wrapper {
    padding: 24px;
}

/* Flash Messages */
.flash-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    margin: 16px 24px;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    position: relative;
}

.flash-success {
    background: #D1FAE5;
    color: #065F46;
    border-left: 4px solid var(--secondary);
}

.flash-error {
    background: #FEE2E2;
    color: #991B1B;
    border-left: 4px solid var(--danger);
}

.flash-warning {
    background: #FEF3C7;
    color: #92400E;
    border-left: 4px solid var(--warning);
}

.flash-message .material-icons-outlined {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.flash-close {
    margin-left: auto;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
    padding: 0 4px;
}

.flash-close:hover {
    opacity: 1;
}

/* ==========================================================================
   6. Page Header (used on list pages)
   ========================================================================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header-title {
    font-size: 1.25rem;
    font-weight: 700;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 16px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

/* ==========================================================================
   7. Cards
   ========================================================================== */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #E2E8F0;
    font-weight: 600;
    font-size: 1rem;
}

.card-header .card-title {
    font-weight: 600;
    font-size: 1rem;
}

.card-body {
    /* inherits card padding */
}

.card-footer {
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #E2E8F0;
}

/* ==========================================================================
   8. Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.5;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    user-select: none;
    color: var(--white);
}

.btn:active {
    transform: scale(0.97);
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #059669;
}

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

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-warning {
    background-color: var(--warning);
    color: var(--white);
}

.btn-warning:hover {
    background-color: #D97706;
}

.btn-outline {
    background-color: transparent;
    color: var(--dark);
    border-color: #E2E8F0;
}

.btn-outline:hover {
    background-color: var(--light);
    border-color: #CBD5E1;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.8125rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 6px;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* ==========================================================================
   9. Forms
   ========================================================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.form-control {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--dark);
    background-color: var(--white);
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    transition: var(--transition);
    outline: none;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-control::placeholder {
    color: #94A3B8;
}

.form-select {
    display: block;
    width: 100%;
    padding: 10px 36px 10px 14px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--dark);
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2364748B' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    transition: var(--transition);
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ==========================================================================
   10. Tables
   ========================================================================== */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
}

thead {
    background-color: var(--light);
}

thead th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray);
}

tbody tr {
    border-bottom: 1px solid #E2E8F0;
    transition: var(--transition);
}

tbody tr:last-child {
    border-bottom: none;
}

tbody tr:hover {
    background-color: #F8FAFC;
}

td, th {
    padding: 12px 16px;
    text-align: left;
}

/* ==========================================================================
   11. Badges
   ========================================================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-primary {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.badge-success {
    background-color: #D1FAE5;
    color: #065F46;
}

.badge-danger {
    background-color: #FEE2E2;
    color: #991B1B;
}

.badge-warning {
    background-color: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.badge-secondary {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

/* ==========================================================================
   12. Alerts
   ========================================================================== */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    border-left: 4px solid transparent;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.alert-success {
    background-color: #D1FAE5;
    border-left-color: var(--secondary);
    color: #065F46;
}

.alert-danger {
    background-color: #FEE2E2;
    border-left-color: var(--danger);
    color: #991B1B;
}

.alert-warning {
    background-color: #FEF3C7;
    border-left-color: var(--warning);
    color: #92400E;
}

.alert-info {
    background-color: #DBEAFE;
    border-left-color: var(--info);
    color: #1E40AF;
}

/* ==========================================================================
   13. Dashboard Stats
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.icon-primary {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.stat-card .stat-icon.icon-secondary {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--secondary);
}

.stat-card .stat-icon.icon-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-card .stat-icon.icon-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.stat-card .stat-icon.icon-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-card .stat-content {
    flex: 1;
    min-width: 0;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark);
}

.stat-card .stat-label {
    font-size: 0.8125rem;
    color: var(--gray);
    margin-top: 4px;
}

/* ==========================================================================
   14. Modal
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 560px;
    box-shadow: var(--shadow-lg);
    transform: translateY(-10px) scale(0.98);
    transition: var(--transition);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #E2E8F0;
    flex-shrink: 0;
}

.modal-header .modal-title {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-header .modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

.modal-header .modal-close:hover {
    background-color: var(--light);
    color: var(--dark);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid #E2E8F0;
    flex-shrink: 0;
}

/* ==========================================================================
   15. Grid System
   ========================================================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col-1  { flex: 0 0 8.3333%;  max-width: 8.3333%;  padding: 0.5rem; }
.col-2  { flex: 0 0 16.6667%; max-width: 16.6667%; padding: 0.5rem; }
.col-3  { flex: 0 0 25%;      max-width: 25%;      padding: 0.5rem; }
.col-4  { flex: 0 0 33.3333%; max-width: 33.3333%; padding: 0.5rem; }
.col-5  { flex: 0 0 41.6667%; max-width: 41.6667%; padding: 0.5rem; }
.col-6  { flex: 0 0 50%;      max-width: 50%;      padding: 0.5rem; }
.col-7  { flex: 0 0 58.3333%; max-width: 58.3333%; padding: 0.5rem; }
.col-8  { flex: 0 0 66.6667%; max-width: 66.6667%; padding: 0.5rem; }
.col-9  { flex: 0 0 75%;      max-width: 75%;      padding: 0.5rem; }
.col-10 { flex: 0 0 83.3333%; max-width: 83.3333%; padding: 0.5rem; }
.col-11 { flex: 0 0 91.6667%; max-width: 91.6667%; padding: 0.5rem; }
.col-12 { flex: 0 0 100%;     max-width: 100%;     padding: 0.5rem; }

/* ==========================================================================
   16. POS - Point of Sale Layout
   ========================================================================== */
.pos-container {
    height: 100vh;
    display: grid;
    grid-template-columns: 1fr 380px;
    overflow: hidden;
}

.pos-products {
    overflow-y: auto;
    padding: 20px;
    background-color: var(--light);
}

.pos-cart {
    background: var(--white);
    border-left: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pos-cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid #E2E8F0;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
}

.pos-product-card {
    background: var(--white);
    border: 1px solid #E2E8F0;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-align: center;
    padding: 12px;
    transition: var(--transition);
}

.pos-product-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.pos-product-card img,
.pos-product-card .product-img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
}

.pos-product-card .product-name {
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pos-product-card .product-price {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid #E2E8F0;
    gap: 12px;
}

.pos-cart-item .item-info {
    flex: 1;
    min-width: 0;
}

.pos-cart-item .item-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.pos-cart-item .item-qty {
    font-size: 0.8125rem;
    color: var(--gray);
}

.pos-cart-item .item-price {
    font-weight: 600;
    white-space: nowrap;
}

.pos-cart-item .item-remove {
    color: var(--danger);
    cursor: pointer;
    opacity: 0.6;
    transition: var(--transition);
}

.pos-cart-item .item-remove:hover {
    opacity: 1;
}

.pos-total {
    padding: 20px;
    background: var(--dark);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.pos-total .total-label {
    font-size: 0.875rem;
    font-weight: 500;
    opacity: 0.7;
}

.pos-actions {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    flex-shrink: 0;
    border-top: 1px solid #E2E8F0;
}

/* ==========================================================================
   17. Search Box
   ========================================================================== */
.search-box {
    position: relative;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray);
    font-size: 1rem;
    pointer-events: none;
}

.search-box input {
    padding-left: 42px;
    width: 100%;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 14px;
    font-size: 0.875rem;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    outline: none;
    background: var(--white);
    transition: var(--transition);
    color: var(--dark);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.search-box input::placeholder {
    color: #94A3B8;
}

/* ==========================================================================
   18. Pagination
   ========================================================================== */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--dark);
    background: var(--white);
    border: 1px solid #E2E8F0;
    cursor: pointer;
    transition: var(--transition);
}

.pagination a:hover {
    background-color: var(--light);
    border-color: #CBD5E1;
}

.pagination a.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination a.disabled,
.pagination span.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* ==========================================================================
   19. Tabs (for settings/reports)
   ========================================================================== */
.tabs {
    display: flex;
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: 1.5rem;
    gap: 0;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--dark);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ==========================================================================
   20. Utilities - Text
   ========================================================================== */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-left    { text-align: left; }

.text-primary   { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-danger    { color: var(--danger); }
.text-warning   { color: var(--warning); }
.text-info      { color: var(--info); }
.text-muted     { color: var(--gray); }
.text-white     { color: var(--white); }

.fw-bold { font-weight: 700; }
.fw-500  { font-weight: 500; }
.fw-600  { font-weight: 600; }

.fs-sm { font-size: 0.875rem; }
.fs-lg { font-size: 1.125rem; }
.fs-xl { font-size: 1.5rem; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   21. Utilities - Spacing
   ========================================================================== */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }

/* ==========================================================================
   22. Utilities - Flex / Display
   ========================================================================== */
.d-flex         { display: flex; }
.d-grid         { display: grid; }
.align-center   { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap      { flex-wrap: wrap; }
.flex-column    { flex-direction: column; }
.gap-1          { gap: 0.25rem; }
.gap-2          { gap: 0.5rem; }
.gap-3          { gap: 1rem; }

.w-100 { width: 100%; }

.hidden { display: none; }

/* ==========================================================================
   23. Animations
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes spin {
    to { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* ==========================================================================
   24. Custom Scrollbar
   ========================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

/* ==========================================================================
   25. Responsive - Tablet (max-width: 1200px)
   ========================================================================== */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .header-search {
        display: none;
    }
}

/* ==========================================================================
   26. Responsive - Mobile (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .main-content {
        margin-left: 0;
    }

    .header-bar {
        left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .content-wrapper {
        padding: 16px;
    }

    .flash-message {
        margin: 12px 16px;
    }

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

    .pos-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .pos-cart {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 50vh;
        border-left: none;
        border-top: 1px solid #E2E8F0;
        z-index: 1001;
        transform: translateY(100%);
        transition: var(--transition);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    }

    .pos-cart.active {
        transform: translateY(0);
    }

    .pos-products {
        padding: 12px;
        padding-bottom: 80px;
    }

    .pos-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 10px;
    }

    table {
        font-size: 0.8125rem;
    }

    td, th {
        padding: 8px 12px;
    }

    .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
    .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .hide-mobile {
        display: none;
    }

    .modal {
        max-width: 100%;
        margin: 12px;
    }

    .pos-actions {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 1rem;
    }

    .row {
        margin: -0.25rem;
    }

    .row > [class*="col-"] {
        padding: 0.25rem;
    }

    .header-search {
        display: none;
    }

    .user-dropdown-toggle .user-name {
        display: none;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   27. Print Styles
   ========================================================================== */
@media print {
    .sidebar,
    .header-bar,
    .menu-toggle,
    .no-print,
    .sidebar-overlay,
    .modal-overlay,
    .pos-actions {
        display: none !important;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 0 !important;
    }

    body {
        background: white;
        color: black;
        font-size: 12pt;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }

    table {
        font-size: 10pt;
    }

    a {
        color: black;
    }
}
