@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ==========================================================================
   CSS VARIABLES & STRICT TWO-THEME SWATCH SYSTEM (LIGHT & DARK ONLY)
   Light Swatch: #F9F9F8, #DBDBD9, #FAC95A, #F9A51B, #919A9F, #131313
   Dark Swatch:  #B7CAE2, #676C74, #3C3D3E, #232425, #161616, #010101
   ========================================================================== */
:root,
[data-theme="light"] {
    --bg-primary: #F9F9F8;
    --bg-surface: #FFFFFF;
    --bg-surface-alt: #F1F1EF;
    --bg-hover: #E7E7E4;

    --text-primary: #131313;
    --text-secondary: #5C6368;
    --text-muted: #919A9F;

    --border: #DBDBD9;
    --border-strong: #C2C4C4;

    --brand-primary: #F9A51B;
    --brand-primary-hover: #E29210;
    --brand-accent: #FAC95A;
    --brand-subtle: rgba(250, 201, 90, 0.28);
    --brand-text: #131313;
    --brand-on-primary: #131313;
    --brand-shadow: rgba(249, 165, 27, 0.28);
    --brand-shadow-hover: rgba(249, 165, 27, 0.40);
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-primary-hover);

    /* Light Navigation Sidebar */
    --sidebar-bg: #FFFFFF;
    --sidebar-border: #DBDBD9;
    --sidebar-header-bg: #F9F9F8;
    --sidebar-header-border: #DBDBD9;
    --sidebar-header-text: #131313;
    --sidebar-section-text: #919A9F;
    --sidebar-link-text: #131313;
    --sidebar-link-icon: #919A9F;
    --sidebar-link-hover-bg: rgba(250, 201, 90, 0.22);
    --sidebar-link-hover-text: #131313;
    --sidebar-active-bg: #F9A51B;
    --sidebar-active-text: #131313;
    --sidebar-footer-bg: #F9F9F8;
    --sidebar-footer-text: #131313;
    --sidebar-footer-muted: #919A9F;
    --sidebar-footer-avatar-bg: rgba(250, 201, 90, 0.32);
    --sidebar-footer-avatar-border: #FAC95A;
    --sidebar-footer-btn-bg: #FFFFFF;
    --sidebar-footer-btn-border: #DBDBD9;
    --sidebar-footer-btn-text: #131313;

    /* Pure Swatch Semantic Tokens (Zero Off-Swatch Colors) */
    --accent-emerald: #131313;
    --accent-emerald-hover: #2C2C2C;
    --accent-emerald-on: #F9F9F8;
    --accent-emerald-subtle: rgba(19, 19, 19, 0.08);
    --accent-emerald-text: #131313;

    --accent-amber: #F9A51B;
    --accent-amber-hover: #E29210;
    --accent-amber-on: #131313;
    --accent-amber-subtle: rgba(250, 201, 90, 0.30);
    --accent-amber-text: #131313;

    --accent-cyan: #919A9F;
    --accent-cyan-subtle: rgba(145, 154, 159, 0.18);
    --accent-cyan-text: #131313;

    --accent-purple: #FAC95A;
    --accent-purple-subtle: rgba(250, 201, 90, 0.24);
    --accent-purple-text: #131313;

    --accent-rose: #131313;
    --accent-rose-hover: #2C2C2C;
    --accent-rose-on: #FAC95A;
    --accent-rose-subtle: #DBDBD9;
    --accent-rose-text: #131313;

    --shadow-sm: 0 1px 2px 0 rgb(19 19 19 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(19 19 19 / 0.07), 0 2px 4px -2px rgb(19 19 19 / 0.04);
    --shadow-lg: 0 10px 15px -3px rgb(19 19 19 / 0.08), 0 4px 6px -4px rgb(19 19 19 / 0.04);
    --shadow-xl: 0 20px 25px -5px rgb(19 19 19 / 0.12), 0 8px 10px -6px rgb(19 19 19 / 0.05);
}

