/* ============================================================
   POS Terminal — Premium Hypermarket-Grade UI
   Touch-Optimized · Keyboard-First · Zero-Friction
   ============================================================ */

/* ═══════════════ DESIGN TOKENS ═══════════════ */

/* ── Dark Theme (Default) ── */
:root,
[data-pos-theme="dark"] {
    --pos-bg: #080a10;
    --pos-surface: #0f1219;
    --pos-surface-2: #161b27;
    --pos-surface-3: #1d2333;
    --pos-surface-hover: #232a3c;
    --pos-border: #243049;
    --pos-border-focus: #4a5580;
    --pos-glow: rgba(99, 155, 255, .06);

    --pos-primary: #5b9aff;
    --pos-primary-hover: #4080f0;
    --pos-primary-glow: rgba(91, 154, 255, .22);
    --pos-accent: #818cf8;

    --pos-success: #34d399;
    --pos-success-dark: #059669;
    --pos-success-glow: rgba(52, 211, 153, .18);
    --pos-danger: #f87171;
    --pos-danger-dark: #dc2626;
    --pos-danger-glow: rgba(248, 113, 113, .15);
    --pos-warning: #fbbf24;
    --pos-warning-glow: rgba(251, 191, 36, .15);
    --pos-info: #38bdf8;

    --pos-text: #f8fafc;
    --pos-text-primary: #f8fafc;
    --pos-text-secondary: #e2e8f0;
    --pos-text-dim: #a8b8cc;

    --pos-cash: #34d399;
    --pos-card: #818cf8;
    --pos-transfer: #38bdf8;
    --pos-check: #fbbf24;

    --pos-r: 12px;
    --pos-r-sm: 8px;
    --pos-r-lg: 16px;
    --pos-r-xl: 20px;
    --pos-shadow-sm: 0 1px 3px rgba(0,0,0,.35);
    --pos-shadow: 0 4px 24px rgba(0,0,0,.45);
    --pos-shadow-lg: 0 12px 48px rgba(0,0,0,.55);
    --pos-shadow-glow: 0 0 40px rgba(91, 154, 255, .08);
    --pos-transition: .18s cubic-bezier(.4, 0, .2, 1);
    --pos-transition-fast: .1s ease;

    --pos-modal-backdrop: rgba(0, 0, 0, .7);
    --pos-input-bg: #080a10;
    --pos-logo-grad-1: #7c3aed;
    --pos-logo-grad-2: #a78bfa;
    --pos-complete-grad-1: var(--pos-success-dark);
    --pos-complete-grad-2: var(--pos-success);
    --pos-selected-bg: rgba(91, 154, 255, .08);
    --pos-selected-glow: rgba(91, 154, 255, .04);
}

/* ── Light Theme ── */
[data-pos-theme="light"] {
    --pos-bg: #f0f2f5;
    --pos-surface: #ffffff;
    --pos-surface-2: #f7f8fa;
    --pos-surface-3: #eef1f5;
    --pos-surface-hover: #e2e6ec;
    --pos-border: #d4d8e1;
    --pos-border-focus: #a0aab8;
    --pos-glow: rgba(79, 110, 247, .06);

    --pos-primary: #4f6ef7;
    --pos-primary-hover: #3b5ce6;
    --pos-primary-glow: rgba(79, 110, 247, .18);
    --pos-accent: #6366f1;

    --pos-success: #16a34a;
    --pos-success-dark: #15803d;
    --pos-success-glow: rgba(22, 163, 74, .12);
    --pos-danger: #dc2626;
    --pos-danger-dark: #b91c1c;
    --pos-danger-glow: rgba(220, 38, 38, .12);
    --pos-warning: #d97706;
    --pos-warning-glow: rgba(217, 119, 6, .12);
    --pos-info: #0284c7;

    --pos-text: #1a1a2e;
    --pos-text-primary: #1a1a2e;
    --pos-text-secondary: #4a5568;
    --pos-text-dim: #8896a8;

    --pos-cash: #16a34a;
    --pos-card: #6366f1;
    --pos-transfer: #0284c7;
    --pos-check: #d97706;

    --pos-shadow-sm: 0 1px 3px rgba(0,0,0,.06);
    --pos-shadow: 0 4px 16px rgba(0,0,0,.06);
    --pos-shadow-lg: 0 12px 40px rgba(0,0,0,.1);
    --pos-shadow-glow: 0 0 30px rgba(79, 110, 247, .05);

    --pos-modal-backdrop: rgba(0, 0, 0, .4);
    --pos-input-bg: #ffffff;
    --pos-logo-grad-1: #4f46e5;
    --pos-logo-grad-2: #7c3aed;
    --pos-complete-grad-1: #15803d;
    --pos-complete-grad-2: #16a34a;
    --pos-selected-bg: rgba(79, 110, 247, .1);
    --pos-selected-glow: rgba(79, 110, 247, .06);
}

/* ── Midnight Blue Theme ── */
[data-pos-theme="midnight"] {
    --pos-bg: #060d1f;
    --pos-surface: #0c1a35;
    --pos-surface-2: #132244;
    --pos-surface-3: #1a2c52;
    --pos-surface-hover: #213560;
    --pos-border: #1e3461;
    --pos-border-focus: #2d4a82;
    --pos-glow: rgba(96, 165, 250, .08);

    --pos-primary: #60a5fa;
    --pos-primary-hover: #3b82f6;
    --pos-primary-glow: rgba(96, 165, 250, .25);
    --pos-accent: #a78bfa;

    --pos-success: #4ade80;
    --pos-success-dark: #16a34a;
    --pos-success-glow: rgba(74, 222, 128, .2);
    --pos-danger: #fb7185;
    --pos-danger-dark: #e11d48;
    --pos-danger-glow: rgba(251, 113, 133, .18);
    --pos-warning: #fbbf24;
    --pos-warning-glow: rgba(251, 191, 36, .18);
    --pos-info: #38bdf8;

    --pos-text: #f8fafc;
    --pos-text-primary: #f8fafc;
    --pos-text-secondary: #dce4ef;
    --pos-text-dim: #a0b3cc;

    --pos-cash: #4ade80;
    --pos-card: #a78bfa;
    --pos-transfer: #38bdf8;
    --pos-check: #fbbf24;

    --pos-shadow-sm: 0 1px 3px rgba(0,0,0,.4);
    --pos-shadow: 0 4px 24px rgba(0,0,0,.5);
    --pos-shadow-lg: 0 12px 48px rgba(0,0,0,.6);
    --pos-shadow-glow: 0 0 40px rgba(96, 165, 250, .1);

    --pos-modal-backdrop: rgba(0, 0, 0, .7);
    --pos-input-bg: #060d1f;
    --pos-logo-grad-1: #3b82f6;
    --pos-logo-grad-2: #8b5cf6;
    --pos-complete-grad-1: #16a34a;
    --pos-complete-grad-2: #4ade80;
    --pos-selected-bg: rgba(96, 165, 250, .1);
    --pos-selected-glow: rgba(96, 165, 250, .06);
}

/* ── High Contrast Theme ── */
[data-pos-theme="contrast"] {
    --pos-bg: #000000;
    --pos-surface: #111111;
    --pos-surface-2: #1c1c1c;
    --pos-surface-3: #2a2a2a;
    --pos-surface-hover: #363636;
    --pos-border: #555555;
    --pos-border-focus: #888888;
    --pos-glow: rgba(120, 180, 255, .1);

    --pos-primary: #6cb4ff;
    --pos-primary-hover: #4da0ff;
    --pos-primary-glow: rgba(108, 180, 255, .3);
    --pos-accent: #b4a0ff;

    --pos-success: #4ade80;
    --pos-success-dark: #22c55e;
    --pos-success-glow: rgba(74, 222, 128, .25);
    --pos-danger: #ff6b6b;
    --pos-danger-dark: #ef4444;
    --pos-danger-glow: rgba(255, 107, 107, .2);
    --pos-warning: #fcd34d;
    --pos-warning-glow: rgba(252, 211, 77, .2);
    --pos-info: #67e8f9;

    --pos-text: #ffffff;
    --pos-text-primary: #ffffff;
    --pos-text-secondary: #eeeeee;
    --pos-text-dim: #cccccc;

    --pos-cash: #4ade80;
    --pos-card: #b4a0ff;
    --pos-transfer: #67e8f9;
    --pos-check: #fcd34d;

    --pos-shadow-sm: 0 1px 4px rgba(0,0,0,.5);
    --pos-shadow: 0 4px 24px rgba(0,0,0,.6);
    --pos-shadow-lg: 0 12px 48px rgba(0,0,0,.7);
    --pos-shadow-glow: 0 0 40px rgba(108, 180, 255, .12);

    --pos-modal-backdrop: rgba(0, 0, 0, .85);
    --pos-input-bg: #000000;
    --pos-logo-grad-1: #7c3aed;
    --pos-logo-grad-2: #a78bfa;
    --pos-complete-grad-1: #22c55e;
    --pos-complete-grad-2: #4ade80;
    --pos-selected-bg: rgba(108, 180, 255, .12);
    --pos-selected-glow: rgba(108, 180, 255, .08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Base wrapper — ensures theme variables cascade with proper text defaults */
[data-pos-theme] {
    color: var(--pos-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════════════════════════
   PAGE SHELL
   ═══════════════════════════════════════════════════════════════ */
.pos-page {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: var(--pos-bg);
    color: var(--pos-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    overflow: hidden;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    outline: none;
}

/* ═══════════════════════════════════════════════════════════════
   TOP BAR
   ═══════════════════════════════════════════════════════════════ */
.pos-topbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
    height: 52px;
    position: relative;
    z-index: 100;
}
.pos-topbar::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--pos-primary-glow), transparent);
}

.pos-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.pos-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .92rem;
    font-weight: 800;
    letter-spacing: -.02em;
    color: var(--pos-text);
    white-space: nowrap;
}

.pos-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pos-logo-grad-1), var(--pos-logo-grad-2));
    font-size: .95rem;
    box-shadow: 0 2px 12px rgba(124, 58, 237, .35);
}

.pos-topbar-info {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.pos-topbar-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--pos-surface-2);
    border: 1px solid var(--pos-border);
    font-size: .76rem;
    font-weight: 600;
    color: var(--pos-text-secondary);
    white-space: nowrap;
}

.chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--pos-success);
    box-shadow: 0 0 8px var(--pos-success-glow);
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

.pos-topbar-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pos-clock {
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: .82rem;
    font-weight: 700;
    color: var(--pos-primary);
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(91, 154, 255, .08);
    border: 1px solid rgba(91, 154, 255, .15);
    font-variant-numeric: tabular-nums;
    letter-spacing: .03em;
}

.pos-btn-top {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    color: var(--pos-text-secondary);
    font-size: .9rem;
    cursor: pointer;
    transition: all var(--pos-transition);
}
.pos-btn-top:hover {
    background: var(--pos-surface-3);
    border-color: var(--pos-border-focus);
    color: var(--pos-text);
    transform: translateY(-1px);
}
.pos-btn-top:active { transform: scale(.92); }

/* ═══════════════════════════════════════════════════════════════
   MAIN 3-COLUMN LAYOUT
   ═══════════════════════════════════════════════════════════════ */
.pos-main {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(340px, 1.3fr) minmax(260px, 1fr);
    overflow: hidden;
    min-height: 0;
}

