/* ============================================================
   POS Terminal — Premium Light Theme
   ============================================================ */

/* ── Layout Shell ──────────────────────────────────────────── */
.pos-shell {
    margin: -28px -28px -40px;
    height: calc(100vh - var(--topbar-h));
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: auto 1fr;
    background: var(--bg-base);
    font-family: var(--font);
    overflow: hidden;
}

/* ── Top Bar ───────────────────────────────────────────────── */
.pos-topbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    z-index: 20;
}

.pos-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.pos-topbar-brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
}

.pos-topbar-brand-icon svg {
    width: 18px;
    height: 18px;
}

.pos-topbar-brand-text {
    font-weight: 800;
    font-size: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.pos-topbar-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
    flex-shrink: 0;
}

/* Search */
.pos-topbar-search {
    flex: 1;
    max-width: 420px;
    position: relative;
}

.pos-topbar-search svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.pos-topbar-search input {
    width: 100%;
    padding: 10px 14px 10px 44px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--bg-raised);
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all var(--transition);
    outline: none;
}

.pos-topbar-search input::placeholder {
    color: var(--text-muted);
}

.pos-topbar-search input:focus {
    border-color: var(--primary);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--primary-glass);
}

/* Controls */
.pos-topbar-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.pos-select {
    padding: 8px 32px 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition);
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 14px;
}

.pos-select:hover {
    border-color: var(--primary-light);
}

.pos-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glass);
}

.pos-customer-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.pos-customer-btn:hover {
    border-color: var(--primary);
    background: var(--primary-glass);
}

.pos-customer-btn svg {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.pos-customer-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.pos-scan-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(99,102,241,0.25);
    white-space: nowrap;
}

.pos-scan-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(99,102,241,0.35);
}

.pos-scan-btn svg {
    width: 16px;
    height: 16px;
}

.pos-exit-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

.pos-exit-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(239,68,68,0.06);
}

.pos-exit-btn svg {
    width: 15px;
    height: 15px;
}

/* ── Product Area (Left) ───────────────────────────────────── */
.pos-products-area {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-base);
}

/* Category Tabs */
.pos-cat-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.pos-cat-bar::-webkit-scrollbar {
    display: none;
}

.pos-cat-pill {
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    border: 1.5px solid transparent;
    background: var(--bg-raised);
    color: var(--text-secondary);
}

.pos-cat-pill:hover {
    background: var(--primary-glass);
    color: var(--primary);
    border-color: rgba(99,102,241,0.15);
}

.pos-cat-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.pos-cat-pill .pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 700;
    margin-left: 5px;
    background: rgba(0,0,0,0.08);
    color: var(--text-muted);
}

.pos-cat-pill.active .pill-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* Brand filter select inside cat bar */
.pos-brand-select {
    margin-left: auto;
    padding: 5px 28px 5px 10px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 13px;
    flex-shrink: 0;
}

/* Product Grid */
.pos-grid-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: 12px;
    align-items: start;
}

/* Product Card */
.pos-card {
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
    position: relative;
}

.pos-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.12), 0 2px 6px rgba(0,0,0,0.04);
}

.pos-card:active {
    transform: translateY(-1px) scale(0.98);
}

.pos-card.out-of-stock {
    opacity: 0.45;
    pointer-events: none;
}

.pos-card-img {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, var(--bg-raised), var(--bg-base));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.pos-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s;
}

.pos-card:hover .pos-card-img img {
    transform: scale(1.06);
}

.pos-card-img .placeholder-icon {
    color: var(--text-muted);
    opacity: 0.35;
}

.pos-card-body {
    padding: 10px 12px 12px;
}

.pos-card-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    max-height: 2.1em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 2px;
}

.pos-card-sku {
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 6px;
}

.pos-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.pos-card-price {
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--primary);
}

.pos-card-stock {
    font-size: 0.62rem;
    padding: 2px 7px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.pos-card-stock.in {
    background: rgba(16,185,129,0.1);
    color: var(--success);
}

.pos-card-stock.low {
    background: rgba(245,158,11,0.1);
    color: var(--warning);
}

.pos-card-stock.out {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

/* Qty badge on product card when in cart */
.pos-card-qty-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--primary);
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    opacity: 0;
    transform: scale(0);
    transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 2px 6px rgba(99,102,241,0.4);
    z-index: 2;
}

.pos-card.in-cart .pos-card-qty-badge {
    opacity: 1;
    transform: scale(1);
}

/* Add-to-cart animation */
@keyframes posCardPop {
    0% { transform: translateY(-3px) scale(1); }
    50% { transform: translateY(-3px) scale(0.95); }
    100% { transform: translateY(-3px) scale(1); }
}