[data-theme="dark"] {
    --bg-primary: #161616;
    --bg-surface: #232425;
    --bg-surface-alt: #1C1D1E;
    --bg-hover: #3C3D3E;

    --text-primary: #E4ECF5;
    --text-secondary: #B7CAE2;
    --text-muted: #676C74;

    --border: #3C3D3E;
    --border-strong: #676C74;

    --brand-primary: #B7CAE2;
    --brand-primary-hover: #9EB7D7;
    --brand-accent: #B7CAE2;
    --brand-subtle: rgba(183, 202, 226, 0.14);
    --brand-text: #B7CAE2;
    --brand-on-primary: #010101;
    --brand-shadow: rgba(183, 202, 226, 0.22);
    --brand-shadow-hover: rgba(183, 202, 226, 0.34);
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-primary-hover);

    /* Dark Navigation Sidebar */
    --sidebar-bg: #010101;
    --sidebar-border: #3C3D3E;
    --sidebar-header-bg: #161616;
    --sidebar-header-border: #3C3D3E;
    --sidebar-header-text: #E4ECF5;
    --sidebar-section-text: #676C74;
    --sidebar-link-text: #B7CAE2;
    --sidebar-link-icon: #676C74;
    --sidebar-link-hover-bg: #232425;
    --sidebar-link-hover-text: #B7CAE2;
    --sidebar-active-bg: #B7CAE2;
    --sidebar-active-text: #010101;
    --sidebar-footer-bg: #161616;
    --sidebar-footer-text: #B7CAE2;
    --sidebar-footer-muted: #676C74;
    --sidebar-footer-avatar-bg: #232425;
    --sidebar-footer-avatar-border: #3C3D3E;
    --sidebar-footer-btn-bg: #232425;
    --sidebar-footer-btn-border: #3C3D3E;
    --sidebar-footer-btn-text: #B7CAE2;

    /* Pure Swatch Semantic Tokens (Zero Off-Swatch Colors) */
    --accent-emerald: #B7CAE2;
    --accent-emerald-hover: #9EB7D7;
    --accent-emerald-on: #010101;
    --accent-emerald-subtle: rgba(183, 202, 226, 0.15);
    --accent-emerald-text: #B7CAE2;

    --accent-amber: #676C74;
    --accent-amber-hover: #7B818B;
    --accent-amber-on: #010101;
    --accent-amber-subtle: rgba(103, 108, 116, 0.26);
    --accent-amber-text: #B7CAE2;

    --accent-cyan: #676C74;
    --accent-cyan-subtle: rgba(103, 108, 116, 0.22);
    --accent-cyan-text: #B7CAE2;

    --accent-purple: #3C3D3E;
    --accent-purple-subtle: rgba(60, 61, 62, 0.65);
    --accent-purple-text: #B7CAE2;

    --accent-rose: #3C3D3E;
    --accent-rose-hover: #676C74;
    --accent-rose-on: #B7CAE2;
    --accent-rose-subtle: rgba(60, 61, 62, 0.85);
    --accent-rose-text: #B7CAE2;

    --shadow-sm: 0 1px 2px 0 rgb(1 1 1 / 0.45);
    --shadow-md: 0 4px 8px -1px rgb(1 1 1 / 0.55);
    --shadow-lg: 0 10px 18px -3px rgb(1 1 1 / 0.65);
    --shadow-xl: 0 20px 28px -5px rgb(1 1 1 / 0.75);
}

/* ==========================================================================
   BASE & RESET
   ========================================================================== */
html {
    font-size: 14.4px;
    /* 90% global scale for comfortable, compact layout */
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Product Thumbnail Helpers */
.product-thumb-sm {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border);
    background-color: var(--bg-surface-alt);
    display: inline-block;
    vertical-align: middle;
}

.product-thumb-placeholder {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg-surface-alt);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    vertical-align: middle;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

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

/* ==========================================================================
   APP LAYOUT
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar — Adaptive Swatch Identity */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
    flex-shrink: 0;
    transition: width 0.2s ease, background-color 0.25s ease, border-color 0.25s ease;
    color: var(--sidebar-link-text);
}

.sidebar-header {
    padding: 1.05rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--sidebar-header-bg);
    border-bottom: 3px solid var(--sidebar-header-border);
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--brand-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-on-primary);
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px var(--brand-shadow);
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.brand-logo.has-logo-img {
    background: #F9F9F8;
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    padding: 3px;
}

.brand-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 7px;
    display: block;
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    color: var(--sidebar-header-text);
}

.brand-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.25;
    color: var(--sidebar-header-text);
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--brand-text);
    letter-spacing: 0.05em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-section-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--sidebar-section-text);
    padding: 0.85rem 0.75rem 0.25rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--sidebar-link-text);
    transition: all 0.15s ease;
}

.nav-item:hover {
    background-color: var(--sidebar-link-hover-bg);
    color: var(--sidebar-link-hover-text);
    transform: translateX(2px);
}

.nav-item.active {
    background-color: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 700;
    box-shadow: 0 4px 12px var(--brand-shadow);
}

.nav-item.active .icon {
    color: var(--sidebar-active-text);
}

.nav-item .icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    color: var(--sidebar-link-icon);
    transition: color 0.15s ease;
}

.nav-item:hover .icon {
    color: var(--sidebar-link-hover-text);
}

.sidebar-footer {
    padding: 1rem 1.15rem;
    border-top: 1px solid var(--sidebar-border);
    background: var(--sidebar-footer-bg);
}