/* ═══════════════════════════════════════════════════════════════
   LEFT PANEL — Search & Browse
   ═══════════════════════════════════════════════════════════════ */
.pos-left {
    display: flex;
    flex-direction: column;
    background: var(--pos-bg);
    border-right: 1px solid var(--pos-border);
    overflow: hidden;
}

.pos-search-section {
    display: flex;
    gap: 6px;
    padding: 10px 12px;
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
}

.pos-search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--pos-border);
    border-radius: var(--pos-r);
    background: var(--pos-input-bg);
    color: var(--pos-text);
    font-size: .88rem;
    font-weight: 500;
    outline: none;
    transition: all var(--pos-transition);
}
.pos-search-input:focus {
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px var(--pos-primary-glow);
}
.pos-search-input::placeholder { color: var(--pos-text-dim); font-weight: 400; }

.pos-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    border: none;
    border-radius: var(--pos-r);
    background: linear-gradient(135deg, var(--pos-primary), var(--pos-accent));
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--pos-transition);
    flex-shrink: 0;
}
.pos-search-btn:hover { box-shadow: 0 4px 16px var(--pos-primary-glow); transform: translateY(-1px); }
.pos-search-btn:active { transform: scale(.93); }

/* Search Results */
.pos-results {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--pos-border) transparent;
}

.pos-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 2px;
    border-radius: var(--pos-r-sm);
    background: transparent;
    cursor: pointer;
    transition: all var(--pos-transition);
    border: 1px solid transparent;
}
.pos-result-item:hover {
    background: var(--pos-surface-2);
    border-color: var(--pos-border);
}
.pos-result-item:active {
    background: var(--pos-glow);
    border-color: var(--pos-primary);
    transform: scale(.98);
}

.result-name {
    font-size: .8rem;
    font-weight: 600;
    color: var(--pos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: 8px;
}

.result-price {
    font-size: .82rem;
    font-weight: 800;
    color: var(--pos-success);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.result-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    flex-wrap: wrap;
    overflow: hidden;
    max-height: 20px;
}

.result-code {
    font-size: .62rem;
    font-weight: 700;
    color: var(--pos-primary);
    background: var(--pos-primary-glow);
    padding: 1px 6px;
    border-radius: 3px;
    font-family: monospace;
    flex-shrink: 0;
}

.result-attr-tag {
    font-size: .6rem;
    font-weight: 600;
    color: var(--pos-text-secondary);
    background: var(--pos-surface-3);
    padding: 1px 5px;
    border-radius: 3px;
    white-space: nowrap;
}

.result-stock {
    font-size: .6rem;
    font-weight: 600;
    color: var(--pos-success);
    margin-top: 2px;
    white-space: nowrap;
}

/* ── Category Bar ── */
.pos-category-bar {
    display: flex;
    gap: 4px;
    padding: 6px 8px;
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
    overflow-x: auto;
    scrollbar-width: none;
    flex-shrink: 0;
}
.pos-category-bar::-webkit-scrollbar { display: none; }

.pos-category-tab {
    padding: 5px 12px;
    border: 1px solid var(--pos-border);
    border-radius: 20px;
    background: transparent;
    color: var(--pos-text-secondary);
    font-size: .68rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition);
    white-space: nowrap;
    flex-shrink: 0;
}
.pos-category-tab:hover {
    background: var(--pos-surface-2);
    border-color: var(--pos-border-focus);
}
.pos-category-tab.active {
    background: var(--pos-primary);
    color: #fff;
    border-color: var(--pos-primary);
    box-shadow: 0 2px 8px var(--pos-primary-glow);
}

/* ── Variant Picker Grid ── */
.pos-variant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.pos-variant-card {
    padding: 12px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r);
    background: var(--pos-surface-2);
    cursor: pointer;
    transition: all var(--pos-transition);
    text-align: center;
}
.pos-variant-card:hover {
    background: var(--pos-glow);
    border-color: var(--pos-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--pos-primary-glow);
}

.variant-price {
    font-size: 1.05rem;
    font-weight: 900;
    color: var(--pos-success);
    margin-bottom: 4px;
}

.variant-barcode {
    font-size: .7rem;
    font-weight: 600;
    color: var(--pos-text-secondary);
    font-family: monospace;
    margin-bottom: 6px;
}

.variant-attrs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin-bottom: 4px;
}

.variant-attr-tag {
    font-size: .6rem;
    font-weight: 600;
    color: var(--pos-accent);
    background: rgba(129, 140, 248, .1);
    border: 1px solid rgba(129, 140, 248, .2);
    padding: 2px 6px;
    border-radius: 4px;
}

.variant-stock {
    font-size: .6rem;
    font-weight: 600;
    color: var(--pos-success);
    margin-top: 4px;
}

/* ── Customer Autocomplete ── */
.pos-customer-autocomplete {
    position: relative;
    flex: 1;
}

.pos-customer-dropdown {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r);
    box-shadow: var(--pos-shadow-lg);
    z-index: 150;
    max-height: 280px;
    overflow-y: auto;
    animation: fade-in .15s ease;
}

.pos-customer-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all var(--pos-transition);
    border-bottom: 1px solid rgba(30, 37, 56, .3);
}
.pos-customer-option:last-child { border-bottom: none; }
.pos-customer-option:hover {
    background: var(--pos-glow);
}

.customer-option-name {
    font-size: .78rem;
    font-weight: 700;
    color: var(--pos-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-option-meta {
    display: flex;
    gap: 8px;
    font-size: .65rem;
    color: var(--pos-text-secondary);
    margin-top: 1px;
}

.customer-option-balance {
    font-size: .76rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    flex-shrink: 0;
}
.customer-option-balance.positive { color: var(--pos-success); }
.customer-option-balance.negative { color: var(--pos-danger); }

.pos-result-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: var(--pos-text-dim);
    font-size: .82rem;
    font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════
   CENTER PANEL — Cart, Numpad, Notes
   ═══════════════════════════════════════════════════════════════ */
.pos-center {
    display: flex;
    flex-direction: column;
    background: var(--pos-bg);
    border-right: 1px solid var(--pos-border);
    overflow: hidden;
}

/* Cart Section */
.pos-cart-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.pos-cart-section h3 {
    padding: 10px 14px;
    margin: 0;
    font-size: .82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--pos-text-secondary);
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
}

.pos-cart-headers {
    display: flex;
    padding: 6px 14px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--pos-text-secondary);
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
}

.pos-cart-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: var(--pos-text-dim);
    font-size: .85rem;
    gap: 8px;
    padding: 40px 16px;
    overflow-y: auto;
}

/* Cart Lines Container — enable scroll on the area after headers */
.pos-cart-section > .pos-cart-empty,
.pos-cart-section > .pos-cart-line {
    /* these are direct children after the headers */
}

/* We need a wrapper for scrolling — handled via flex overflow */
.pos-cart-line {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-bottom: 1px solid rgba(30, 37, 56, .5);
    cursor: pointer;
    transition: all var(--pos-transition);
    font-size: .82rem;
    min-height: 44px;
}
.pos-cart-line:hover {
    background: var(--pos-glow);
}
.pos-cart-line.selected {
    background: var(--pos-selected-bg);
    border-left: 3px solid var(--pos-primary);
    box-shadow: inset 0 0 20px var(--pos-selected-glow);
}

.cart-col-name {
    flex: 2;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    overflow: hidden;
}
.cart-col-qty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 6px;
    transition: all var(--pos-transition-fast);
    cursor: pointer;
}
.cart-col-price {
    flex: 1;
    text-align: right;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all var(--pos-transition-fast);
    cursor: pointer;
}
.cart-col-total {
    flex: 1;
    text-align: right;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--pos-transition-fast);
}

/* Editing highlight — glow on the column being edited */
.cart-col-qty.editing,
.cart-col-price.editing {
    background: var(--pos-primary-glow);
    outline: 2px solid var(--pos-primary);
    outline-offset: -1px;
}

/* Discount badge — compact tag on item name row */
.cart-discount-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 6px;
    font-size: .62rem;
    font-weight: 700;
    color: var(--pos-danger);
    background: var(--pos-danger-glow);
    border-radius: 4px;
    letter-spacing: .02em;
    flex-shrink: 0;
}

/* VAT badge — compact tag next to discount badge */
.cart-vat-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 5px;
    font-size: .58rem;
    font-weight: 700;
    color: var(--pos-success);
    background: rgba(34, 197, 94, .1);
    border-radius: 4px;
    letter-spacing: .02em;
    flex-shrink: 0;
}

/* Item label in cart line — truncate */
.cart-item-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.pos-qty-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--pos-border);
    border-radius: 6px;
    background: var(--pos-surface-2);
    color: var(--pos-text);
    font-size: .85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition-fast);
    line-height: 1;
}
.pos-qty-btn:hover {
    background: var(--pos-primary);
    border-color: var(--pos-primary);
    color: #fff;
}
.pos-qty-btn:active { transform: scale(.88); }

/* Line Editor */
.pos-line-editor {
    padding: 6px 14px;
    background: var(--pos-surface);
    border-top: 1px solid var(--pos-border);
    border-bottom: 1px solid var(--pos-border);
}

.editor-row {
    display: flex;
    gap: 4px;
}

.pos-mode-btn {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: transparent;
    color: var(--pos-text-secondary);
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition);
    text-transform: uppercase;
    letter-spacing: .04em;
    text-align: center;
}
.pos-mode-btn:hover { background: var(--pos-surface-2); color: var(--pos-text-secondary); }
.pos-mode-btn.active {
    background: var(--pos-primary);
    color: #fff;
    border-color: var(--pos-primary);
    box-shadow: 0 2px 10px var(--pos-primary-glow);
}

.pos-remove-btn {
    padding: 6px 12px;
    border: 1px solid var(--pos-danger);
    border-radius: var(--pos-r-sm);
    background: rgba(248, 113, 113, .08);
    color: var(--pos-danger);
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition);
    text-transform: uppercase;
}
.pos-remove-btn:hover {
    background: var(--pos-danger);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════════
   NUMPAD
   ═══════════════════════════════════════════════════════════════ */
.pos-numpad {
    padding: 6px 14px 8px;
    background: var(--pos-surface);
    border-top: 1px solid var(--pos-border);
}

.numpad-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: var(--pos-input-bg);
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    min-height: 40px;
}

.numpad-display-mode {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--pos-primary);
    background: rgba(99, 102, 241, .12);
    padding: 3px 8px;
    border-radius: 4px;
}

.numpad-display-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--pos-text);
    font-family: 'Courier New', monospace;
    letter-spacing: .04em;
    text-align: right;
    min-width: 60px;
}

.numpad-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 4px;
}
.numpad-row:last-child { margin-bottom: 0; }

.numpad-btn {
    padding: 12px 0;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    color: var(--pos-text);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition-fast);
    text-align: center;
    touch-action: manipulation;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.numpad-btn:hover {
    background: var(--pos-surface-3);
    border-color: var(--pos-border-focus);
}
.numpad-btn:active {
    transform: scale(.92);
    background: var(--pos-surface-hover);
}

.numpad-btn.clear-btn {
    color: var(--pos-warning);
    border-color: rgba(251, 191, 36, .2);
}
.numpad-btn.clear-btn:hover { background: rgba(251, 191, 36, .1); }

.numpad-btn.confirm-btn {
    background: linear-gradient(135deg, var(--pos-primary), var(--pos-accent));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 10px var(--pos-primary-glow);
    font-weight: 800;
}
.numpad-btn.confirm-btn:hover { box-shadow: 0 4px 20px var(--pos-primary-glow); }