.pos-card.adding {
    animation: posCardPop 0.2s ease;
}

/* Empty state */
.pos-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.pos-empty svg {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
    opacity: 0.3;
}

.pos-empty p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
}

.pos-empty .pos-empty-sub {
    font-size: 0.8rem;
    margin-top: 4px;
    color: var(--text-muted);
}

/* ── Cart Sidebar (Right) ──────────────────────────────────── */
.pos-cart-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-left: 1px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.03);
    overflow: hidden;
}

/* Cart Header */
.pos-cart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.pos-cart-head-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pos-cart-head-icon {
    width: 32px;
    height: 32px;
    background: var(--primary-glass);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.pos-cart-head-icon svg {
    width: 18px;
    height: 18px;
}

.pos-cart-head-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.pos-cart-count {
    background: var(--primary);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    min-width: 20px;
    text-align: center;
    margin-left: 6px;
}

.pos-cart-clear-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: none;
    background: var(--bg-raised);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
}

.pos-cart-clear-btn:hover {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

.pos-cart-clear-btn svg {
    width: 16px;
    height: 16px;
}

/* Cart Items List */
.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.pos-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-bottom: 1px solid var(--border-soft);
    transition: background 0.15s;
    animation: posCartSlideIn 0.2s ease;
}

@keyframes posCartSlideIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.pos-cart-item:hover {
    background: var(--bg-hover);
}

.pos-cart-item-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: var(--bg-raised);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pos-cart-item-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pos-cart-item-thumb .thumb-placeholder {
    color: var(--text-muted);
    opacity: 0.4;
}

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

.pos-cart-item-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.pos-cart-item-price {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.pos-cart-item-sku {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Quantity controls */
.pos-qty-wrap {
    display: flex;
    align-items: center;
    background: var(--bg-raised);
    border-radius: 8px;
    padding: 2px;
    flex-shrink: 0;
}

.pos-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.pos-qty-btn:hover {
    background: var(--primary);
    color: #fff;
}

.pos-qty-btn svg {
    width: 13px;
    height: 13px;
}

.pos-qty-input {
    width: 38px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0;
    color: var(--text-primary);
    outline: none;
}

.pos-qty-input::-webkit-inner-spin-button,
.pos-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-cart-item-total {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 55px;
    text-align: right;
    color: var(--text-primary);
    flex-shrink: 0;
}

.pos-cart-item-remove {
    width: 22px;
    height: 22px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.15s;
    padding: 0;
    flex-shrink: 0;
}

.pos-cart-item-remove:hover {
    background: rgba(239,68,68,0.1);
    color: var(--danger);
}

.pos-cart-item-remove svg {
    width: 14px;
    height: 14px;
}

/* Cart Empty State */
.pos-cart-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px;
    color: var(--text-muted);
    text-align: center;
}

.pos-cart-empty-icon {
    width: 60px;
    height: 60px;
    background: var(--bg-raised);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.pos-cart-empty-icon svg {
    width: 28px;
    height: 28px;
    opacity: 0.4;
}

.pos-cart-empty p {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 500;
}

.pos-cart-empty .empty-sub {
    font-size: 0.78rem;
    margin-top: 4px;
    color: var(--text-muted);
}

/* Cart Footer */
.pos-cart-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--bg-surface);
}

/* Summary rows */
.pos-summary-section {
    padding: 14px 18px 6px;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.pos-summary-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}

.pos-summary-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.pos-summary-row.discount .pos-summary-value {
    color: var(--danger);
}

.pos-summary-input {
    width: 80px;
    padding: 4px 8px;
    border: 1.5px solid var(--border);
    border-radius: 6px;
    font-size: 0.82rem;
    text-align: right;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-raised);
    outline: none;
    transition: all var(--transition);
}

.pos-summary-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glass);
    background: var(--bg-surface);
}

.pos-summary-input[readonly] {
    background: var(--bg-base);
    color: var(--text-muted);
    cursor: default;
}

