@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 & THEME DEFINITIONS
   ========================================================================== */
:root, [data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-alt: #f1f5f9;
    --bg-hover: #e2e8f0;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    
    --brand-primary: #4f46e5;
    --brand-primary-hover: #4338ca;
    --brand-subtle: #eef2ff;
    --brand-text: #4338ca;
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-primary-hover);
    
    --accent-emerald: #10b981;
    --accent-emerald-subtle: #ecfdf5;
    --accent-emerald-text: #065f46;

    --accent-amber: #f59e0b;
    --accent-amber-subtle: #fffbeb;
    --accent-amber-text: #92400e;

    --accent-rose: #f43f5e;
    --accent-rose-subtle: #fff1f2;
    --accent-rose-text: #9f1239;

    --accent-cyan: #0ea5e9;
    --accent-cyan-subtle: #f0f9ff;
    --accent-cyan-text: #0369a1;

    --accent-purple: #8b5cf6;
    --accent-purple-subtle: #f5f3ff;
    --accent-purple-text: #5b21b6;

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

[data-theme="dark"] {
    --bg-primary: #0b0f17;
    --bg-surface: #111827;
    --bg-surface-alt: #1f2937;
    --bg-hover: #283548;
    
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --border: #1f2937;
    --border-strong: #374151;
    
    --brand-primary: #6366f1;
    --brand-primary-hover: #4f46e5;
    --brand-subtle: rgba(99, 102, 241, 0.15);
    --brand-text: #a5b4fc;
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-primary-hover);
    
    --accent-emerald: #10b981;
    --accent-emerald-subtle: rgba(16, 185, 129, 0.15);
    --accent-emerald-text: #6ee7b7;

    --accent-amber: #f59e0b;
    --accent-amber-subtle: rgba(245, 158, 11, 0.15);
    --accent-amber-text: #fcd34d;

    --accent-rose: #f43f5e;
    --accent-rose-subtle: rgba(244, 63, 94, 0.15);
    --accent-rose-text: #fda4af;

    --accent-cyan: #38bdf8;
    --accent-cyan-subtle: rgba(56, 189, 248, 0.15);
    --accent-cyan-text: #7dd3fc;

    --accent-purple: #a78bfa;
    --accent-purple-subtle: rgba(167, 139, 250, 0.15);
    --accent-purple-text: #c4b5fd;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

[data-theme="emerald"] {
    --bg-primary: #061811;
    --bg-surface: #0b241a;
    --bg-surface-alt: #13392a;
    --bg-hover: #1c4d39;
    
    --text-primary: #ecfdf5;
    --text-secondary: #a7f3d0;
    --text-muted: #6ee7b7;
    
    --border: #13392a;
    --border-strong: #1e5a42;
    
    --brand-primary: #10b981;
    --brand-primary-hover: #059669;
    --brand-subtle: rgba(16, 185, 129, 0.2);
    --brand-text: #34d399;
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-primary-hover);
}

[data-theme="cyber"] {
    --bg-primary: #050b14;
    --bg-surface: #0a1324;
    --bg-surface-alt: #111e38;
    --bg-hover: #1b2d52;
    
    --text-primary: #f0fdf4;
    --text-secondary: #93c5fd;
    --text-muted: #60a5fa;
    
    --border: #142445;
    --border-strong: #1e3666;
    
    --brand-primary: #06b6d4;
    --brand-primary-hover: #0891b2;
    --brand-subtle: rgba(6, 182, 212, 0.2);
    --brand-text: #67e8f9;
    --primary: var(--brand-primary);
    --primary-hover: var(--brand-primary-hover);
}

/* ==========================================================================
   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;
    transition: background-color 0.25s ease, color 0.25s ease;
}

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 */
.sidebar {
    width: 260px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
    flex-shrink: 0;
    transition: width 0.2s ease, border-color 0.25s ease;
}

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

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-primary), #ec4899);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    flex-shrink: 0;
    overflow: hidden;
    transition: all 0.2s ease;
}

.brand-logo.has-logo-img {
    background: var(--bg-surface-alt);
    border: 1px solid var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    padding: 3px;
}

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

.brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 175px;
}

.brand-title-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.25;
}

.brand-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--brand-primary);
    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.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: 0.75rem 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(--text-secondary);
    transition: all 0.15s ease;
}

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

.nav-item.active {
    background-color: var(--brand-subtle);
    color: var(--brand-text);
    font-weight: 600;
}

.nav-item .icon {
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
}

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

/* 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-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-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); }

/* ==========================================================================
   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: #ffffff;
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
}
.btn-primary:hover {
    background-color: var(--brand-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(79, 70, 229, 0.35);
}

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

.btn-amber {
    background-color: var(--accent-amber);
    color: #ffffff;
}
.btn-amber:hover {
    background-color: #d97706;
}

.btn-rose {
    background-color: var(--accent-rose);
    color: #ffffff;
}
.btn-rose:hover {
    background-color: #e11d48;
}

.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;
}

.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: 9999;
    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: #ffffff;
    border-color: var(--brand-primary);
    box-shadow: 0 2px 4px rgba(79, 70, 229, 0.25);
    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;
}