/* Notes */
.pos-notes-section {
    display: flex;
    gap: 6px;
    padding: 6px 14px 8px;
    background: var(--pos-surface);
    border-top: 1px solid var(--pos-border);
}

.pos-notes-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-input-bg);
    color: var(--pos-text);
    font-size: .78rem;
    outline: none;
    transition: border-color var(--pos-transition);
}
.pos-notes-input:focus { border-color: var(--pos-primary); }
.pos-notes-input::placeholder { color: var(--pos-text-dim); }

.pos-note-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    color: var(--pos-text-secondary);
    cursor: pointer;
    transition: all var(--pos-transition);
}
.pos-note-btn:hover { background: var(--pos-surface-3); border-color: var(--pos-border-focus); }

/* ═══════════════════════════════════════════════════════════════
   RIGHT PANEL — Summary, Actions, Payments
   ═══════════════════════════════════════════════════════════════ */
.pos-right {
    display: flex;
    flex-direction: column;
    background: var(--pos-bg);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--pos-border) transparent;
}

/* Summary */
.pos-summary {
    padding: 12px 14px;
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: .8rem;
    color: var(--pos-text-secondary);
}
.summary-row span:last-child {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    margin-top: 4px;
    border-top: 2px solid var(--pos-border);
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--pos-text);
}
.summary-total span:last-child {
    color: var(--pos-primary);
    font-variant-numeric: tabular-nums;
}

.summary-remain {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    margin-top: 6px;
    border-radius: var(--pos-r-sm);
    font-size: .88rem;
    font-weight: 800;
}
.summary-remain.pending {
    background: rgba(251, 191, 36, .08);
    border: 1px solid rgba(251, 191, 36, .2);
    color: var(--pos-warning);
}
.summary-remain.complete {
    background: rgba(52, 211, 153, .08);
    border: 1px solid rgba(52, 211, 153, .2);
    color: var(--pos-success);
}
.summary-remain span:last-child { font-variant-numeric: tabular-nums; }

/* Invoice discount row with inline input */
.summary-discount-entry {
    align-items: center;
}
.summary-inline-input {
    display: flex;
    align-items: center;
}
.summary-disc-input {
    width: 80px;
    padding: 3px 6px;
    border: 1px solid var(--pos-border);
    border-radius: 4px;
    background: var(--pos-input-bg);
    color: var(--pos-danger);
    font-size: .78rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: right;
    outline: none;
    transition: border-color .15s;
}
.summary-disc-input:focus {
    border-color: var(--pos-danger);
    box-shadow: 0 0 0 2px var(--pos-danger-glow);
}

/* Customer */
.pos-customer-section {
    display: flex;
    gap: 6px;
    padding: 8px 14px;
    background: var(--pos-surface);
    border-bottom: 1px solid var(--pos-border);
}

.pos-customer-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-input-bg);
    color: var(--pos-text);
    font-size: .8rem;
    outline: none;
    transition: border-color var(--pos-transition);
}
.pos-customer-input:focus { border-color: var(--pos-primary); }
.pos-customer-input::placeholder { color: var(--pos-text-dim); }

.pos-customer-clear {
    padding: 0 10px;
    border: 1px solid var(--pos-danger);
    border-radius: var(--pos-r-sm);
    background: rgba(248, 113, 113, .06);
    color: var(--pos-danger);
    font-size: .7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition);
    white-space: nowrap;
}
.pos-customer-clear:hover { background: var(--pos-danger); color: #fff; }

/* Action Buttons */
.pos-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 8px 14px;
}

.pos-btn-action {
    padding: 10px 8px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    color: var(--pos-text);
    font-size: .76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .03em;
    touch-action: manipulation;
    min-height: 40px;
}
.pos-btn-action:hover {
    background: var(--pos-surface-3);
    border-color: var(--pos-border-focus);
    transform: translateY(-1px);
}
.pos-btn-action:active { transform: scale(.95); }

.pos-btn-action.hold { border-color: rgba(56, 189, 248, .25); color: var(--pos-info); }
.pos-btn-action.hold:hover { background: rgba(56, 189, 248, .1); }

.pos-btn-action.recall { border-color: rgba(129, 140, 248, .25); color: var(--pos-accent); }
.pos-btn-action.recall:hover { background: rgba(129, 140, 248, .1); }

.pos-btn-action.return { border-color: rgba(251, 191, 36, .25); color: var(--pos-warning); }
.pos-btn-action.return:hover { background: rgba(251, 191, 36, .1); }

.pos-btn-action.void { border-color: rgba(248, 113, 113, .25); color: var(--pos-danger); }
.pos-btn-action.void:hover { background: rgba(248, 113, 113, .1); }

.pos-btn-action.find { border-color: rgba(168, 85, 247, .25); color: #a855f7; }
.pos-btn-action.find:hover { background: rgba(168, 85, 247, .1); }

.pos-btn-action.complete {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, var(--pos-complete-grad-1), var(--pos-complete-grad-2));
    color: #fff;
    border-color: transparent;
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 4px 16px var(--pos-success-glow);
    min-height: 48px;
}
.pos-btn-action.complete:hover {
    box-shadow: 0 6px 28px var(--pos-success-glow);
    transform: translateY(-2px);
}

.pos-btn-action.disabled,
.pos-btn-action[disabled] {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

/* Payment Methods */
.pos-payment-methods {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    padding: 4px 14px 8px;
}

.payment-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    color: var(--pos-text);
    font-size: .74rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition);
    touch-action: manipulation;
    min-height: 42px;
}
.payment-btn:hover { transform: translateY(-1px); }
.payment-btn:active { transform: scale(.95); }

.payment-btn.cash {
    border-color: rgba(52, 211, 153, .3);
    color: var(--pos-cash);
}
.payment-btn.cash:hover { background: rgba(52, 211, 153, .1); box-shadow: 0 4px 12px var(--pos-success-glow); }

.payment-btn.card {
    border-color: rgba(129, 140, 248, .3);
    color: var(--pos-card);
}
.payment-btn.card:hover { background: rgba(129, 140, 248, .1); }

.payment-btn.transfer {
    border-color: rgba(56, 189, 248, .3);
    color: var(--pos-transfer);
}
.payment-btn.transfer:hover { background: rgba(56, 189, 248, .1); }

.payment-btn.check {
    border-color: rgba(251, 191, 36, .3);
    color: var(--pos-check);
}
.payment-btn.check:hover { background: rgba(251, 191, 36, .1); }

/* Payment button sub-elements */
.payment-btn-img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    flex-shrink: 0;
}
.payment-btn-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
    line-height: 1;
}
.payment-btn-label {
    font-size: .72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Additional trade type colors */
.payment-btn.loyalty {
    border-color: rgba(250, 204, 21, .3);
    color: #facc15;
}
.payment-btn.loyalty:hover { background: rgba(250, 204, 21, .1); }

.payment-btn.membership {
    border-color: rgba(168, 85, 247, .3);
    color: #a855f7;
}
.payment-btn.membership:hover { background: rgba(168, 85, 247, .1); }

.payment-btn.offer {
    border-color: rgba(244, 114, 182, .3);
    color: #f472b6;
}
.payment-btn.offer:hover { background: rgba(244, 114, 182, .1); }

.payment-btn.other {
    border-color: rgba(148, 163, 184, .3);
    color: #94a3b8;
}
.payment-btn.other:hover { background: rgba(148, 163, 184, .1); }

/* More/Less toggle button */
.payment-btn.more-btn {
    border-style: dashed;
    border-color: rgba(148, 163, 184, .4);
    color: var(--pos-text-secondary);
    font-size: .68rem;
}
.payment-btn.more-btn:hover {
    background: rgba(148, 163, 184, .08);
    border-color: var(--pos-primary);
    color: var(--pos-primary);
}

/* Invoice Browser Button */
.pos-invoice-browser {
    padding: 0;
}

.pos-browse-btn {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--pos-border);
    background: linear-gradient(135deg, var(--pos-surface-2), var(--pos-surface));
    color: var(--pos-text);
    font-size: .95rem;
    font-weight: 500;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--pos-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.pos-browse-btn:hover {
    border-color: var(--pos-primary);
    background: linear-gradient(135deg, var(--pos-surface-3), var(--pos-surface-2));
    color: var(--pos-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
}

.pos-browse-btn:active {
    transform: translateY(0) scale(.98);
}

/* ═══════════════════════════════════════════════════════════════
   MODAL DIALOGS
   ═══════════════════════════════════════════════════════════════ */
.pos-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    animation: fade-in .15s ease;
}

.pos-modal-dialog {
    width: 90%;
    max-width: 480px;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 16px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, .15),
        0 0 1px rgba(0, 0, 0, .1);
    animation: modal-slide .3s cubic-bezier(.34, 1.56, .64, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

[data-pos-theme="light"] .pos-modal-dialog {
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, .1),
        0 0 1px rgba(0, 0, 0, .08);
}

.pos-modal-dialog.warning-dialog {
    border-color: rgba(251, 191, 36, .25);
    box-shadow: 
        0 20px 40px rgba(251, 191, 36, .15),
        0 0 1px rgba(251, 191, 36, .1);
}

.pos-modal-dialog.large-dialog,
.pos-modal-dialog.return-dialog {
    max-width: 580px;
    max-height: 85vh;
}

@keyframes modal-slide {
    from { 
        opacity: 0; 
        transform: translateY(24px) scale(.96);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--pos-border);
    background: linear-gradient(135deg, var(--pos-surface), rgba(79, 70, 229, .02));
}

[data-pos-theme="light"] .modal-header {
    background: linear-gradient(135deg, var(--pos-surface), rgba(79, 70, 229, .04));
}

.modal-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -.3px;
    color: var(--pos-text-primary);
}

.modal-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--pos-border);
    border-radius: 10px;
    background: transparent;
    color: var(--pos-text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--pos-transition);
}

.modal-close:hover {
    background: rgba(79, 70, 229, .08);
    border-color: var(--pos-primary);
    color: var(--pos-primary);
    transform: rotate(90deg);
}

.modal-close:active {
    transform: rotate(90deg) scale(.92);
}

.modal-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-body p {
    margin: 0 0 14px;
    color: var(--pos-text-secondary);
    font-size: .9rem;
    line-height: 1.5;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--pos-border);
    background: rgba(79, 70, 229, .02);
}

[data-pos-theme="light"] .modal-footer {
    background: rgba(79, 70, 229, .04);
}

.dialog-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.dialog-row:last-child {
    margin-bottom: 0;
}

.dialog-row label {
    font-size: .85rem;
    font-weight: 600;
    color: var(--pos-text-secondary);
    text-transform: uppercase;
    letter-spacing: .5px;
}

.pos-dialog-input {
    padding: 12px 14px;
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-input-bg);
    color: var(--pos-text-primary);
    font-size: .95rem;
    font-family: 'Courier New', monospace;
    transition: all var(--pos-transition);
}

.pos-dialog-input:focus {
    outline: none;
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
    background: var(--pos-surface);
}

.pos-dialog-input:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.pos-dialog-btn {
    padding: 10px 16px;
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-surface);
    color: var(--pos-text-primary);
    font-size: .85rem;
    font-weight: 600;
    letter-spacing: .3px;
    cursor: pointer;
    transition: all var(--pos-transition);
    white-space: nowrap;
}