/* Main Content Area */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Top Navbar */
.top-navbar {
    height: 68px;
    background-color: var(--bg-surface);
    border-top: 3px solid var(--brand-primary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.75rem;
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(8px);
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.company-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-surface-alt);
    border: 1px solid var(--border);
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.825rem;
    font-weight: 600;
}

.company-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-emerald);
}

.env-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.env-badge.local {
    background-color: var(--accent-cyan-subtle);
    color: var(--accent-cyan-text);
    border: 1px solid var(--accent-cyan);
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

/* Page Content */
.page-content {
    flex: 1;
    padding: 1.75rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
}

/* ==========================================================================
   CARDS & GRIDS
   ========================================================================== */
.card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.stat-card.emerald::before {
    background-color: var(--accent-emerald);
}

.stat-card.indigo::before {
    background-color: var(--brand-primary);
}

.stat-card.amber::before {
    background-color: var(--accent-amber);
}

.stat-card.cyan::before {
    background-color: var(--accent-cyan);
}

.stat-card.purple::before {
    background-color: var(--accent-purple);
}

.stat-card.rose::before {
    background-color: var(--accent-rose);
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.stat-value {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.stat-icon {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.stat-card.emerald .stat-icon {
    background: var(--accent-emerald-subtle);
    color: var(--accent-emerald);
}

.stat-card.indigo .stat-icon {
    background: var(--brand-subtle);
    color: var(--brand-primary);
}

.stat-card.amber .stat-icon {
    background: var(--accent-amber-subtle);
    color: var(--accent-amber);
}

.stat-card.cyan .stat-icon {
    background: var(--accent-cyan-subtle);
    color: var(--accent-cyan);
}

.stat-card.purple .stat-icon {
    background: var(--accent-purple-subtle);
    color: var(--accent-purple);
}

.stat-card.rose .stat-icon {
    background: var(--accent-rose-subtle);
    color: var(--accent-rose);
}

/* ==========================================================================
   BUTTONS & BADGES
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.btn-primary {
    background-color: var(--brand-primary);
    color: var(--brand-on-primary);
    box-shadow: 0 2px 6px var(--brand-shadow);
    font-weight: 700;
}

.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    color: var(--brand-on-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px var(--brand-shadow-hover);
}

.btn-emerald {
    background-color: var(--accent-emerald);
    color: var(--accent-emerald-on);
}

.btn-emerald:hover {
    background-color: var(--accent-emerald-hover);
    color: var(--accent-emerald-on);
    transform: translateY(-1px);
}

.btn-amber {
    background-color: var(--accent-amber);
    color: var(--accent-amber-on);
}

.btn-amber:hover {
    background-color: var(--accent-amber-hover);
    color: var(--accent-amber-on);
}

.btn-rose,
.btn-danger {
    background-color: var(--accent-rose);
    color: var(--accent-rose-on);
}

.btn-rose:hover,
.btn-danger:hover {
    background-color: var(--accent-rose-hover);
    color: var(--accent-rose-on);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

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

.btn-sm {
    padding: 0.35rem 0.65rem;
    font-size: 0.775rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.85rem 1.75rem;
    font-size: 1rem;
    border-radius: 10px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-emerald {
    background-color: var(--accent-emerald-subtle);
    color: var(--accent-emerald-text);
}

.badge-amber {
    background-color: var(--accent-amber-subtle);
    color: var(--accent-amber-text);
}

.badge-rose {
    background-color: var(--accent-rose-subtle);
    color: var(--accent-rose-text);
}

.badge-indigo {
    background-color: var(--brand-subtle);
    color: var(--brand-text);
}

.badge-cyan {
    background-color: var(--accent-cyan-subtle);
    color: var(--accent-cyan-text);
}

/* ==========================================================================
   FORMS & INPUTS
   ========================================================================== */
.form-group {
    margin-bottom: 1.15rem;
}

.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.35rem;
}

.form-control {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.15s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px var(--brand-subtle);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ==========================================================================
   TABLES
   ========================================================================== */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.table th {
    background-color: var(--bg-surface-alt);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.725rem;
    letter-spacing: 0.05em;
    padding: 0.85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table tbody tr:hover td {
    background-color: var(--bg-surface-alt);
}

/* ==========================================================================
   UNIVERSAL MODAL COMPONENT (NO BROWSER ALERTS!)
   ========================================================================== */
.pos-modal-overlay,
.pos-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    overflow-y: auto;
    padding: 2rem 1rem;
}

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

.pos-modal-card,
.pos-modal-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    width: 92%;
    max-width: 580px;
    max-height: calc(100vh - 4rem);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    transform: scale(0.95) translateY(10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
    margin: auto;
}

.pos-modal-card>form,
.pos-modal-box>form {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

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

.pos-modal-card.modal-lg,
.pos-modal-box.modal-lg {
    max-width: 800px;
}

.pos-modal-card.modal-sm,
.pos-modal-box.modal-sm {
    max-width: 420px;
}

.pos-modal-footer button:focus-visible,
#confirm-modal-btn:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

#confirm-modal-message {
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.9rem;
}

#confirm-modal-message strong,
#confirm-modal-message b {
    color: var(--text-primary);
    font-weight: 600;
}

/* Universal Confirmation & Delete Modal (Must stack on top of all modals including Quick Bill) */
#pos-universal-confirm-modal {
    z-index: 100050 !important;
}

.pos-modal-header {
    padding: 1.15rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.pos-modal-title {
    font-size: 1.15rem;
    font-weight: 700;
}

.pos-modal-close {
    background: transparent;
    border: none;
    font-size: 1.3rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    padding: 0.2rem 0.4rem;
    transition: all 0.15s ease;
}

.pos-modal-close:hover {
    color: var(--text-primary);
    background-color: var(--bg-hover);
}

.pos-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.pos-modal-body::-webkit-scrollbar {
    width: 6px;
}

.pos-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.pos-modal-body::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.pos-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.pos-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    background-color: var(--bg-surface-alt);
    flex-shrink: 0;
}

/* ==========================================================================
   TOAST NOTIFICATIONS (NO BROWSER ALERTS!)
   ========================================================================== */
.pos-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.pos-toast {
    pointer-events: auto;
    width: 360px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 1.15rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.pos-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.pos-toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.pos-toast-content {
    flex: 1;
}

.pos-toast-title {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 0.15rem;
}

.pos-toast-message {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pos-toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.pos-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
}

.pos-toast.success .pos-toast-progress {
    background-color: var(--accent-emerald);
}

.pos-toast.error .pos-toast-progress {
    background-color: var(--accent-rose);
}

.pos-toast.warning .pos-toast-progress {
    background-color: var(--accent-amber);
}

.pos-toast.info .pos-toast-progress {
    background-color: var(--brand-primary);
}

/* ==========================================================================
   DESKTOP VIEW GUARANTEE: MOBILE SIDEBAR CONTROLS ARE STRICTLY HIDDEN
   ========================================================================== */
.sidebar-toggle-btn,
.sidebar-backdrop,
.pos-mobile-salesman-bar {
    display: none !important;
}

/* ==========================================================================
   80MM THERMAL RECEIPT STYLING (GLOBAL)
   ========================================================================== */
.receipt-container {
    width: 80mm;
    max-width: 100%;
    margin: 0 auto;
    padding: 12px;
    background: #ffffff;
    color: #000000;
    font-family: 'JetBrains Mono', 'Courier New', Courier, monospace;
    font-size: 11px;
    line-height: 1.4;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.receipt-header {
    text-align: center;
    border-bottom: 1px dashed #000;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.receipt-store-title {
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.receipt-divider {
    border-top: 1px dashed #000;
    margin: 6px 0;
}

.receipt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.receipt-table th {
    text-align: left;
    border-bottom: 1px solid #000;
    padding: 4px 0;
    font-weight: 700;
}

.receipt-table td {
    padding: 3px 0;
    vertical-align: top;
}

.receipt-tax-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 10px;
    margin-top: 3px;
    margin-bottom: 3px;
}

.receipt-tax-table th {
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 3px 0;
    font-weight: 700;
}

.receipt-tax-table td {
    padding: 2px 0;
}

.receipt-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 14px;
    padding-top: 4px;
    border-top: 1px solid #000;
    margin-top: 4px;
}

.receipt-barcode {
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
    letter-spacing: 2px;
    font-weight: 700;
}

@media print {
    body * {
        visibility: hidden !important;
    }

    .receipt-container,
    .receipt-container * {
        visibility: visible !important;
    }

    .receipt-container {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 80mm !important;
        max-width: 80mm !important;
        margin: 0 !important;
        padding: 6px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
}

/* ==========================================================================
   PAGINATION STYLING
   ========================================================================== */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
    border-bottom-left-radius: inherit;
    border-bottom-right-radius: inherit;
}

.pagination-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-info strong {
    color: var(--text-primary);
    font-weight: 700;
}

.pagination-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-per-page-label {
    margin-bottom: 0;
    white-space: nowrap;
    font-weight: 500;
}

.pagination-select {
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    border-radius: 6px;
    border: 1px solid var(--border);
    background-color: var(--bg-surface-alt);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
    width: auto;
    min-width: 72px;
}

.pagination-select:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px var(--brand-subtle);
}

.pagination-nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-strong);
}

.pagination-btn.active {
    background: var(--brand-primary);
    color: var(--brand-on-primary);
    border-color: var(--brand-primary);
    box-shadow: 0 2px 6px var(--brand-shadow);
    font-weight: 700;
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--border);
    background: transparent;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 34px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
}