/* Total display */
.pos-total-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f0f0ff 0%, #e8f8f8 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.pos-total-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.pos-total-amount {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Action Buttons row */
.pos-action-row {
    padding: 10px 18px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.pos-act-btn {
    padding: 8px 4px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--bg-surface);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.pos-act-btn svg {
    width: 15px;
    height: 15px;
}

.pos-act-btn:hover {
    border-color: var(--primary);
    background: var(--primary-glass);
    color: var(--primary);
    transform: translateY(-1px);
}

.pos-act-btn.danger {
    border-color: rgba(239,68,68,0.2);
    color: var(--danger);
}

.pos-act-btn.danger:hover {
    border-color: var(--danger);
    background: rgba(239,68,68,0.06);
}

.pos-act-btn.accent {
    border-color: rgba(6,182,212,0.2);
    color: var(--accent-dark);
}

.pos-act-btn.accent:hover {
    border-color: var(--accent);
    background: rgba(6,182,212,0.06);
}

/* Checkout button */
.pos-checkout-btn {
    margin: 0 18px 14px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    color: #fff;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 4px 14px rgba(16,185,129,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
}

.pos-checkout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.pos-checkout-btn:hover:not(:disabled)::before {
    left: 100%;
}

.pos-checkout-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16,185,129,0.4), inset 0 1px 0 rgba(255,255,255,0.15);
}

.pos-checkout-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.pos-checkout-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--bg-raised);
    color: var(--text-muted);
    box-shadow: none;
}

.pos-checkout-btn svg {
    width: 20px;
    height: 20px;
}

/* ── Modals ────────────────────────────────────────────────── */
.pos-modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0,0,0,0.4) !important;
    backdrop-filter: blur(4px);
    display: none !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 99999 !important;
}

.pos-modal-overlay.show {
    display: flex !important;
}

.pos-modal {
    background: var(--bg-surface);
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    transform: scale(0.92) translateY(12px);
    transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

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

.pos-modal-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.pos-modal-close {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    border: none;
    background: var(--bg-raised);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.15s;
}

.pos-modal-close:hover {
    background: var(--danger);
    color: #fff;
}

.pos-modal-close svg {
    width: 16px;
    height: 16px;
}

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

.pos-modal-foot {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.pos-modal-foot .btn {
    flex: 1;
}

/* Payment modal specifics */
.pos-payable-display {
    text-align: center;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary-glass), rgba(6,182,212,0.06));
    border-radius: 12px;
    margin-bottom: 16px;
}

.pos-payable-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.pos-payable-amount {
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.pos-change-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--success);
    border-radius: 10px;
    color: #fff;
    margin-top: 14px;
    transition: background 0.2s;
}

.pos-change-bar.warning {
    background: var(--warning);
}

.pos-change-bar.neutral {
    background: var(--bg-raised);
    color: var(--text-primary);
}

.pos-change-label {
    font-size: 0.82rem;
    font-weight: 500;
    opacity: 0.9;
    margin: 0;
}

.pos-change-value {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0;
}

/* Quick amount buttons */
.pos-quick-amounts {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.pos-quick-btn {
    padding: 6px 14px;
    background: var(--bg-raised);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-secondary);
}

.pos-quick-btn:hover {
    background: var(--primary-glass);
    border-color: var(--primary-light);
    color: var(--primary);
}

.pos-quick-btn.success {
    border-color: rgba(16,185,129,0.3);
    color: var(--success);
}

.pos-quick-btn.success:hover {
    background: rgba(16,185,129,0.08);
    border-color: var(--success);
}

.pos-quick-btn.danger {
    border-color: rgba(239,68,68,0.3);
    color: var(--danger);
}

.pos-quick-btn.danger:hover {
    background: rgba(239,68,68,0.06);
    border-color: var(--danger);
}

/* Received input */
.pos-received-group {
    margin-bottom: 14px;
}

.pos-received-group label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.pos-received-input {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-primary);
    transition: all 0.2s;
    outline: none;
    background: var(--bg-surface);
}

.pos-received-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glass);
}

/* Form inputs in modals */
.pos-form-group {
    margin-bottom: 14px;
}

.pos-form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.pos-form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    font-size: 0.88rem;
    color: var(--text-primary);
    background: var(--bg-raised);
    outline: none;
    transition: all var(--transition);
}

.pos-form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glass);
    background: var(--bg-surface);
}

/* Loading spinner */
.pos-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: posSpin 0.6s linear infinite;
}

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

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .pos-shell {
        grid-template-columns: 1fr 340px;
    }

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

@media (max-width: 900px) {
    .pos-shell {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
    }

    .pos-cart-panel {
        border-left: none;
        border-top: 1px solid var(--border);
        max-height: 45vh;
    }

    .pos-topbar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .pos-topbar-search {
        order: 10;
        max-width: none;
        flex-basis: 100%;
    }
}

@media (max-width: 600px) {
    .pos-shell {
        margin: -12px -12px -20px;
    }

    .pos-topbar {
        padding: 8px 12px;
    }

    .pos-grid-wrap {
        padding: 10px 12px;
    }

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

    .pos-action-row {
        grid-template-columns: repeat(2, 1fr);
    }
}