.pos-dialog-btn:hover {
    border-color: var(--pos-primary);
    background: rgba(79, 70, 229, .06);
    transform: translateY(-1px);
}

.pos-dialog-btn:active {
    transform: translateY(0) scale(.98);
}

.pos-dialog-btn.confirm {
    border-color: var(--pos-primary);
    background: var(--pos-primary);
    color: white;
}

.pos-dialog-btn.confirm:hover {
    background: var(--pos-primary-hover);
    box-shadow: 0 8px 20px rgba(79, 70, 229, .35);
}

.pos-dialog-btn.cancel {
    border-color: var(--pos-border);
}

.pos-dialog-btn.cancel:hover {
    border-color: var(--pos-text-secondary);
    background: rgba(0, 0, 0, .04);
}

.pos-dialog-btn.danger {
    border-color: var(--pos-danger);
    background: var(--pos-danger);
    color: white;
}

.pos-dialog-btn.danger:hover {
    background: #b91c1c;
    box-shadow: 0 8px 20px rgba(220, 38, 38, .35);
}

.pos-dialog-btn.quick {
    flex: 1;
    border-color: var(--pos-border);
    background: rgba(79, 70, 229, .06);
    color: var(--pos-primary);
    border-color: rgba(79, 70, 229, .2);
}

.pos-dialog-btn.quick:hover {
    background: rgba(79, 70, 229, .12);
    border-color: var(--pos-primary);
}

.pos-dialog-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   PAYMENT DIALOG — PREMIUM DESIGN
   ═══════════════════════════════════════════════════════════════ */

.payment-dialog {
    max-width: 440px;
}

.payment-amount-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(79, 70, 229, .08), rgba(99, 102, 241, .04));
    border: 1.5px solid rgba(79, 70, 229, .2);
    border-radius: 14px;
}

.payment-amount-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--pos-text-secondary);
    margin-bottom: 6px;
}

.payment-amount-value {
    font-size: 2rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
    color: var(--pos-primary);
    letter-spacing: -.5px;
}

.payment-input {
    font-size: 1.2rem !important;
    text-align: center;
    font-weight: 700 !important;
    padding: 14px 16px !important;
}

.payment-quick-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.payment-quick-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 8px;
    border: 1.5px solid var(--pos-border);
    border-radius: 12px;
    background: var(--pos-input-bg);
    cursor: pointer;
    transition: all var(--pos-transition);
}

.payment-quick-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
}

.payment-quick-btn:active {
    transform: translateY(0) scale(.97);
}

.payment-quick-btn.exact {
    border-color: rgba(34, 197, 94, .3);
}
.payment-quick-btn.exact:hover {
    border-color: rgba(34, 197, 94, .6);
    background: rgba(34, 197, 94, .08);
}

.payment-quick-btn.round {
    border-color: rgba(99, 102, 241, .3);
}
.payment-quick-btn.round:hover {
    border-color: rgba(99, 102, 241, .6);
    background: rgba(99, 102, 241, .08);
}

.payment-quick-btn.ceil {
    border-color: rgba(251, 146, 60, .3);
}
.payment-quick-btn.ceil:hover {
    border-color: rgba(251, 146, 60, .6);
    background: rgba(251, 146, 60, .08);
}

.quick-btn-icon {
    font-size: 1.1rem;
}

.quick-btn-label {
    font-size: .7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--pos-text-secondary);
}

.quick-btn-value {
    font-size: .85rem;
    font-weight: 700;
    color: var(--pos-text-primary);
    font-family: 'Courier New', monospace;
}

.payment-change-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    margin-top: 12px;
    background: rgba(34, 197, 94, .08);
    border: 1.5px solid rgba(34, 197, 94, .3);
    border-radius: 10px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--pos-success);
}

.payment-change-value {
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'Courier New', monospace;
}

/* ═══════════════════════════════════════════════════════════════
   VOID DIALOG — PREMIUM DESIGN
   ═══════════════════════════════════════════════════════════════ */

.warning-header {
    border-bottom-color: rgba(251, 191, 36, .3) !important;
    background: linear-gradient(135deg, var(--pos-surface), rgba(251, 191, 36, .06)) !important;
}

.void-warning-icon {
    font-size: 2.5rem;
    opacity: .8;
}

/* ═══════════════════════════════════════════════════════════════
   RETURN DIALOG — PREMIUM DESIGN
   ═══════════════════════════════════════════════════════════════ */

.return-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.return-step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
    margin: 0 auto 0 16px;
}

.return-step {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .75rem;
    font-weight: 700;
    border: 2px solid var(--pos-border);
    color: var(--pos-text-secondary);
    background: transparent;
    transition: all .3s ease;
}

.return-step.active {
    border-color: var(--pos-primary);
    background: var(--pos-primary);
    color: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .15);
}

.return-step.done {
    border-color: var(--pos-success);
    background: var(--pos-success);
    color: white;
}

.return-step-line {
    width: 32px;
    height: 2px;
    background: var(--pos-border);
    transition: all .3s ease;
}

.return-step-line.active {
    background: var(--pos-primary);
}

.return-search-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-section-label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--pos-text-secondary);
    letter-spacing: .3px;
}

.return-search-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.return-results-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.return-search-results {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.return-search-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-input-bg);
    cursor: pointer;
    transition: all .2s ease;
    gap: 12px;
}

.return-search-item:hover {
    border-color: var(--pos-primary);
    background: rgba(79, 70, 229, .06);
    transform: translateX(3px);
}

.return-search-item.selected {
    border-color: var(--pos-primary);
    background: rgba(79, 70, 229, .1);
    box-shadow: inset 3px 0 0 var(--pos-primary);
}

.return-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.return-search-id {
    font-size: .85rem;
    font-weight: 700;
    color: var(--pos-text-primary);
    font-family: 'Courier New', monospace;
}

.return-search-customer {
    font-size: .78rem;
    color: var(--pos-text-secondary);
}

.return-item-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.return-search-amount {
    font-size: .9rem;
    font-weight: 700;
    color: var(--pos-text-primary);
    font-family: 'Courier New', monospace;
}

.return-search-date {
    font-size: .72rem;
    color: var(--pos-text-secondary);
}

.return-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 32px 16px;
    color: var(--pos-text-secondary);
    font-size: .85rem;
}

.empty-state-icon {
    font-size: 2rem;
    opacity: .5;
}

.return-source-info {
    padding: 12px 14px;
    background: rgba(79, 70, 229, .08);
    border: 1px solid rgba(79, 70, 229, .2);
    border-radius: 10px;
}

.return-source-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .85rem;
    color: var(--pos-text-secondary);
    font-weight: 500;
}

.return-items-header {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(79, 70, 229, .04);
    border-radius: 8px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--pos-text-secondary);
}

.return-items-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 260px;
    overflow-y: auto;
}

.return-item-row {
    display: grid;
    grid-template-columns: 2fr 0.8fr 0.8fr 1fr;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--pos-border);
    border-radius: 8px;
    background: var(--pos-input-bg);
    transition: all .2s ease;
    align-items: center;
}

.return-item-row:hover {
    border-color: rgba(79, 70, 229, .3);
}

.return-item-row.has-return {
    border-color: rgba(34, 197, 94, .4);
    background: rgba(34, 197, 94, .06);
}

.return-item-name {
    font-size: .85rem;
    font-weight: 500;
    color: var(--pos-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.return-item-sold {
    text-align: center;
    font-size: .85rem;
    font-weight: 600;
    color: var(--pos-text-secondary);
}

.return-item-input {
    display: flex;
    justify-content: center;
}

.return-qty-input {
    width: 56px;
    padding: 6px 8px;
    text-align: center;
    border: 1.5px solid var(--pos-border);
    border-radius: 8px;
    background: var(--pos-surface);
    color: var(--pos-text-primary);
    font-size: .85rem;
    font-weight: 600;
    transition: all var(--pos-transition);
    -moz-appearance: textfield;
}

.return-qty-input::-webkit-outer-spin-button,
.return-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.return-qty-input:focus {
    outline: none;
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .15);
}

.return-item-row.has-return .return-qty-input {
    border-color: rgba(34, 197, 94, .5);
    background: rgba(34, 197, 94, .06);
}

.return-item-price {
    text-align: right;
    font-size: .85rem;
    font-weight: 500;
    color: var(--pos-text-secondary);
    font-family: 'Courier New', monospace;
}

.return-total-row {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(79, 70, 229, .08), rgba(99, 102, 241, .04));
    border: 2px solid var(--pos-primary);
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: .9rem;
    color: var(--pos-primary);
}

.return-total-value {
    font-size: 1.15rem;
    font-family: 'Courier New', monospace;
    letter-spacing: -.3px;
}

/* ═══════════════════════════════════════════════════════════════
   CUSTOMER SEARCH DIALOG — PREMIUM DESIGN
   ═══════════════════════════════════════════════════════════════ */

.customer-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-input-bg);
    cursor: pointer;
    transition: all .2s ease;
}

.customer-result-card:hover {
    border-color: var(--pos-primary);
    background: rgba(79, 70, 229, .06);
    transform: translateX(3px);
}

.customer-result-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .9rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--pos-primary), rgba(99, 102, 241, .8));
    color: white;
    flex-shrink: 0;
}

.customer-result-info {
    flex: 1;
    min-width: 0;
}

.customer-result-name {
    font-size: .9rem;
    font-weight: 600;
    color: var(--pos-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-result-meta {
    display: flex;
    gap: 10px;
    font-size: .75rem;
    color: var(--pos-text-secondary);
    margin-top: 2px;
}

.customer-result-balance {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex-shrink: 0;
}

.customer-result-balance .balance-value {
    font-size: .9rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--pos-text-primary);
}

.customer-result-balance.negative .balance-value {
    color: var(--pos-danger);
}

.customer-result-balance.positive .balance-value {
    color: var(--pos-success);
}

.customer-result-balance .balance-label {
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--pos-text-secondary);
}

/* ═══════════════════════════════════════════════════════════════
   SESSION SUMMARY — PREMIUM DESIGN
   ═══════════════════════════════════════════════════════════════ */

.session-close-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--pos-border);
}

.session-footer {
    flex-wrap: wrap;
}

.pos-customer-search-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1.5px solid var(--pos-primary);
    border-radius: 10px;
    background: var(--pos-primary);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--pos-transition);
    flex-shrink: 0;
}

.pos-customer-search-btn:hover {
    background: var(--pos-primary-hover);
    box-shadow: 0 6px 16px var(--pos-primary-glow);
    transform: translateY(-1px);
}

.pos-customer-search-btn:active {
    transform: translateY(0) scale(.96);
}

.pos-customer-search-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME — DIALOG OVERRIDES
   ═══════════════════════════════════════════════════════════════ */

[data-pos-theme="light"] .pos-dialog-btn {
    border-color: #d4d8e1;
    color: #1a1a2e;
    background: #ffffff;
}

[data-pos-theme="light"] .pos-dialog-btn:hover {
    background: #f7f8fa;
    border-color: #4f6ef7;
    color: #1a1a2e;
}

[data-pos-theme="light"] .pos-dialog-btn.confirm {
    border-color: #4f6ef7;
    background: #4f6ef7;
    color: #ffffff;
}

[data-pos-theme="light"] .pos-dialog-btn.confirm:hover {
    background: #3b5ce6;
    border-color: #3b5ce6;
    box-shadow: 0 8px 20px rgba(79, 110, 247, .2);
}

