/* Shemex POS - Enhanced UI/UX Theme (Redesigned) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap'); /* For numerical/data density */

:root {
    /* --- Brand Palette (Refined Indigo) --- */
    --primary: #4f46e5;       /* Indigo 600 - Vibrant but professional */
    --primary-hover: #4338ca; /* Indigo 700 */
    --primary-active: #3730a3; /* Indigo 800 */
    --primary-subtle: #eef2ff; /* Indigo 50 */
    --primary-text: #312e81;   /* Indigo 900 */

    /* --- Functional Colors --- */
    --success: #10b981;       /* Emerald 500 */
    --success-subtle: #d1fae5;
    --warning: #f59e0b;       /* Amber 500 */
    --warning-subtle: #fef3c7;
    --danger: #ef4444;        /* Red 500 */
    --danger-subtle: #fee2e2;
    --info: #0ea5e9;          /* Sky 500 */
    
    /* --- Neutrals & Surfaces --- */
    --bg-body: #f1f5f9;       /* Slate 100 - Warmer grey for background */
    --bg-surface: #f8fafc;    /* Slate 50 */
    --bg-card: #ffffff;
    
    --border: #e2e8f0;        /* Slate 200 */
    --border-hover: #cbd5e1;  /* Slate 300 */
    
    --text-heading: #0f172a;  /* Slate 900 */
    --text-body: #334155;     /* Slate 700 */
    --text-muted: #64748b;    /* Slate 500 */
    --text-light: #94a3b8;    /* Slate 400 */

    /* --- Shadows (Soft & Diffused) --- */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px -1px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.04);
    --shadow-focus: 0 0 0 3px rgba(79, 70, 229, 0.2); /* Ring for focus */

    /* --- Metrics --- */
    --radius-sm: 0.5rem;   /* 8px */
    --radius-md: 0.75rem;  /* 12px */
    --radius-lg: 1rem;     /* 16px */
    --radius-xl: 1.5rem;   /* 24px */
    
    --nav-width: 280px;
    --header-height: 70px;

    /* --- Density tokens --- */
    --content-pad: 1.5rem;
    --control-height: 44px;
    --control-radius: var(--radius-md);

    --btn-pad-y: 0.625rem;
    --btn-pad-x: 1.25rem;
    --btn-sm-pad-y: 0.35rem;
    --btn-sm-pad-x: 0.75rem;

    --nav-link-pad-y: 0.85rem;
    --nav-link-pad-x: 1.25rem;

    --table-cell-pad-y: 0.7rem;
    --table-cell-pad-x: 0.75rem;
    --table-head-font-size: 0.72rem;
    --table-head-letter-spacing: 0.06em;

    --list-item-pad-y: 0.85rem;
    --list-item-pad-x: 1rem;

    /* POS density */
    --pos-pad: 1rem;
    --pos-gap: 1rem;
    --pos-search-height: 3.25rem;
    --pos-cat-pad-y: 0.6rem;
    --pos-cat-pad-x: 1.25rem;
    --pos-cart-header-pad-y: 1rem;
    --pos-cart-header-pad-x: 1.25rem;
    --pos-cart-pad: 0.75rem;

    --pos-card-img-h: 120px;
    --pos-card-body-pad: 0.85rem;
    --pos-title-size: 0.95rem;
    --pos-price-size: 1.05rem;
    --pos-cart-item-pad: 0.75rem;

    /* Bootstrap color sync (keeps bg-opacity utilities working) */
    --bs-primary: var(--primary);
    --bs-primary-rgb: 79, 70, 229;
    --bs-secondary: #64748b; /* aligns to --text-muted */
    --bs-secondary-rgb: 100, 116, 139;
    --bs-success: var(--success);
    --bs-success-rgb: 16, 185, 129;
    --bs-warning: var(--warning);
    --bs-warning-rgb: 245, 158, 11;
    --bs-danger: var(--danger);
    --bs-danger-rgb: 239, 68, 68;
    --bs-info: var(--info);
    --bs-info-rgb: 14, 165, 233;

    /* Bootstrap neutral system alignment */
    --bs-body-bg: var(--bg-body);
    --bs-body-color: var(--text-body);
    --bs-emphasis-color: var(--text-heading);
    --bs-secondary-color: var(--text-muted);
    --bs-tertiary-color: var(--text-light);

    --bs-border-color: var(--border);
    --bs-border-color-translucent: rgba(226, 232, 240, 0.70);

    --bs-secondary-bg: var(--bg-surface);
    --bs-tertiary-bg: var(--bg-surface);

    --bs-light-rgb: 248, 250, 252; /* aligns to --bg-surface */
    --bs-dark-rgb: 15, 23, 42;     /* aligns to --text-heading */

    --bs-link-color: var(--primary);
    --bs-link-hover-color: var(--primary-hover);
}