[data-pos-theme="light"] .pos-dialog-btn.cancel {
    border-color: #d4d8e1;
    color: #1a1a2e;
    background: #ffffff;
}

[data-pos-theme="light"] .pos-dialog-btn.cancel:hover {
    border-color: #4a5568;
    background: #f0f2f5;
    color: #1a1a2e;
}

[data-pos-theme="light"] .pos-dialog-btn.danger {
    border-color: #dc2626;
    background: #dc2626;
    color: #ffffff;
}

[data-pos-theme="light"] .pos-dialog-btn.danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    box-shadow: 0 8px 20px rgba(220, 38, 38, .15);
}

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(.92) translateY(-4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes slideInLeft {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

@keyframes success-pop {
    0%   { transform: scale(.6); opacity: 0; }
    60%  { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes toast-in {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to   { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ═══════════════════════════════════════════════════════════════
   GATE OVERLAY — Open Transaction / Access Denied / Loading
   ═══════════════════════════════════════════════════════════════ */

.pos-gate-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--pos-bg);
    z-index: 5000;
    animation: fade-in .25s ease;
    overflow: hidden;
}

/* ── Animated background orbs ── */
.pos-gate-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.pos-gate-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    will-change: transform;
}

.pos-gate-orb--1 {
    width: 380px;
    height: 380px;
    background: var(--pos-primary);
    top: -60px;
    left: -40px;
    animation: pos-gate-drift1 14s ease-in-out infinite alternate;
}

.pos-gate-orb--2 {
    width: 320px;
    height: 320px;
    background: var(--pos-accent);
    bottom: -50px;
    right: -30px;
    animation: pos-gate-drift2 16s ease-in-out infinite alternate;
}

.pos-gate-orb--3 {
    width: 240px;
    height: 240px;
    background: var(--pos-success);
    top: 45%;
    left: 60%;
    animation: pos-gate-drift3 18s ease-in-out infinite alternate;
}

@keyframes pos-gate-drift1 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(100px, 70px) scale(1.12); }
}
@keyframes pos-gate-drift2 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-90px, -80px) scale(1.08); }
}
@keyframes pos-gate-drift3 {
    0%   { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-50px, 40px) scale(0.92); }
}

/* ── Premium card ── */
.pos-gate-card--premium {
    position: relative;
    z-index: 1;
    width: 460px;
    max-width: 92vw;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 24px;
    padding: 0 32px 32px;
    box-shadow: var(--pos-shadow-lg), var(--pos-shadow-glow);
    animation: pos-gate-card-in .5s cubic-bezier(.22, 1, .36, 1) both;
    overflow: hidden;
}

@keyframes pos-gate-card-in {
    0%   { opacity: 0; transform: translateY(24px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* Top gradient strip */
.pos-gate-header-strip {
    margin: 0 -32px;
    height: 4px;
    background: linear-gradient(90deg,
        var(--pos-logo-grad-1),
        var(--pos-accent),
        var(--pos-primary),
        var(--pos-success));
    background-size: 200% 100%;
    animation: pos-gate-strip-shimmer 4s ease-in-out infinite;
}

@keyframes pos-gate-strip-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

/* ── Hero section ── */
.pos-gate-hero {
    text-align: center;
    padding: 28px 0 20px;
}

.pos-gate-icon-ring {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg,
        rgba(124, 58, 237, .12),
        rgba(99, 102, 241, .12));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pos-gate-ring-pulse 3s ease-in-out infinite;
}

@keyframes pos-gate-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 58, 237, .10); }
    50%      { box-shadow: 0 0 0 12px rgba(124, 58, 237, .04); }
}

.pos-gate-card--premium .pos-gate-icon {
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
    font-size: 1.8rem;
}

.pos-gate-card--premium .pos-gate-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--pos-text);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}

.pos-gate-card--premium .pos-gate-subtitle {
    font-size: .88rem;
    color: var(--pos-text-dim);
    margin: 0;
}

/* ── Info rows ── */
.pos-gate-card--premium .pos-gate-info {
    background: var(--pos-surface-2);
    border: 1px solid var(--pos-border);
    border-radius: 14px;
    margin-bottom: 18px;
    overflow: hidden;
}

.pos-gate-card--premium .pos-gate-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    font-size: .84rem;
    color: var(--pos-text-secondary);
    border-bottom: 1px solid var(--pos-border);
    transition: background var(--pos-transition-fast);
}

.pos-gate-card--premium .pos-gate-info-row:hover {
    background: var(--pos-surface-3);
}

.pos-gate-card--premium .pos-gate-info-row:last-child {
    border-bottom: none;
}

.pos-gate-info-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--pos-text-secondary);
}

.pos-gate-info-emoji {
    display: inline-flex;
    width: 22px;
    justify-content: center;
    font-size: .92rem;
}

.pos-gate-info-value {
    font-weight: 700;
    color: var(--pos-text) !important;
}

.pos-gate-info-row--select {
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px;
}

.pos-gate-card--premium .pos-gate-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--pos-border);
    border-radius: 10px;
    background: var(--pos-input-bg);
    color: var(--pos-text);
    font-size: .84rem;
    outline: none;
    cursor: pointer;
    transition: border-color var(--pos-transition), box-shadow var(--pos-transition);
}

.pos-gate-card--premium .pos-gate-select:focus {
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px var(--pos-primary-glow);
}

/* ── Cash amount input ── */
.pos-gate-card--premium .pos-gate-field {
    margin-bottom: 16px;
}

.pos-gate-card--premium .pos-gate-field label {
    display: block;
    font-size: .76rem;
    font-weight: 700;
    color: var(--pos-text-secondary);
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: 8px;
}

.pos-gate-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.pos-gate-input-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.pos-gate-input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border: 1.5px solid var(--pos-border);
    border-radius: 12px;
    background: var(--pos-input-bg);
    color: var(--pos-text);
    font-size: 1rem;
    font-weight: 600;
    outline: none;
    transition: border-color var(--pos-transition), box-shadow var(--pos-transition);
}

.pos-gate-input:focus {
    border-color: var(--pos-primary);
    box-shadow: 0 0 0 3px var(--pos-primary-glow);
}

.pos-gate-input::placeholder {
    color: var(--pos-text-dim);
    font-weight: 400;
    opacity: 0.6;
}

/* ── Buttons ── */
.pos-gate-card--premium .pos-gate-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 4px;
}

.pos-gate-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 11px 22px;
    border: none;
    border-radius: 12px;
    font-size: .88rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
    white-space: nowrap;
}

.pos-gate-btn:active {
    transform: scale(0.97);
}

.pos-gate-btn--secondary {
    background: var(--pos-surface-3);
    color: var(--pos-text-secondary);
    border: 1px solid var(--pos-border);
}

.pos-gate-btn--secondary:hover {
    background: var(--pos-surface-hover);
    border-color: var(--pos-border-focus);
}

.pos-gate-btn--primary {
    background: linear-gradient(135deg, var(--pos-logo-grad-1) 0%, var(--pos-accent) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(124, 58, 237, .3);
}

.pos-gate-btn--primary:hover {
    box-shadow: 0 6px 24px rgba(124, 58, 237, .45);
    transform: translateY(-1px);
}

/* ── Gate error banner ── */
.pos-gate-error {
    padding: 10px 14px;
    background: rgba(248, 113, 113, .08);
    border: 1px solid rgba(248, 113, 113, .2);
    border-radius: 10px;
    color: var(--pos-danger);
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 16px;
    animation: pos-gate-card-in .3s ease both;
}

/* ═══════════════════════════════════════════════════════════════
   THEME PICKER
   ═══════════════════════════════════════════════════════════════ */

.pos-theme-picker-wrap {
    position: relative;
}

.pos-theme-picker {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 180px;
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r);
    box-shadow: var(--pos-shadow-lg);
    z-index: 200;
    padding: 6px;
    animation: fadeInScale .15s ease;
}

.theme-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: var(--pos-r-sm);
    background: transparent;
    color: var(--pos-text-secondary);
    font-size: .78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--pos-transition);
    text-align: left;
}
.theme-option:hover {
    background: var(--pos-surface-2);
    border-color: var(--pos-border);
    color: var(--pos-text);
}
.theme-option.active {
    background: var(--pos-primary-glow);
    border-color: var(--pos-primary);
    color: var(--pos-primary);
    font-weight: 700;
}

.theme-swatch {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 1px solid var(--pos-border);
    flex-shrink: 0;
}
.dark-swatch     { background: linear-gradient(135deg, #080a10, #1d2333); }
.light-swatch    { background: linear-gradient(135deg, #f0f2f5, #ffffff); }
.midnight-swatch { background: linear-gradient(135deg, #060d1f, #1a2c52); }
.contrast-swatch { background: linear-gradient(135deg, #000000, #2a2a2a); }

.theme-divider {
    height: 1px;
    background: var(--pos-border);
    margin: 4px 0;
}

/* ═══════════════════════════════════════════════════════════════
   INVOICE DRAWER (slide-in from right)
   ═══════════════════════════════════════════════════════════════ */

.pos-drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--pos-modal-backdrop);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    animation: fade-in .15s ease;
}

.pos-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100vh;
    background: var(--pos-surface);
    border-left: 1px solid var(--pos-border);
    box-shadow: -8px 0 40px rgba(0, 0, 0, .4);
    display: flex;
    flex-direction: column;
    z-index: 3001;
    animation: slideInLeft .25s cubic-bezier(.4, 0, .2, 1);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--pos-surface), var(--pos-surface-2));
    border-bottom: 1px solid var(--pos-border);
    flex-shrink: 0;
}
.drawer-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: var(--pos-text);
}

.drawer-close {
    width: 32px;
    height: 32px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: transparent;
    color: var(--pos-text-secondary);
    font-size: .9rem;
    cursor: pointer;
    transition: all var(--pos-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.drawer-close:hover {
    background: rgba(248, 113, 113, .1);
    border-color: var(--pos-danger);
    color: var(--pos-danger);
}

.drawer-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--pos-border);
    flex-shrink: 0;
}

.drawer-tab {
    flex: 1;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: var(--pos-text-dim);
    font-size: .75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--pos-transition);
    text-align: center;
    border-bottom: 2px solid transparent;
}
.drawer-tab:hover {
    color: var(--pos-text-secondary);
    background: var(--pos-surface-2);
}
.drawer-tab.active {
    color: var(--pos-primary);
    border-bottom-color: var(--pos-primary);
    background: rgba(91, 154, 255, .04);
}

.drawer-content {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--pos-border) transparent;
}

.drawer-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px 12px;
    margin-bottom: 4px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    cursor: pointer;
    transition: all var(--pos-transition);
    font-size: .78rem;
}
.drawer-item:hover {
    background: var(--pos-glow);
    border-color: var(--pos-primary);
    transform: translateX(-2px);
}
.drawer-item.return-item {
    border-color: rgba(248, 113, 113, .2);
}
.drawer-item.return-item:hover {
    border-color: var(--pos-danger);
}

.item-id {
    font-weight: 800;
    color: var(--pos-primary);
    font-family: monospace;
    font-size: .72rem;
    white-space: nowrap;
}

.item-customer {
    color: var(--pos-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-amount {
    font-weight: 800;
    color: var(--pos-success);
    font-variant-numeric: tabular-nums;
    font-family: monospace;
    white-space: nowrap;
}

.item-time {
    color: var(--pos-text-dim);
    font-size: .68rem;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════════
   FULLY PAID BANNER (appears after payment completes balance)
   ═══════════════════════════════════════════════════════════════ */

.pos-fullpaid-banner {
    position: fixed;
    top: 52px; left: 50%; transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 32px;
    background: linear-gradient(135deg, var(--pos-success-dark), var(--pos-success));
    color: #fff;
    border-radius: var(--pos-r-lg);
    box-shadow: 0 8px 32px var(--pos-success-glow), 0 0 0 2px rgba(255,255,255,.15) inset;
    z-index: 5500;
    cursor: pointer;
    animation: fullpaid-slide .4s cubic-bezier(.34, 1.56, .64, 1);
    font-weight: 700;
    font-size: .95rem;
    white-space: nowrap;
}
.fullpaid-icon { font-size: 1.5rem; }
.fullpaid-text { font-size: 1.1rem; font-weight: 800; letter-spacing: .01em; }
.fullpaid-hint {
    font-size: .72rem;
    font-weight: 600;
    opacity: .8;
    background: rgba(255,255,255,.18);
    padding: 2px 8px;
    border-radius: 4px;
}

@keyframes fullpaid-slide {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px) scale(.9); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   SUCCESS OVERLAY
   ═══════════════════════════════════════════════════════════════ */

.pos-success-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 6000;
    cursor: pointer;
    animation: fade-in .2s ease;
}

.pos-success-card {
    text-align: center;
    background: var(--pos-surface);
    border: 2px solid var(--pos-success);
    border-radius: var(--pos-r-xl);
    padding: 44px 48px;
    box-shadow: var(--pos-shadow-lg), 0 0 60px var(--pos-success-glow);
    animation: success-pop .4s cubic-bezier(.34, 1.56, .64, 1);
    min-width: 340px;
}

.pos-success-card .success-icon {
    font-size: 4rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px var(--pos-success-glow));
}

.pos-success-card h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--pos-success);
    margin: 0 0 16px;
    text-shadow: 0 0 20px var(--pos-success-glow);
}

.pos-success-id {
    font-size: .9rem;
    font-weight: 700;
    color: var(--pos-primary);
    font-family: monospace;
    margin-bottom: 6px;
}

.pos-success-amount {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--pos-success);
    font-family: 'Courier New', monospace;
    margin-bottom: 10px;
    text-shadow: 0 0 16px var(--pos-success-glow);
}

.pos-success-change-row {
    font-size: .95rem;
    font-weight: 700;
    color: var(--pos-warning);
    background: rgba(251, 191, 36, .08);
    border: 1px solid rgba(251, 191, 36, .2);
    border-radius: var(--pos-r-sm);
    padding: 8px 18px;
    display: inline-block;
    margin-top: 4px;
}

/* Partial-payment overlay (not fully paid) */
.pos-success-card.partial {
    border-color: var(--pos-warning);
    box-shadow: var(--pos-shadow-lg), 0 0 40px var(--pos-warning-glow);
}
.pos-success-card.partial .success-icon {
    filter: drop-shadow(0 4px 12px var(--pos-warning-glow));
}
.pos-success-card.partial h2 {
    color: var(--pos-warning);
    text-shadow: 0 0 20px var(--pos-warning-glow);
}
.pos-success-card.partial .pos-success-amount {
    color: var(--pos-text);
    text-shadow: none;
}

/* ═══════════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════ */

.pos-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 24px;
    border-radius: var(--pos-r);
    font-size: .82rem;
    font-weight: 700;
    z-index: 7000;
    animation: toast-in .25s ease;
    box-shadow: var(--pos-shadow);
    white-space: nowrap;
}
.pos-toast.success {
    background: var(--pos-success-dark);
    color: #fff;
    border: 1px solid var(--pos-success);
}
.pos-toast.error {
    background: var(--pos-danger-dark);
    color: #fff;
    border: 1px solid var(--pos-danger);
}
.pos-toast.warning {
    background: rgba(251, 191, 36, .15);
    color: var(--pos-warning);
    border: 1px solid rgba(251, 191, 36, .3);
}
.pos-toast.info {
    background: rgba(56, 189, 248, .15);
    color: var(--pos-info);
    border: 1px solid rgba(56, 189, 248, .3);
}

/* ═══════════════════════════════════════════════════════════════
   SPINNER
   ═══════════════════════════════════════════════════════════════ */

.pos-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--pos-border);
    border-top-color: var(--pos-primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ═══════════════════════════════════════════════════════════════
   TOUCH MODE — larger targets for finger input
   ═══════════════════════════════════════════════════════════════ */

.pos-touch .pos-search-input {
    padding: 14px 16px;
    font-size: 1rem;
}

.pos-touch .pos-result-item {
    padding: 14px 14px;
    min-height: 52px;
}

.pos-touch .pos-category-tab {
    padding: 8px 16px;
    font-size: .76rem;
}

.pos-touch .pos-cart-line {
    padding: 12px 14px;
    min-height: 52px;
    font-size: .88rem;
}

.pos-touch .numpad-btn {
    padding: 16px 0;
    min-height: 56px;
    font-size: 1.15rem;
}

.pos-touch .pos-btn-action {
    padding: 14px 8px;
    min-height: 50px;
    font-size: .82rem;
}

.pos-touch .payment-btn {
    padding: 14px 8px;
    min-height: 52px;
    font-size: .8rem;
}

.pos-touch .pos-btn-top {
    width: 42px;
    height: 42px;
    font-size: 1rem;
}

.pos-touch .pos-mode-btn {
    padding: 10px 8px;
    font-size: .8rem;
}

.pos-touch .pos-qty-btn {
    width: 34px;
    height: 34px;
    font-size: 1rem;
}

.pos-touch .pos-customer-input,
.pos-touch .pos-notes-input {
    padding: 12px 14px;
    font-size: .88rem;
}

.pos-touch .pos-dialog-btn {
    padding: 14px 20px;
    font-size: .92rem;
}

.pos-touch .pos-dialog-input {
    padding: 14px 16px;
    font-size: 1rem;
}

.pos-touch .theme-option {
    padding: 12px 14px;
    font-size: .85rem;
}

.pos-touch .drawer-item {
    padding: 14px 14px;
    font-size: .85rem;
}

.pos-touch .drawer-tab {
    padding: 14px 12px;
    font-size: .82rem;
}

/* ═══════════════════════════════════════════════════════════════
   LIGHT THEME — EXTRA OVERRIDES
   ═══════════════════════════════════════════════════════════════ */

[data-pos-theme="light"] .pos-gate-overlay {
    background: var(--pos-bg);
}
[data-pos-theme="light"] .pos-gate-orb { opacity: 0.10; }

[data-pos-theme="light"] .pos-gate-card--premium {
    box-shadow: 0 12px 40px rgba(0, 0, 0, .08),
                0 0 0 1px rgba(0, 0, 0, .04);
}

[data-pos-theme="light"] .pos-gate-icon-ring {
    background: linear-gradient(135deg,
        rgba(124, 58, 237, .08),
        rgba(99, 102, 241, .08));
}

[data-pos-theme="light"] .pos-gate-input {
    background: #fff;
}

[data-pos-theme="light"] .pos-drawer {
    box-shadow: -8px 0 40px rgba(0, 0, 0, .1);
}

[data-pos-theme="light"] .pos-theme-picker {
    box-shadow: 0 8px 30px rgba(0, 0, 0, .1);
}

[data-pos-theme="light"] .pos-toast {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

[data-pos-theme="light"] .pos-success-card {
    box-shadow: 0 12px 40px rgba(0, 0, 0, .08);
}

/* ═══════════════════════════════════════════════════════════════
   MIDNIGHT THEME — EXTRA OVERRIDES
   ═══════════════════════════════════════════════════════════════ */

[data-pos-theme="midnight"] .pos-gate-overlay {
    background: var(--pos-bg);
}
[data-pos-theme="midnight"] .pos-gate-orb { opacity: 0.08; }

[data-pos-theme="midnight"] .pos-drawer {
    box-shadow: -8px 0 40px rgba(0, 0, 0, .5);
}

[data-pos-theme="midnight"] .pos-theme-picker {
    box-shadow: 0 8px 30px rgba(0, 0, 0, .5);
}

/* ═══════════════════════════════════════════════════════════════
   HIGH CONTRAST THEME — EXTRA OVERRIDES
   ═══════════════════════════════════════════════════════════════ */

[data-pos-theme="contrast"] .pos-gate-overlay {
    background: var(--pos-bg);
}
[data-pos-theme="contrast"] .pos-gate-orb { opacity: 0.05; }
[data-pos-theme="contrast"] .pos-gate-card--premium { border: 2px solid var(--pos-border); }

[data-pos-theme="contrast"] .pos-drawer {
    box-shadow: -8px 0 40px rgba(0, 0, 0, .7);
    border-left: 2px solid var(--pos-border);
}

[data-pos-theme="contrast"] .pos-theme-picker {
    box-shadow: 0 8px 30px rgba(0, 0, 0, .7);
    border: 2px solid var(--pos-border);
}

[data-pos-theme="contrast"] .theme-option:hover {
    background: var(--pos-surface-3);
}

.drawer-item:hover {
    background: var(--pos-surface-3);
}

/* ═══════════════ NUMPAD TOGGLE — hidden on desktop, shown on mobile ═══════════════ */
.pos-numpad-toggle {
    display: none;
    width: 100%;
    padding: 6px;
    border: none;
    border-top: 1px solid var(--pos-border);
    background: var(--pos-surface-2);
    color: var(--pos-text-dim);
    font-size: .7rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}
.pos-numpad-toggle:hover { background: var(--pos-surface-3); color: var(--pos-text); }
.pos-numpad.numpad-collapsed { display: none; }

/* ═══════════════ MOBILE INLINE EDITOR ═══════════════ */
.editor-mobile-row {
    display: none;
}

.editor-mobile-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.editor-mobile-field label {
    font-size: .58rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--pos-text-dim);
    letter-spacing: .04em;
}
.editor-mobile-field input {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    color: var(--pos-text);
    font-size: .78rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    min-width: 0;
    -moz-appearance: textfield;
}
.editor-mobile-field input::-webkit-outer-spin-button,
.editor-mobile-field input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.editor-mobile-field input:focus { border-color: var(--pos-primary); }

/* Quick denomination button style */
.pos-dialog-btn.quick {
    padding: 6px 12px;
    font-size: .72rem;
    font-weight: 700;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    color: var(--pos-text);
    cursor: pointer;
    transition: all .15s;
}
.pos-dialog-btn.quick:hover {
    background: var(--pos-surface-3);
    border-color: var(--pos-primary);
    color: var(--pos-primary);
}

/* ═══════════════ RECALLED INVOICE BANNER ═══════════════ */
.recalled-invoice-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: .82rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, .12), rgba(129, 140, 248, .12));
    border: 1px solid rgba(56, 189, 248, .3);
    color: var(--pos-info);
    animation: recalledPulse 2s ease-in-out infinite;
}
.recalled-invoice-banner.posted {
    background: linear-gradient(135deg, rgba(251, 191, 36, .12), rgba(248, 113, 113, .12));
    border-color: rgba(251, 191, 36, .3);
    color: var(--pos-warning);
}
@keyframes recalledPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .8; }
}
.recalled-dismiss-btn {
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 6px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: .72rem;
    font-weight: 600;
    color: inherit;
    transition: background .15s;
}
.recalled-dismiss-btn:hover {
    background: rgba(255,255,255,.2);
}