/* --- Base Reset & Typography --- */
html, body {
    height: 100%;
    margin: 0;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    font-size: 0.9375rem; /* 15px base */
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    overflow-y: auto;
}

/* App shell uses its own scroll container (container-fluid overflow-auto) */
body.mode-standard,
body.mode-compact,
body.mode-touch {
    overflow: hidden;
}

h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
    color: var(--text-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

/* --- Layout Structure --- */
.sidebar {
    width: var(--nav-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    z-index: 50;
    transition: transform 0.3s ease;
}

.navbar-custom {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    z-index: 40;
}

.main-content {
    background-color: var(--bg-body);
}

/* --- Utilities: colors & typography --- */
.bg-surface { background-color: var(--bg-surface) !important; }
.bg-card { background-color: var(--bg-card) !important; }
.bg-primary-subtle { background-color: var(--primary-subtle) !important; }
.text-heading { color: var(--text-heading) !important; }
.text-body { color: var(--text-body) !important; }
.text-muted { color: var(--text-muted) !important; }
.text-light { color: var(--text-light) !important; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-xxs { font-size: 0.6875rem; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.03em; }
.tracking-wider { letter-spacing: 0.06em; }
.letter-spacing-1 { letter-spacing: 0.08em; }
.letter-spacing-2 { letter-spacing: 0.14em; }
.cursor-pointer { cursor: pointer; }
.hover-underline:hover { text-decoration: underline !important; }

.fw-medium { font-weight: 500 !important; }

.z-1 { z-index: 1 !important; }
.z-20 { z-index: 20 !important; }

.overflow-y-auto { overflow-y: auto !important; }
.border-transparent { border-color: transparent !important; }

/* --- Accessibility & motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

:is(a, button, input, select, textarea, .btn, .nav-link-custom, .dropdown-item):focus-visible {
    outline: none;
    box-shadow: var(--shadow-focus) !important;
    border-color: var(--primary) !important;
}

/* --- Forms --- */
.form-control,
.form-select,
.input-group-text {
    border-radius: var(--control-radius);
}

.form-control,
.form-select {
    border-color: var(--border);
    min-height: var(--control-height);
}

.form-control-sm,
.form-select-sm {
    min-height: 34px;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.form-control-lg,
.form-select-lg {
    min-height: 52px;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

/* Checkboxes & switches (Settings toggles, permission checklists) */
.form-check-input {
    border-color: var(--border);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-switch .form-check-input {
    width: 2.75em;
    height: 1.45em;
    margin-top: 0.2em;
    background-color: rgba(100, 116, 139, 0.25);
    border-color: rgba(100, 116, 139, 0.35);
}

.form-switch .form-check-input:checked {
    background-color: rgba(79, 70, 229, 0.85);
    border-color: rgba(79, 70, 229, 0.85);
}

body.mode-touch .form-switch .form-check-input {
    width: 3.1em;
    height: 1.65em;
}

.input-group .input-group-text {
    border-color: var(--border);
    color: var(--text-muted);
}

.input-group .input-group-text + .form-control {
    border-left: 0;
}

/* Improve numeric alignment for dense UIs */
.font-monospace {
    font-variant-numeric: tabular-nums;
}

/* --- Component: Buttons --- */
.btn {
    font-weight: 600;
    padding: var(--btn-pad-y) var(--btn-pad-x);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
}

.btn-sm {
    padding: var(--btn-sm-pad-y) var(--btn-sm-pad-x);
}

/* Keep link-style buttons clean (used for icon menus) */
.btn-link {
    border-color: transparent !important;
    box-shadow: none !important;
}

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

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 4px 6px rgba(79, 70, 229, 0.25);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--border);
    background: white;
}
.btn-outline-primary:hover {
    background: var(--primary-subtle);
    border-color: var(--primary);
    color: var(--primary-active);
}

.btn-outline-secondary {
    color: var(--text-body);
    border-color: var(--border);
    background: var(--bg-card);
}

.btn-outline-secondary:hover {
    background: var(--bg-surface);
    border-color: var(--border-hover);
    color: var(--text-heading);
}

.btn-light {
    background: var(--bg-surface);
    border-color: var(--border);
    color: var(--text-body);
}
.btn-light:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.btn.btn-white {
    background: var(--bg-card);
    border-color: var(--border);
}
.btn.btn-white:hover {
    background: var(--bg-surface);
    border-color: var(--border-hover);
}

.hover-lift:hover { transform: translateY(-1px); }
.hover-lift:active { transform: translateY(0); }

.shadow-xs { box-shadow: var(--shadow-xs) !important; }
.shadow-md { box-shadow: var(--shadow-md) !important; }
.shadow-up { box-shadow: 0 -10px 20px rgba(0,0,0,0.06); }

/* --- Component: Cards --- */
.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card-header,
.card-footer {
    background: var(--bg-card);
    border-color: var(--border);
}

.card-header {
    font-weight: 800;
}

.card-hover:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-subtle);
    transform: translateY(-2px);
    cursor: pointer;
}

/* Many screens use `.card-hover` without `.card` */
.card-hover {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

/* --- Badges --- */
.badge {
    font-weight: 700;
    border-radius: 999px;
}

.badge-soft-primary { background: var(--primary-subtle); color: var(--primary-text); border: 1px solid rgba(79, 70, 229, 0.18); }
.badge-soft-secondary { background: rgba(100, 116, 139, 0.12); color: #334155; border: 1px solid rgba(100, 116, 139, 0.22); }
.badge-soft-success { background: var(--success-subtle); color: #065f46; border: 1px solid rgba(16, 185, 129, 0.20); }
.badge-soft-warning { background: var(--warning-subtle); color: #92400e; border: 1px solid rgba(245, 158, 11, 0.22); }
.badge-soft-danger { background: var(--danger-subtle); color: #991b1b; border: 1px solid rgba(239, 68, 68, 0.22); }
.badge-soft-info { background: rgba(14, 165, 233, 0.12); color: #075985; border: 1px solid rgba(14, 165, 233, 0.22); }

/* --- Alerts --- */
.alert {
    border-radius: var(--radius-lg);
}

.alert-success {
    background: rgba(16, 185, 129, 0.10);
    border-color: rgba(16, 185, 129, 0.22);
    color: #065f46;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.10);
    border-color: rgba(245, 158, 11, 0.24);
    color: #92400e;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.10);
    border-color: rgba(239, 68, 68, 0.24);
    color: #991b1b;
}

.alert-secondary {
    background: rgba(100, 116, 139, 0.10);
    border-color: rgba(100, 116, 139, 0.22);
    color: #334155;
}

.alert-info {
    background: rgba(14, 165, 233, 0.10);
    border-color: rgba(14, 165, 233, 0.20);
    color: #0c4a6e;
}

/* --- Tables --- */
.table {
    color: var(--text-body);
    --bs-table-cell-padding-y: var(--table-cell-pad-y);
    --bs-table-cell-padding-x: var(--table-cell-pad-x);
}

/* Safety: some reports use `.badge` directly on <td> */
.table td.badge {
    display: table-cell;
}

.table-light {
    --bs-table-bg: var(--bg-surface);
    --bs-table-color: var(--text-muted);
}

.table-bordered {
    border-color: var(--border);
}

.table-bordered > :not(caption) > * {
    border-color: var(--border);
}

.table-sm > :not(caption) > * > * {
    padding: 0.45rem 0.6rem;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(15, 23, 42, 0.02);
}

.table-custom thead th {
    background: var(--bg-surface);
    color: var(--text-muted);
    font-weight: 800;
    text-transform: uppercase;
    font-size: var(--table-head-font-size);
    letter-spacing: var(--table-head-letter-spacing);
    border-bottom: 1px solid var(--border);
}

.table-custom tbody td {
    border-top: 1px solid rgba(226, 232, 240, 0.75);
}

.table-custom tbody tr:hover {
    background: rgba(79, 70, 229, 0.04);
}

.table thead th {
    border-bottom-color: var(--border);
}

.table tbody tr:hover {
    background: rgba(15, 23, 42, 0.02);
}

/* --- List groups --- */
.list-group {
    --bs-list-group-border-color: var(--border);
    --bs-list-group-border-radius: var(--radius-lg);
}

.list-group:not(.list-group-flush) {
    box-shadow: var(--shadow-xs);
}

.list-group-flush {
    --bs-list-group-border-radius: 0;
}

.list-group-item {
    color: var(--text-body);
    padding: var(--list-item-pad-y) var(--list-item-pad-x);
}

.list-group-item-action:hover {
    background: rgba(15, 23, 42, 0.03);
    color: var(--text-heading);
}

.list-group-item.active {
    background: var(--primary-subtle);
    color: var(--primary);
    border-color: rgba(79, 70, 229, 0.25);
}

/* --- Tabs --- */
.nav-tabs {
    border-bottom: 1px solid var(--border);
}

.nav-tabs .nav-link {
    border: 0;
    color: var(--text-muted);
    font-weight: 700;
    padding: 0.75rem 0.25rem;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
}

.nav-tabs .nav-link:hover {
    color: var(--text-heading);
}

.nav-tabs .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* --- Pills (Purchases tabs etc.) --- */
.nav-pills {
    gap: 0.35rem;
}

.nav-pills .nav-link {
    border-radius: 999px;
    font-weight: 800;
    color: var(--text-muted);
    padding: 0.55rem 0.95rem;
}

.nav-pills .nav-link:hover {
    background: rgba(79, 70, 229, 0.08);
    color: var(--text-heading);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 8px 18px rgba(79, 70, 229, 0.22);
}

/* --- Dropdowns & modals --- */
.dropdown-menu {
    border: 1px solid var(--border);
}

.dropdown-item {
    font-weight: 600;
}

.modal-content {
    border-radius: var(--radius-xl);
}

/* --- Component: Navigation Links --- */
.nav-link-custom {
    display: flex;
    align-items: center;
    padding: var(--nav-link-pad-y) var(--nav-link-pad-x);
    margin: 0.25rem 0.75rem;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: none;
    /* Avoid `transition: all` (can trigger layout/paint work). */
    transition: background-color 0.12s ease, color 0.12s ease;
}

.nav-link-custom:hover {
    background-color: var(--bg-surface);
    color: var(--text-heading);
}

.nav-link-custom.active {
    background-color: var(--primary-subtle);
    color: var(--primary);
    font-weight: 700;
}

.nav-link-custom i {
    font-size: 1.25rem;
    width: 1.75rem;
    text-align: center;
    margin-right: 0.75rem;
}

/* --- Sidebar submenu --- */
.sidebar-submenu {
    margin: 0.25rem 0.75rem 0.5rem;
    padding: 0.25rem;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    /* Helps isolate layout/paint work during collapse. */
    contain: layout paint;
}

.sidebar-submenu a {
    display: block;
    padding: 0.65rem 0.9rem;
    border-radius: 0.65rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.12s ease, color 0.12s ease;
}

/* Sidebar collapse performance: speed up the height transition. */
.sidebar .collapsing {
    transition-duration: 120ms !important;
    will-change: height;
}

.sidebar-submenu a:hover {
    background: var(--bg-card);
    color: var(--text-heading);
}

.sidebar-submenu a.active {
    background: var(--primary-subtle);
    color: var(--primary);
}

/* --- Header: user chip --- */
.user-pill:hover {
    border-color: var(--border-hover) !important;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--info));
}

.hover-border-dark:hover { border-color: var(--border-hover) !important; }

/* --- Micro-interactions --- */
.hover-bg-primary:hover { background: var(--primary-subtle) !important; }
.hover-bg-surface:hover { background: var(--bg-surface) !important; }
.transition-hover { transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease; }
.transition-all { transition: all 0.2s ease; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.22s ease both; }

/* --- POS Specific Styles --- */
.pos-layout {
    height: calc(100vh - var(--header-height));
    padding: var(--pos-pad);
    gap: var(--pos-gap);
}

.h-100vh-custom {
    height: calc(100vh - var(--header-height));
}

.pos-left-panel, .pos-right-panel {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.payment-selector .form-select {
    border: 1px solid var(--border);
    background: var(--bg-surface);
}

.payment-selector .form-select:focus {
    background: var(--bg-card);
}

/* Product Search Bar */
.search-wrapper {
    position: relative;
    max-width: 600px;
    width: 100%;
}
.search-input {
    padding-left: 3rem !important;
    height: var(--pos-search-height);
    border-radius: 99px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.2s;
}
.search-input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: var(--shadow-focus);
}

/* Category Pills */
.category-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.5rem 0.25rem;
    scrollbar-width: none; /* Hide scrollbar Firefox */
}
.category-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
    padding: var(--pos-cat-pad-y) var(--pos-cat-pad-x);
    border-radius: 99px;
    background: var(--bg-surface);
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    user-select: none;
}
.cat-pill:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}
.cat-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

/* Product Cards */
.pos-card {
    height: 100%;
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    cursor: pointer;
    overflow: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.pos-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(79, 70, 229, 0.25);
}

.pos-card:active {
    transform: scale(0.96);
}

.pos-card-img {
    height: var(--pos-card-img-h);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-light);
    position: relative;
}

.pos-card-body {
    padding: var(--pos-card-body-pad);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pos-product-title {
    font-weight: 600;
    color: var(--text-heading);
    font-size: var(--pos-title-size);
    line-height: 1.3;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pos-product-price {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    color: var(--primary);
    font-size: var(--pos-price-size);
}

/* Cart Section */
.cart-header {
    background: white;
    padding: var(--pos-cart-header-pad-y) var(--pos-cart-header-pad-x);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-list {
    background: var(--bg-surface);
    padding: var(--pos-cart-pad);
    gap: 0.5rem;
    display: flex;
    flex-direction: column;
}

.cart-item-row {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: var(--pos-cart-item-pad);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.2s;
}
.cart-item-row:hover {
    border-color: var(--primary-subtle);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* POS: connectivity pill */
.wifi-status {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 0.5rem;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.25);
}

.wifi-online {
    background: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18);
}

.wifi-offline {
    background: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

/* Display modes (Settings -> display_mode) */
body.mode-compact {
    font-size: 0.9rem;
    --header-height: 64px;
    --nav-width: 260px;
    --content-pad: 1.25rem;
    --control-height: 40px;

    --btn-pad-y: 0.55rem;
    --btn-pad-x: 1.05rem;
    --btn-sm-pad-y: 0.3rem;
    --btn-sm-pad-x: 0.65rem;

    --nav-link-pad-y: 0.7rem;
    --nav-link-pad-x: 1.05rem;

    --table-cell-pad-y: 0.55rem;
    --table-cell-pad-x: 0.65rem;
    --table-head-font-size: 0.68rem;

    --list-item-pad-y: 0.7rem;
    --list-item-pad-x: 0.9rem;

    --pos-pad: 0.85rem;
    --pos-gap: 0.85rem;
    --pos-search-height: 3.0rem;
    --pos-cat-pad-y: 0.5rem;
    --pos-cat-pad-x: 1.1rem;
    --pos-cart-header-pad-y: 0.85rem;
    --pos-cart-header-pad-x: 1.1rem;
    --pos-cart-pad: 0.6rem;

    --pos-card-img-h: 104px;
    --pos-card-body-pad: 0.7rem;
    --pos-title-size: 0.9rem;
    --pos-price-size: 1.0rem;
    --pos-cart-item-pad: 0.65rem;
}

body.mode-touch {
    font-size: 1.0rem;
    --header-height: 76px;
    --nav-width: 300px;
    --content-pad: 1.75rem;
    --control-height: 52px;

    --btn-pad-y: 0.8rem;
    --btn-pad-x: 1.25rem;
    --btn-sm-pad-y: 0.55rem;
    --btn-sm-pad-x: 0.9rem;

    --nav-link-pad-y: 1rem;
    --nav-link-pad-x: 1.25rem;

    --table-cell-pad-y: 0.85rem;
    --table-cell-pad-x: 0.85rem;
    --table-head-font-size: 0.75rem;

    --list-item-pad-y: 1rem;
    --list-item-pad-x: 1.05rem;

    --pos-pad: 1.25rem;
    --pos-gap: 1.25rem;
    --pos-search-height: 3.6rem;
    --pos-cat-pad-y: 0.75rem;
    --pos-cat-pad-x: 1.35rem;
    --pos-cart-header-pad-y: 1.1rem;
    --pos-cart-header-pad-x: 1.35rem;
    --pos-cart-pad: 0.9rem;

    --pos-card-img-h: 140px;
    --pos-card-body-pad: 1rem;
    --pos-title-size: 1.05rem;
    --pos-price-size: 1.15rem;
    --pos-cart-item-pad: 0.9rem;
}

/* Dashboard stat helpers */
.stat-title {
    letter-spacing: 0.06em;
}

.stat-value {
    font-variant-numeric: tabular-nums;
}

/* Toastify polish */
.toastify {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    border-radius: 12px !important;
    box-shadow: var(--shadow-lg) !important;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 12px 14px;
}

.toastify .toast-close {
    opacity: 0.9;
}


/* Content padding scaling */
.container-fluid.p-4 {
    padding: var(--content-pad) !important;
}

/* Login/license pages */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: var(--bg-body);
}

.login-card {
    width: 100%;
    max-width: 520px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
}

.brand-logo {
    max-height: 48px;
    width: auto;
    object-fit: contain;
}

/* Small-screen polish */
@media (max-width: 576px) {
    .navbar-custom { padding: 0 1rem; }
    .pos-right-panel { width: 100% !important; }
    .pos-layout { flex-direction: column; }
}

.shadow-focus { box-shadow: var(--shadow-focus); }
.bg-glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Print polish (visual only) */
@media print {
    body {
        background: #fff !important;
        overflow: visible !important;
    }

    .sidebar,
    .navbar-custom,
    #mobileMenu,
    footer,
    .dropdown,
    .toastify,
    .btn {
        display: none !important;
    }

    .container-fluid {
        padding: 0 !important;
        overflow: visible !important;
    }

    .card {
        box-shadow: none !important;
    }
}