/* ═══════════════ INVOICE FINDER DIALOG ═══════════════ */
.invoice-finder-dialog {
    width: min(600px, 95vw);
    max-height: 85vh;
    border-radius: 16px;
    overflow: hidden;
}
.invoice-finder-card {
    background: var(--pos-surface);
    border: 1px solid var(--pos-border);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: box-shadow .2s, border-color .2s;
}
.invoice-finder-card:hover {
    border-color: var(--pos-primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, .12);
}
.finder-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}
.finder-card-id {
    display: flex;
    align-items: baseline;
    gap: 10px;
}
.finder-card-date {
    font-size: .72rem;
    color: var(--pos-text-muted);
}
.finder-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.finder-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}
.badge-posted {
    background: rgba(34, 197, 94, .15);
    color: var(--pos-success);
    border: 1px solid rgba(34, 197, 94, .3);
}
.badge-not-posted {
    background: rgba(156, 163, 175, .15);
    color: var(--pos-text-muted);
    border: 1px solid rgba(156, 163, 175, .3);
}
.status-paid {
    background: rgba(34, 197, 94, .15);
    color: var(--pos-success);
    border: 1px solid rgba(34, 197, 94, .3);
}
.status-partial {
    background: rgba(251, 191, 36, .15);
    color: var(--pos-warning);
    border: 1px solid rgba(251, 191, 36, .3);
}
.status-not-paid {
    background: rgba(248, 113, 113, .15);
    color: var(--pos-danger);
    border: 1px solid rgba(248, 113, 113, .3);
}
.finder-card-body {
    margin-bottom: 12px;
}
.finder-card-customer {
    font-size: .82rem;
    color: var(--pos-text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.finder-card-amounts {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.finder-amount {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.finder-amount-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--pos-text-muted);
    font-weight: 600;
}
.finder-amount-value {
    font-size: .95rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.finder-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    border-top: 1px solid var(--pos-border);
    padding-top: 10px;
}
.finder-action-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    border: 1px solid transparent;
    text-align: center;
}
.finder-action-btn.recall-btn {
    background: linear-gradient(135deg, rgba(56, 189, 248, .12), rgba(99, 102, 241, .12));
    border-color: rgba(56, 189, 248, .3);
    color: var(--pos-info);
}
.finder-action-btn.recall-btn:hover {
    background: rgba(56, 189, 248, .2);
    transform: translateY(-1px);
}
.finder-action-btn.pay-btn {
    background: linear-gradient(135deg, rgba(34, 197, 94, .12), rgba(16, 185, 129, .12));
    border-color: rgba(34, 197, 94, .3);
    color: var(--pos-success);
}
.finder-action-btn.pay-btn:hover {
    background: rgba(34, 197, 94, .2);
    transform: translateY(-1px);
}
.finder-action-btn.print-btn {
    background: rgba(156, 163, 175, .1);
    border-color: rgba(156, 163, 175, .25);
    color: var(--pos-text-secondary);
}
.finder-action-btn.print-btn:hover {
    background: rgba(156, 163, 175, .2);
}

/* ═══════════════ MOBILE BOTTOM TABS — hidden on desktop ═══════════════ */
.pos-mobile-tabs { display: none; }
.pos-mobile-cart-bar { display: none; }

/* ═══════════════ TABLET (≤1024px) — 2-column: cart+summary, search hidden via tabs ═══════════════ */
@media (max-width: 1024px) {
    .pos-topbar-info { display: none; }

    .pos-main {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
        min-height: 0;
    }
    .pos-left,
    .pos-center,
    .pos-right {
        display: none !important;
        border: none;
        flex-direction: column;
    }
    .pos-left.mobile-active,
    .pos-center.mobile-active,
    .pos-right.mobile-active {
        display: flex !important;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* Show mobile tabs on tablet */
    .pos-mobile-tabs {
        display: flex;
        flex-shrink: 0;
        background: var(--pos-surface);
        border-top: 1px solid var(--pos-border);
        padding: 6px 8px;
        gap: 6px;
        z-index: 100;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, .25);
    }
    .pos-mobile-tab {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        padding: 8px 4px;
        border: 1px solid transparent;
        border-radius: var(--pos-r);
        background: transparent;
        color: var(--pos-text-dim);
        font-size: .7rem;
        font-weight: 700;
        cursor: pointer;
        transition: all .2s;
        position: relative;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    .pos-mobile-tab .mobile-tab-icon { font-size: 1.15rem; line-height: 1; }
    .pos-mobile-tab.active {
        background: var(--pos-primary-glow);
        color: var(--pos-primary);
        border-color: rgba(91, 154, 255, .2);
        font-weight: 800;
    }
    .pos-mobile-tab.active::after {
        content: '';
        position: absolute;
        top: -1px;
        left: 20%;
        right: 20%;
        height: 3px;
        border-radius: 0 0 3px 3px;
        background: var(--pos-primary);
    }
    .mobile-tab-badge {
        position: absolute;
        top: 2px;
        right: calc(50% - 24px);
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        border-radius: 8px;
        background: var(--pos-danger);
        color: #fff;
        font-size: .58rem;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .pos-mobile-cart-bar { display: flex; }

    /* Editor row — wrap nicely on tablet */
    .editor-mobile-row {
        display: flex !important;
        flex-wrap: wrap;
        gap: 6px;
    }
    .editor-mobile-field {
        flex: 1;
        min-width: 70px;
    }
}

/* ═══════════════ MOBILE (≤768px) — Refine tablet layout for phones ═══════════════ */
@media (max-width: 768px) {
    /* Page shell */
    .pos-page {
        height: 100dvh;
        padding-top: env(safe-area-inset-top, 0);
    }

    /* Topbar slim */
    .pos-topbar {
        height: 44px;
        padding: 0 10px;
        gap: 4px;
        flex-shrink: 0;
    }
    .pos-topbar-left { gap: 8px; }
    .pos-logo span { display: none; }
    .pos-logo-icon { width: 28px; height: 28px; font-size: .8rem; border-radius: 8px; }
    .pos-clock { font-size: .7rem; padding: 3px 8px; }
    .pos-topbar-right { gap: 3px; }
    .pos-btn-top { width: 32px; height: 32px; font-size: .82rem; border-radius: 8px; }

    /* Tab bar — safe area on phones */
    .pos-mobile-tabs {
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0));
    }
    .pos-mobile-tab {
        font-size: .65rem;
    }
    .pos-mobile-tab:active { transform: scale(.92); }
    .mobile-tab-badge {
        right: 12px;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        box-shadow: 0 2px 6px var(--pos-danger-glow);
        animation: badge-pop .3s cubic-bezier(.34, 1.56, .64, 1);
    }
    @keyframes badge-pop {
        from { transform: scale(0); }
        60% { transform: scale(1.3); }
        to { transform: scale(1); }
    }
    .pos-mobile-tab.ready:not(.active) {
        background: rgba(52, 211, 153, .12);
        color: var(--pos-success);
        border-color: rgba(52, 211, 153, .3);
        animation: pulse-ready 2s ease-in-out infinite;
    }
    @keyframes pulse-ready {
        0%, 100% { box-shadow: none; }
        50% { box-shadow: 0 0 12px var(--pos-success-glow); }
    }

    /* Search panel (Tab 0) */
    .pos-left.mobile-active {
        overflow: hidden;
        max-height: none;
    }
    .pos-search-section {
        padding: 10px 10px;
        gap: 6px;
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--pos-surface);
    }
    .pos-search-input { padding: 12px 14px; font-size: .9rem; border-radius: var(--pos-r); }
    .pos-search-btn { width: 46px; border-radius: var(--pos-r); font-size: 1.1rem; }
    .pos-result-item { padding: 12px 12px; min-height: 52px; margin-bottom: 1px; border-radius: var(--pos-r); }
    .pos-result-item:active { transform: scale(.97); }
    .result-name { font-size: .85rem; }
    .result-price { font-size: .88rem; }
    .result-meta { max-height: none; }
    .result-code { font-size: .66rem; padding: 2px 7px; }
    .result-stock { font-size: .64rem; }
    .pos-category-bar { padding: 6px 10px; gap: 6px; }
    .pos-category-tab { padding: 6px 14px; font-size: .72rem; }
    .pos-result-empty { padding: 30px 16px; font-size: .8rem; }
    .pos-results { padding: 4px 6px; flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

    /* Floating cart bar on search tab */
    .pos-mobile-cart-bar {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin: 6px 8px;
        padding: 10px 14px;
        background: linear-gradient(135deg, var(--pos-primary), var(--pos-accent));
        border-radius: var(--pos-r);
        color: #fff;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        box-shadow: 0 4px 16px var(--pos-primary-glow);
        animation: fade-in .2s ease;
        flex-shrink: 0;
    }
    .pos-mobile-cart-bar:active { transform: scale(.97); }
    .mobile-cart-bar-left { display: flex; align-items: center; gap: 8px; }
    .mobile-cart-badge {
        display: flex; align-items: center; justify-content: center;
        width: 24px; height: 24px; border-radius: 50%;
        background: rgba(255, 255, 255, .25);
        font-size: .75rem; font-weight: 800;
    }
    .mobile-cart-bar-label { font-size: .78rem; font-weight: 600; opacity: .9; }
    .mobile-cart-bar-right { display: flex; align-items: center; gap: 8px; }
    .mobile-cart-bar-total { font-size: 1rem; font-weight: 900; font-variant-numeric: tabular-nums; }
    .mobile-cart-bar-arrow { font-size: 1rem; opacity: .7; }

    /* Cart panel (Tab 1) */
    .pos-center.mobile-active { border-right: none; overflow: hidden; }
    .pos-cart-section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
    .pos-cart-section h3 { padding: 8px 12px; font-size: .78rem; flex-shrink: 0; }
    .pos-cart-headers { padding: 4px 12px; font-size: .64rem; flex-shrink: 0; }
    .pos-cart-empty { padding: 24px 16px; font-size: .82rem; }
    .pos-cart-line { padding: 8px 12px; font-size: .78rem; min-height: 42px; }
    .pos-cart-line.selected { border-left-width: 3px; }
    .pos-qty-btn { width: 30px; height: 30px; font-size: .9rem; border-radius: 8px; }

    /* Line editor compact */
    .pos-line-editor { padding: 4px 10px; flex-shrink: 0; }
    .editor-row { display: none !important; }
    .editor-mobile-row {
        display: flex !important;
        gap: 6px;
        padding: 4px 0;
        align-items: flex-end;
    }
    .pos-mode-btn { padding: 6px 6px; font-size: .68rem; }
    .pos-remove-btn { padding: 6px 10px; font-size: .68rem; }

    /* Numpad hidden by default on mobile — shown via toggle */
    .pos-numpad-toggle { display: flex; align-items: center; justify-content: center; }
    .pos-numpad { display: none; padding: 4px 10px 6px; flex-shrink: 0; }
    .pos-numpad-toggle + .pos-numpad:not(.numpad-collapsed) { display: block; }
    .numpad-display { padding: 5px 10px; min-height: 32px; margin-bottom: 4px; }
    .numpad-display-mode { font-size: .62rem; padding: 2px 6px; }
    .numpad-display-value { font-size: 1rem; }
    .numpad-row { gap: 3px; margin-bottom: 3px; }
    .numpad-btn { padding: 8px 0; font-size: .92rem; min-height: 36px; border-radius: var(--pos-r-sm); }
    .pos-notes-section { padding: 4px 10px 6px; flex-shrink: 0; }
    .pos-notes-input { padding: 7px 10px; font-size: .76rem; }

    /* Pay panel (Tab 2) */
    .pos-right.mobile-active { overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
    .pos-summary { padding: 12px 12px; }
    .summary-row { font-size: .8rem; padding: 4px 0; }
    .summary-total { font-size: 1.15rem; padding: 10px 0; margin-top: 6px; }
    .summary-remain { font-size: .88rem; padding: 8px 12px; }
    .pos-customer-section { padding: 8px 12px; gap: 6px; }
    .pos-customer-input { padding: 9px 12px; font-size: .82rem; }
    .pos-customer-search-btn { padding: 0 10px; font-size: .82rem; min-height: 38px; }
    .pos-customer-clear { padding: 0 10px; font-size: .68rem; }
    .pos-customer-dropdown { max-height: 180px; bottom: calc(100% + 2px); }
    .pos-actions { padding: 8px 12px; gap: 4px; grid-template-columns: repeat(2, 1fr); }
    .pos-btn-action { padding: 10px 6px; font-size: .7rem; min-height: 40px; border-radius: var(--pos-r); }
    .pos-btn-action.complete { min-height: 48px; font-size: .82rem; border-radius: var(--pos-r); }
    .pos-payment-methods { padding: 4px 12px 8px; gap: 4px; }
    .payment-btn { padding: 10px 6px; font-size: .72rem; min-height: 42px; border-radius: var(--pos-r); }
    .pos-invoice-browser { padding: 4px 12px 8px; }
    .pos-browse-btn { padding: 10px; font-size: .74rem; border-radius: var(--pos-r); }

    /* Modals — slide up from bottom on mobile */
    .pos-modal-overlay { align-items: flex-end; padding: 0; }
    .pos-modal-dialog {
        width: 100%; max-width: none;
        border-radius: var(--pos-r-lg) var(--pos-r-lg) 0 0;
        max-height: 85dvh;
        animation: modal-slide-up .3s cubic-bezier(.16, 1, .3, 1);
    }
    .pos-modal-dialog.large-dialog { max-width: none; max-height: 92dvh; }
    @keyframes modal-slide-up {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }
    .modal-header { padding: 14px 16px; }
    .modal-header h3 { font-size: .9rem; }
    .modal-body { padding: 14px 16px; }
    .modal-footer { padding: 10px 16px; }
    .pos-dialog-input { font-size: 1rem; padding: 10px 14px; }
    .pos-dialog-btn { padding: 10px 16px; font-size: .76rem; }

    /* Gate card */
    .pos-gate-card, .pos-gate-card--premium {
        width: 100%; max-width: none; padding: 0 20px 24px; margin: 0 12px; border-radius: 20px;
    }
    .pos-gate-header-strip { margin: 0 -20px; }
    .pos-gate-hero { padding: 22px 0 16px; }
    .pos-gate-icon-ring { width: 60px; height: 60px; }
    .pos-gate-card--premium .pos-gate-title { font-size: 1.2rem; }
    .pos-gate-card--premium .pos-gate-subtitle { font-size: .78rem; }
    .pos-gate-card--premium .pos-gate-info-row { font-size: .82rem; padding: 10px 12px; }
    .pos-gate-card--premium .pos-gate-select { font-size: .82rem; padding: 10px 12px; }
    .pos-gate-card--premium .pos-gate-field label { font-size: .72rem; }
    .pos-gate-card--premium .pos-gate-actions { flex-direction: column; gap: 8px; }
    .pos-gate-btn { width: 100%; justify-content: center; }
    .pos-gate-orb { filter: blur(60px); opacity: 0.08; }

    /* Drawer — full screen */
    .pos-drawer { width: 100vw; border-left: none; }
    .drawer-item { font-size: .76rem; padding: 10px 10px; }

    /* Success overlay */
    .pos-success-card { padding: 28px 24px; }
    .pos-success-card h2 { font-size: 1.2rem; }
    .pos-success-amount { font-size: 1.6rem; }

    /* Toast above mobile tab bar */
    .pos-toast {
        bottom: calc(70px + env(safe-area-inset-bottom, 0));
        font-size: .78rem;
        padding: 8px 20px;
    }

    /* Return dialog items */
    .return-item-row { grid-template-columns: 1.5fr 1.5fr auto; gap: 6px; font-size: .76rem; }
}

/* ═══════════════ PRINT ═══════════════ */
@media print {
    .pos-topbar, .pos-left, .pos-numpad, .pos-actions, .pos-payment-methods,
    .pos-toast, .pos-modal-overlay, .pos-drawer-overlay, .pos-success-overlay,
    .pos-gate-overlay, .pos-mobile-tabs { display: none !important; }
    .pos-page { height: auto; }
    .pos-main { display: block; }
}

/* ═══════════════ TOUCH MODE ═══════════════ */
.pos-touch .pos-topbar { height: 60px; padding: 0 20px; }
.pos-touch .pos-btn-top { width: 44px; height: 44px; font-size: 1.05rem; }
.pos-touch .pos-topbar-chip { font-size: .78rem; padding: 5px 12px; }
.pos-touch .pos-clock { font-size: .88rem; padding: 6px 14px; }
.pos-touch .pos-search-input { padding: 14px 16px; font-size: .95rem; }
.pos-touch .pos-search-btn { width: 50px; font-size: 1.15rem; }
.pos-touch .pos-result-item { padding: 14px 14px; min-height: 52px; }
.pos-touch .result-name { font-size: .88rem; }
.pos-touch .result-price { font-size: .9rem; }
.pos-touch .pos-cart-section h3 { padding: 12px 16px; font-size: .88rem; }
.pos-touch .pos-cart-headers { padding: 8px 16px; font-size: .74rem; }
.pos-touch .pos-cart-line { padding: 12px 16px; min-height: 54px; font-size: .88rem; }
.pos-touch .pos-qty-btn { width: 34px; height: 34px; font-size: .95rem; }
.pos-touch .pos-mode-btn { padding: 10px 10px; font-size: .76rem; }
.pos-touch .pos-remove-btn { padding: 10px 16px; font-size: .76rem; }
.pos-touch .numpad-btn { padding: 16px 0; font-size: 1.2rem; min-height: 56px; }
.pos-touch .numpad-display { padding: 10px 14px; min-height: 48px; }
.pos-touch .numpad-display-value { font-size: 1.5rem; }
.pos-touch .pos-notes-input { padding: 12px 14px; font-size: .85rem; }
.pos-touch .summary-row { font-size: .86rem; padding: 7px 0; }
.pos-touch .summary-total { font-size: 1.25rem; padding: 12px 0; }
.pos-touch .summary-remain { padding: 10px 14px; font-size: .92rem; }
.pos-touch .pos-customer-input { padding: 12px 14px; font-size: .86rem; }
.pos-touch .pos-customer-clear { font-size: .76rem; padding: 0 14px; }
.pos-touch .pos-btn-action { padding: 14px 10px; font-size: .78rem; min-height: 50px; }
.pos-touch .pos-btn-action.complete { font-size: .9rem; min-height: 58px; }
.pos-touch .payment-btn { padding: 14px 10px; font-size: .8rem; min-height: 52px; }
.pos-touch .pos-browse-btn { padding: 14px; font-size: .8rem; }
.pos-touch .pos-dialog-input { padding: 14px 16px; font-size: 1.2rem; }
.pos-touch .pos-dialog-btn { padding: 14px 24px; font-size: .84rem; }
.pos-touch .modal-header h3 { font-size: 1.05rem; }
.pos-touch .modal-body p { font-size: .9rem; }
.pos-touch .pos-gate-card, .pos-touch .pos-gate-card--premium { padding: 0 36px 36px; }
.pos-touch .pos-gate-hero { padding: 32px 0 22px; }
.pos-touch .pos-gate-card--premium .pos-gate-title { font-size: 1.5rem; }
.pos-touch .pos-gate-card--premium .pos-gate-subtitle { font-size: .88rem; }
.pos-touch .pos-gate-card--premium .pos-gate-info-row { font-size: .88rem; padding: 13px 16px; }
.pos-touch .pos-gate-card--premium .pos-gate-select { padding: 13px 14px; font-size: .88rem; }
.pos-touch .pos-gate-card--premium .pos-gate-field label { font-size: .78rem; }
.pos-touch .pos-gate-input { padding: 14px 14px 14px 44px; font-size: 1.1rem; }
.pos-touch .pos-gate-btn { padding: 14px 24px; font-size: .92rem; }
.pos-touch .pos-category-tab { padding: 7px 16px; font-size: .74rem; }
.pos-touch .pos-customer-search-btn { padding: 0 14px; font-size: .86rem; min-height: 44px; }

/* ═══════════════ RTL SUPPORT — removed, Arabic uses LTR layout ═══════════════ */

/* ═══════════════ PAYMENT LINE LIST (remove/edit) ═══════════════ */
.pos-payment-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 0;
}
.pos-payment-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    padding: 5px 8px;
    border-radius: 6px;
    background: var(--pos-surface-2, rgba(255,255,255,.04));
    transition: background .15s;
}
.pos-payment-line:hover {
    background: var(--pos-surface-3, rgba(255,255,255,.08));
}
.payment-line-type {
    flex: 1;
    color: var(--pos-text-secondary);
    font-weight: 600;
}
.payment-line-amount {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--pos-text);
    min-width: 60px;
    text-align: right;
}
.pos-payment-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--pos-text-dim);
    font-size: .65rem;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}
.pos-payment-remove:hover {
    background: rgba(239,68,68,.15);
    border-color: rgba(239,68,68,.3);
    color: var(--pos-danger);
}

/* ═══════════════ HOLD SLOTS DIALOG ═══════════════ */
.hold-slot-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 400px;
    overflow-y: auto;
}
.hold-slot-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--pos-border);
    border-radius: var(--pos-r-sm);
    background: var(--pos-surface-2);
    cursor: pointer;
    transition: all .15s;
}
.hold-slot-card:hover {
    background: var(--pos-surface-3);
    border-color: var(--pos-primary);
}
.hold-slot-card .slot-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--pos-primary);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    flex-shrink: 0;
}
.hold-slot-card .slot-info {
    flex: 1;
    min-width: 0;
}
.hold-slot-card .slot-customer {
    font-weight: 700;
    font-size: .82rem;
    color: var(--pos-text);
}
.hold-slot-card .slot-meta {
    font-size: .68rem;
    color: var(--pos-text-dim);
}
.hold-slot-card .slot-total {
    font-weight: 800;
    font-size: .88rem;
    color: var(--pos-text);
    font-variant-numeric: tabular-nums;
}
.hold-slot-card .slot-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--pos-text-dim);
    font-size: .68rem;
    cursor: pointer;
    transition: all .15s;
    flex-shrink: 0;
}
.hold-slot-card .slot-remove:hover {
    background: rgba(239,68,68,.15);
    border-color: rgba(239,68,68,.3);
    color: var(--pos-danger);
}

/* ═══════════════ SESSION BREAKDOWN ═══════════════ */
.session-breakdown {
    border-top: 1px solid var(--pos-border);
    padding-top: 8px;
    margin-top: 4px;
}
.session-breakdown-label {
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--pos-text-dim);
    margin-bottom: 4px;
}
