/* =============================================
   POS — Trattoria Demo Design System
   Mobile-first, optimized for iPhone 16 Pro
   ============================================= */

:root {
    /* Colors — aligned with Trattoria Demo admin design language */
    --pos-bg: #0c0b09;
    --pos-bg-card: #1a1814;
    --pos-bg-card-hover: #22201c;
    --pos-bg-elevated: #151311;
    --pos-accent: #cda45e;
    --pos-accent-light: #d9ba85;
    --pos-accent-dark: #b8934e;
    --pos-text: #ffffff;
    --pos-text-muted: #a8a8a8;
    --pos-text-dim: #66635c;
    --pos-success: #4ade80;
    --pos-danger: #ef4444;
    --pos-warning: #f59e0b;
    --pos-info: #60a5fa;
    --pos-border: #2d2a24;

    /* Status colors */
    --table-free: #22c55e;
    --table-occupied: #ef4444;
    --table-paying: #f59e0b;
    --table-selected: #60a5fa;
    --table-merged: #a855f7;

    /* Layout */
    --header-h: 56px;
    --nav-h: 72px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--pos-bg);
    color: var(--pos-text);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Warm gold ambient glow — matches admin panel aesthetic */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at top left, rgba(205, 164, 94, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at bottom right, rgba(205, 164, 94, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* =============================================
   HEADER
   ============================================= */
.pos-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--pos-bg-elevated);
    border-bottom: 1px solid var(--pos-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 100;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-center {
    display: flex;
    align-items: center;
}

.header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--pos-text);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}

.header-btn:active {
    transform: scale(0.92);
    background: rgba(255, 255, 255, 0.12);
}

.header-time {
    font-size: 13px;
    color: var(--pos-text-muted);
    font-weight: 500;
}

.service-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    font-size: 12px;
    font-weight: 600;
}

.service-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pos-danger);
}

.service-indicator.open .service-dot {
    background: var(--pos-success);
    animation: pulse 2s infinite;
}

.service-indicator.open {
    background: rgba(34, 197, 94, 0.1);
    color: var(--pos-success);
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* =============================================
   MAIN CONTENT
   ============================================= */
.pos-main {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: var(--nav-h);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.pos-view {
    display: none;
    min-height: 100%;
    padding: 12px;
}

.pos-view.active {
    display: block;
}

/* =============================================
   TABLE GRID
   ============================================= */
.table-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    min-height: 40px;
}

.btn-action {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-accent);
    background: transparent;
    color: var(--pos-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.btn-action:active {
    background: var(--pos-accent);
    color: var(--pos-bg);
}

.btn-action.btn-danger {
    border-color: var(--pos-danger);
    color: var(--pos-danger);
}

.btn-action.btn-danger:active {
    background: var(--pos-danger);
    color: #fff;
}

.table-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    padding-bottom: 20px;
}

.table-cell {
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    min-height: 60px;
}

.table-cell:not(.extended) {
    aspect-ratio: 1;
}

.table-cell.empty {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.06);
    cursor: default;
}

.table-cell.free {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

.table-cell.free:active {
    background: rgba(34, 197, 94, 0.2);
    transform: scale(0.96);
}

.table-cell.occupied {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

.table-cell.occupied:active {
    background: rgba(239, 68, 68, 0.2);
    transform: scale(0.96);
}

.table-cell.paying {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.table-cell.selected {
    border-color: var(--table-selected) !important;
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.1) !important;
}

.table-cell.merged {
    background: rgba(168, 85, 247, 0.1);
    border-color: rgba(168, 85, 247, 0.3);
}

.table-name {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
}

.table-seats {
    font-size: 10px;
    color: var(--pos-text-muted);
}

.table-amount {
    font-size: 11px;
    font-weight: 700;
    color: var(--pos-accent);
    margin-top: 2px;
}

.table-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 6px;
}

.free .table-status-dot {
    background: var(--table-free);
}

.occupied .table-status-dot {
    background: var(--table-occupied);
}

.paying .table-status-dot {
    background: var(--table-paying);
}

/* =============================================
   CATEGORY BAR
   ============================================= */
.category-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 10px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.cat-tab {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--pos-border);
    background: var(--pos-bg-card);
    color: var(--pos-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.cat-tab.active {
    background: var(--pos-accent);
    color: var(--pos-bg);
    border-color: var(--pos-accent);
}

.cat-tab:active {
    transform: scale(0.95);
}

/* =============================================
   SEARCH BAR
   ============================================= */
.search-bar {
    position: relative;
    margin-bottom: 12px;
}

.search-bar i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--pos-text-dim);
    font-size: 16px;
}

.search-bar input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
    background: var(--pos-bg-card);
    color: var(--pos-text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--pos-accent);
}

.search-bar input::placeholder {
    color: var(--pos-text-dim);
}

/* =============================================
   PRODUCT GRID
   ============================================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding-bottom: 20px;
}

.product-card {
    background: var(--pos-bg-card);
    border-radius: var(--radius-md);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--pos-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.product-card:active {
    transform: scale(0.95);
    background: var(--pos-bg-card-hover);
    border-color: var(--pos-accent);
}

.product-card.formula {
    border-color: rgba(168, 85, 247, 0.4);
    background: rgba(168, 85, 247, 0.06);
}

.product-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 4px;
    word-break: break-word;
}

.product-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--pos-accent);
}

.product-type {
    font-size: 9px;
    color: var(--pos-text-dim);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* =============================================
   CART
   ============================================= */
.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pos-border);
}

.cart-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.cart-covers {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--pos-text-muted);
}

.cart-covers span {
    font-weight: 700;
    font-size: 16px;
    color: var(--pos-text);
    min-width: 20px;
    text-align: center;
}

.btn-small {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pos-border);
    background: var(--pos-bg-card);
    color: var(--pos-text);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-small:active {
    background: var(--pos-accent);
    color: var(--pos-bg);
}

/* Supplement button inside cart item rows */
.btn-cart-supp {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    border: 1px solid var(--pos-accent);
    color: var(--pos-accent);
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    cursor: pointer;
    margin-top: 4px;
}
.btn-cart-supp:active {
    background: var(--pos-accent);
    color: var(--pos-bg);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.cart-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: var(--pos-bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    border: 1px solid var(--pos-border);
    position: relative;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
}

.cart-item-supps {
    font-size: 11px;
    color: var(--pos-accent-light);
    margin-top: 2px;
    font-style: italic;
}

.cart-item-notes {
    font-size: 11px;
    color: var(--pos-text-muted);
    margin-top: 2px;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--pos-accent);
    white-space: nowrap;
    margin-left: auto;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.cart-item-qty span {
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}

.cart-item-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: var(--pos-danger);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-remove:active {
    background: var(--pos-danger);
    color: #fff;
}


.cart-total {
    padding: 16px 0 0;
    border-top: 2px solid var(--pos-accent);
    margin-top: auto;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
}

.cart-total-row.grand {
    font-size: 22px;
    font-weight: 800;
    color: var(--pos-accent);
}

/* Cart customer + order notes */
.cart-customer-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.cart-input-sm {
    flex: 1;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pos-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.cart-input-sm:focus {
    border-color: var(--pos-accent);
}

.cart-input-sm::placeholder {
    color: var(--pos-text-dim);
}

.cart-order-notes-wrap {
    margin-bottom: 10px;
}

.cart-input-notes {
    width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pos-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-text);
    font-size: 13px;
    font-family: inherit;
    outline: none;
}

.cart-input-notes:focus {
    border-color: var(--pos-accent);
}

.cart-input-notes::placeholder {
    color: var(--pos-text-dim);
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--pos-text-dim);
}

.cart-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.btn-cancel-order {
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(239, 68, 68, 0.15);
    color: var(--pos-danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-cancel-order:active {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(0.97);
}

/* =============================================
   CHECKOUT
   ============================================= */
.checkout-total {
    text-align: center;
    padding: 30px 0 20px;
}

.checkout-label {
    font-size: 14px;
    color: var(--pos-text-muted);
    display: block;
    margin-bottom: 4px;
}

.checkout-amount {
    font-size: 42px;
    font-weight: 800;
    color: var(--pos-accent);
}

.checkout-tva {
    background: var(--pos-bg-card);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 12px;
}

.tva-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    color: var(--pos-text-muted);
}

.checkout-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.checkout-btn {
    padding: 20px 10px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--pos-border);
    background: var(--pos-bg-card);
    color: var(--pos-text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
}

.checkout-btn i {
    font-size: 28px;
}

.checkout-btn span {
    font-size: 13px;
    font-weight: 600;
}

.checkout-btn.active {
    border-color: var(--pos-accent);
    background: rgba(205, 164, 94, 0.1);
    color: var(--pos-accent);
}

.checkout-btn:active {
    transform: scale(0.95);
}

.checkout-mixed {
    background: var(--pos-bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.mixed-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.mixed-input:last-child {
    margin-bottom: 0;
}

.mixed-input label {
    font-size: 14px;
    font-weight: 600;
}

.mixed-input input {
    width: 120px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pos-border);
    background: var(--pos-bg);
    color: var(--pos-accent);
    font-size: 18px;
    font-weight: 700;
    text-align: right;
    font-family: inherit;
    outline: none;
}

.mixed-input input:focus {
    border-color: var(--pos-accent);
}

.btn-validate {
    width: 100%;
    padding: 16px;
    border-radius: var(--radius-lg);
    border: none;
    background: var(--pos-accent);
    color: var(--pos-bg);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-validate:active {
    transform: scale(0.97);
    background: var(--pos-accent-dark);
}

.btn-validate:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* =============================================
   BOTTOM NAV
   ============================================= */
.pos-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--nav-h);
    padding-bottom: var(--safe-bottom);
    background: var(--pos-bg-elevated);
    border-top: 1px solid var(--pos-border);
    display: flex;
    z-index: 100;
}

.nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: none;
    color: var(--pos-text-dim);
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s;
    position: relative;
    font-family: inherit;
}

.nav-btn i {
    font-size: 22px;
}

.nav-btn.active {
    color: var(--pos-accent);
}

.nav-btn:active {
    color: var(--pos-accent-light);
}

.nav-btn.disabled {
    opacity: 0.3;
    pointer-events: none;
}

.nav-badge {
    position: absolute;
    top: 6px;
    right: 50%;
    transform: translateX(14px);
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    background: var(--pos-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* =============================================
   MODALS
   ============================================= */
.modal-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal {
    width: 100%;
    max-height: 80vh;
    max-height: 80dvh;
    background: var(--pos-bg-elevated);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    overflow-y: auto;
    animation: slideUp 0.25s ease-out;
}

.modal-large {
    max-height: 90vh;
    max-height: 90dvh;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--pos-border);
    position: sticky;
    top: 0;
    background: var(--pos-bg-elevated);
    z-index: 1;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--pos-text);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 16px 20px;
}

.modal-footer {
    padding: 12px 20px 20px;
    border-top: 1px solid var(--pos-border);
    position: sticky;
    bottom: 0;
    background: var(--pos-bg-elevated);
}

.modal-notes {
    margin-bottom: 12px;
}

.modal-notes input {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pos-border);
    background: var(--pos-bg);
    color: var(--pos-text);
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.modal-notes input:focus {
    border-color: var(--pos-accent);
}

.modal-notes input::placeholder {
    color: var(--pos-text-dim);
}

/* Supplement chips */
.supp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.supp-chip {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pos-border);
    background: var(--pos-bg-card);
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.supp-chip.selected {
    border-color: var(--pos-accent);
    background: rgba(205, 164, 94, 0.1);
}

.supp-chip:active {
    transform: scale(0.97);
}

.supp-chip-name {
    font-size: 13px;
    font-weight: 500;
}

.supp-chip-price {
    font-size: 12px;
    color: var(--pos-accent);
    font-weight: 700;
}

/* =============================================
   TOAST
   ============================================= */
.toast {
    position: fixed;
    bottom: calc(var(--nav-h) + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 10px 24px;
    border-radius: 40px;
    background: var(--pos-accent);
    color: var(--pos-bg);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 300;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* =============================================
   CHECKOUT — Split / Mixed Payment (F5)
   ============================================= */
.checkout-split-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    animation: fadeIn 0.2s ease;
}

.split-field {
    flex: 1;
}

.split-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--pos-text-muted);
    margin-bottom: 6px;
}

.split-field label i {
    margin-right: 4px;
}

.split-field input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--pos-border);
    background: var(--pos-bg);
    color: var(--pos-accent);
    font-size: 18px;
    font-weight: 700;
    text-align: right;
    font-family: inherit;
    outline: none;
}

.split-field input:focus {
    border-color: var(--pos-accent);
}

.split-field input[readonly] {
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.03);
}

/* Checkout — Payment delete button (F3-UI) */
.payment-done-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--pos-bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    font-size: 14px;
}

.payment-done-amount {
    margin-left: auto;
    font-weight: 700;
    color: var(--pos-accent);
}

.payment-delete-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.12);
    color: var(--pos-danger);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.payment-delete-btn:active {
    background: var(--pos-danger);
    color: #fff;
    transform: scale(0.9);
}

/* =============================================
   TABLE EXTENSION LOADING (U1)
   ============================================= */
.table-cell.extending {
    opacity: 0.5;
    pointer-events: none;
    animation: pulse-extend 0.8s ease-in-out infinite;
}

@keyframes pulse-extend {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.3; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =============================================
   REPORT
   ============================================= */
.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.report-stat {
    background: var(--pos-bg-card);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
}

.report-stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--pos-accent);
}

.report-stat-label {
    font-size: 11px;
    color: var(--pos-text-muted);
    margin-top: 4px;
}

.report-section {
    margin-bottom: 20px;
}

.report-section h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--pos-text-muted);
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.report-table th,
.report-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid var(--pos-border);
}

.report-table th {
    color: var(--pos-text-muted);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.report-table .amount {
    text-align: right;
    font-weight: 700;
    color: var(--pos-accent);
}

.report-table .total-row {
    background: rgba(255, 255, 255, 0.04);
    font-weight: 700;
}

/* =============================================
   UTILITIES
   ============================================= */
.text-muted {
    color: var(--pos-text-muted);
}

.text-accent {
    color: var(--pos-accent);
}

.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mb-10 {
    margin-bottom: 10px;
}

/* =============================================
   SERVICE CLOSED OVERLAY
   ============================================= */
.service-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(12, 11, 9, 0.95);
    z-index: 150;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px;
}

.service-overlay h2 {
    font-size: 24px;
    margin-bottom: 12px;
    color: var(--pos-text-muted);
}

.service-overlay p {
    color: var(--pos-text-dim);
    margin-bottom: 30px;
    font-size: 14px;
}

.service-overlay .btn-open {
    padding: 16px 40px;
    border-radius: var(--radius-lg);
    border: none;
    background: var(--pos-success);
    color: #000;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}

.service-overlay .btn-open:active {
    transform: scale(0.97);
}

/* Confirmation dialog */
.confirm-overlay {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 250;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirm-box {
    background: var(--pos-bg-elevated);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
}

.confirm-box h3 {
    font-size: 17px;
    margin-bottom: 10px;
}

.confirm-box p {
    font-size: 14px;
    color: var(--pos-text-muted);
    margin-bottom: 20px;
}

.confirm-actions {
    display: flex;
    gap: 10px;
}

.confirm-actions button {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.confirm-cancel {
    background: rgba(255, 255, 255, 0.06);
    color: var(--pos-text);
}

.confirm-ok {
    background: var(--pos-accent);
    color: var(--pos-bg);
}

.confirm-danger {
    background: var(--pos-danger);
    color: #fff;
}

/* =============================================
   NAV HIDDEN (tables view)
   ============================================= */
.pos-nav.nav-hidden {
    transform: translateY(100%);
    pointer-events: none;
}

.pos-main.no-nav {
    padding-bottom: var(--safe-bottom);
}

/* =============================================
   SEARCH CLEAR BUTTON
   ============================================= */
.search-bar {
    position: relative;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--pos-text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* =============================================
   COVERS MODAL
   ============================================= */
.modal-compact {
    max-width: 320px;
}

.covers-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 16px 0;
}

.covers-value {
    font-size: 48px;
    font-weight: 800;
    color: var(--pos-accent);
    min-width: 60px;
    text-align: center;
}

.covers-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.covers-preset {
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.covers-preset:active {
    background: var(--pos-accent);
    color: var(--pos-bg);
    border-color: var(--pos-accent);
}

/* =============================================
   CUSTOM ITEM MODAL
   ============================================= */
.modal-field {
    margin-bottom: 14px;
}

.modal-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--pos-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.modal-field input {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-text);
    font-size: 15px;
    font-family: inherit;
    outline: none;
}

.modal-field input:focus {
    border-color: var(--pos-accent);
}

.tva-selector {
    display: flex;
    gap: 8px;
}

.tva-btn {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.tva-btn.active {
    background: var(--pos-accent);
    color: var(--pos-bg);
    border-color: var(--pos-accent);
}

/* =============================================
   EDIT ITEM MODAL
   ============================================= */
.edit-supp-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* =============================================
   CHECKOUT V2 — MULTI PAYMENT
   ============================================= */
.checkout-remaining {
    text-align: center;
    margin-bottom: 12px;
}

.checkout-remaining-amount {
    font-size: 28px;
    font-weight: 800;
    color: var(--pos-accent);
}

.checkout-payments-done {
    margin-bottom: 16px;
}

.checkout-payments-done h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--pos-success);
    margin-bottom: 8px;
}

.payment-done-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(34, 197, 94, 0.06);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    font-size: 14px;
}

.payment-done-row .method {
    color: var(--pos-text-muted);
}

.payment-done-row .amount {
    font-weight: 600;
    color: var(--pos-success);
}

.checkout-utils {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.btn-util {
    flex: 1;
    padding: 10px 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-text-muted);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-util:active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--pos-text);
}

.checkout-item-picker {
    margin-bottom: 16px;
    border: 1px solid var(--pos-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--pos-border);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.1s;
}

.picker-item:last-child {
    border-bottom: none;
}

.picker-item:active {
    background: rgba(255, 255, 255, 0.04);
}

.picker-item input[type="checkbox"] {
    accent-color: var(--pos-accent);
    width: 18px;
    height: 18px;
}

.picker-item .picker-name {
    flex: 1;
}

.picker-item .picker-price {
    font-weight: 600;
    color: var(--pos-accent);
}

.item-picker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--pos-border);
    font-size: 14px;
}

.btn-small-accent {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--pos-accent);
    color: var(--pos-bg);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.payment-amount-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.payment-amount-row label {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.payment-amount-row input {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--pos-text);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    font-family: inherit;
    outline: none;
}

.payment-amount-row input:focus {
    border-color: var(--pos-accent);
}

.checkout-tip-indicator {
    text-align: center;
    padding: 6px 12px;
    margin: 6px 0;
    background: rgba(205, 164, 94, 0.15);
    border: 1px solid rgba(205, 164, 94, 0.3);
    border-radius: 8px;
    color: var(--pos-accent);
    font-weight: 700;
    font-size: 14px;
}

.payment-done-tip {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--pos-accent);
    opacity: 0.8;
}

.checkout-new-payment {
    margin-top: 8px;
}

/* =============================================
   EPHEMERAL TABLE CELL
   ============================================= */
.table-cell.ephemeral {
    border-style: dashed;
}

.table-cell.ephemeral .table-name {
    font-style: italic;
}

/* Empty cell — clickable for ephemeral */
.table-cell.empty {
    cursor: pointer;
}

.table-cell.empty:active {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

/* =============================================
   MERGE INDICATOR
   ============================================= */
.table-merge-label {
    font-size: 8px;
    color: var(--table-merged);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.merged .table-status-dot {
    background: var(--table-merged);
}

/* =============================================
   TAB NAVIGATION (Salle / À emporter / Résumé)
   ============================================= */
.tab-nav {
    display: flex;
    gap: 4px;
    padding: 6px 12px;
    padding-bottom: calc(6px + var(--safe-bottom));
    background: var(--pos-bg-elevated);
    border-top: 1px solid var(--pos-border);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 90;
}

.tab-nav-btn {
    flex: 1;
    padding: 10px 8px;
    border-radius: var(--radius-md);
    border: none;
    background: transparent;
    color: var(--pos-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.tab-nav-btn.active {
    background: var(--pos-accent);
    color: var(--pos-bg);
}

.tab-nav-btn:active {
    transform: scale(0.96);
}

.tab-nav-btn i {
    margin-right: 4px;
}

/* Add bottom padding when tab-nav is visible */
.pos-main.has-tabs {
    padding-bottom: calc(50px + var(--safe-bottom));
}

/* =============================================
   TAKEAWAY VIEW
   ============================================= */
.takeaway-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 80px;
}

.takeaway-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--pos-text-dim);
}

.takeaway-empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
    display: block;
}

.takeaway-card {
    background: var(--pos-bg-card);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--pos-border);
}

.takeaway-card:active {
    transform: scale(0.98);
    background: var(--pos-bg-card-hover);
}

.takeaway-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.takeaway-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--pos-accent);
}

.takeaway-time {
    font-size: 12px;
    color: var(--pos-text-muted);
}

.takeaway-customer {
    font-size: 13px;
    color: var(--pos-accent-light);
    margin-bottom: 6px;
    font-weight: 500;
}

.takeaway-pickup-badge {
    display: inline-block;
    background: var(--pos-accent);
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    margin-bottom: 6px;
}

.takeaway-cc {
    border-left: 3px solid var(--pos-accent);
}

.takeaway-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--pos-text-muted);
    margin-bottom: 8px;
}

.takeaway-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--pos-accent);
}

.btn-new-takeaway {
    position: fixed;
    bottom: calc(50px + var(--safe-bottom) + 20px);
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--pos-accent);
    color: var(--pos-bg);
    border: none;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 50;
    transition: all 0.2s;
}

.btn-new-takeaway:active {
    transform: scale(0.9);
}

/* =============================================
   SUMMARY VIEW
   ============================================= */
.summary-content {
    padding-bottom: 40px;
}

.summary-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--pos-border);
}

.summary-header p {
    font-size: 13px;
    color: var(--pos-text-muted);
}

/* Separator button */
.summary-separator-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--pos-border);
    background: var(--pos-bg-card);
    color: var(--pos-text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.summary-separator-btn:hover {
    border-color: var(--pos-accent);
    color: var(--pos-accent);
}

.summary-separator-btn.active {
    border-color: var(--pos-accent);
    background: rgba(205, 164, 94, 0.1);
    color: var(--pos-accent);
}

/* Separator sections in report */
.separator-divider {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 2px dashed var(--pos-accent);
}

.separator-divider h4 {
    color: var(--pos-accent) !important;
}

.separator-section {
    background: var(--pos-bg-card);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.separator-section h4 {
    font-size: 13px !important;
    color: var(--pos-text-muted) !important;
    margin-bottom: 8px;
}

.report-grid.compact {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 8px;
}

.report-grid.compact .report-stat {
    padding: 6px 4px;
}

.report-grid.compact .report-stat-value {
    font-size: 16px;
}

.report-grid.compact .report-stat-label {
    font-size: 10px;
}

/* Clickable report stat */
.report-stat.clickable {
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.report-stat.clickable:active {
    transform: scale(0.95);
    border-color: var(--pos-accent);
    background: var(--pos-bg-card-hover);
}

/* =============================================
   ORDER LIST OVERLAY
   ============================================= */
.order-list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-list-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
    background: var(--pos-bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--pos-border);
}

.order-list-row.closed {
    opacity: 0.7;
}

.order-list-info {
    flex: 1;
    min-width: 0;
}

.order-list-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.order-list-meta {
    display: block;
    font-size: 11px;
    color: var(--pos-text-muted);
    margin-top: 2px;
}

.order-list-right {
    text-align: right;
    flex-shrink: 0;
}

.order-list-total {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--pos-accent);
}

.order-list-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
}

.order-list-status.open {
    background: rgba(34, 197, 94, 0.15);
    color: var(--pos-success);
}

.order-list-status.closed {
    background: rgba(255, 255, 255, 0.06);
    color: var(--pos-text-muted);
}

.order-list-actions {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.order-list-btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--pos-accent);
    color: var(--pos-bg);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.order-list-btn:active {
    transform: scale(0.95);
    background: var(--pos-accent-dark);
}

.order-list-btn.reopen {
    background: rgba(255, 255, 255, 0.06);
    color: var(--pos-text);
    border: 1px solid var(--pos-border);
}

.order-list-btn.reopen:active {
    background: rgba(255, 255, 255, 0.12);
}

/* =============================================
   MEAL SHEET (Fiche Repas) — Order list button + Modal
   ============================================= */

.order-list-btn.meal-sheet {
    background: rgba(205, 164, 94, 0.15);
    color: var(--pos-accent);
    border: 1px solid var(--pos-accent);
}

.order-list-btn.meal-sheet:active {
    background: rgba(205, 164, 94, 0.3);
}

.meal-sheet-separator {
    height: 1px;
    background: var(--pos-border);
    margin: 12px 0;
}

.meal-sheet-footer {
    display: flex;
    gap: 8px;
}

.meal-sheet-btn-preview {
    flex: 1;
    background: var(--pos-bg-card) !important;
    color: var(--pos-text) !important;
    border: 1px solid var(--pos-border) !important;
}

.meal-sheet-btn-preview:active {
    background: var(--pos-bg-card-hover) !important;
}

.meal-sheet-btn-send {
    flex: 1;
}

/* =============================================
   SAFARI 12 COMPAT — Flex gap fallback
   Applied via JS detection: body.no-flex-gap
   ============================================= */

/* Header */
.no-flex-gap .header-left > * + *,
.no-flex-gap .header-right > * + * { margin-left: 8px; }
.no-flex-gap .service-indicator > * + * { margin-left: 6px; }

/* Tables */
.no-flex-gap .table-actions > * + * { margin-left: 8px; }
.no-flex-gap .btn-action > * + * { margin-left: 6px; }

/* Cart */
.no-flex-gap .cart-covers > * + * { margin-left: 8px; }
.no-flex-gap .btn-cart-supp > * + * { margin-left: 4px; }
.no-flex-gap .cart-item > * + * { margin-left: 10px; }
.no-flex-gap .cart-item-qty > * + * { margin-left: 6px; }
.no-flex-gap .cart-customer-row > * + * { margin-left: 8px; }

/* Checkout */
.no-flex-gap .checkout-btn > * + * { margin-top: 8px; }
.no-flex-gap .btn-validate > * + * { margin-left: 8px; }
.no-flex-gap .checkout-split-row > * + * { margin-left: 12px; }
.no-flex-gap .payment-done-row > * + * { margin-left: 10px; }
.no-flex-gap .confirm-actions > * + * { margin-left: 10px; }
.no-flex-gap .covers-selector > * + * { margin-left: 20px; }
.no-flex-gap .tva-selector > * + * { margin-left: 8px; }
.no-flex-gap .checkout-utils > * + * { margin-left: 8px; }
.no-flex-gap .btn-util > * + * { margin-left: 6px; }
.no-flex-gap .picker-item > * + * { margin-left: 10px; }
.no-flex-gap .payment-amount-row > * + * { margin-left: 12px; }

/* Navigation */
.no-flex-gap .nav-btn > * + * { margin-top: 4px; }
.no-flex-gap .tab-nav > * + * { margin-left: 4px; }

/* Takeaway & Summary */
.no-flex-gap .takeaway-list > * + * { margin-top: 12px; }
.no-flex-gap .takeaway-info > * + * { margin-left: 16px; }
.no-flex-gap .summary-separator-btn > * + * { margin-left: 6px; }
.no-flex-gap .order-list-items > * + * { margin-top: 8px; }
.no-flex-gap .order-list-row > * + * { margin-left: 10px; }
.no-flex-gap .meal-sheet-footer > * + * { margin-left: 8px; }
.no-flex-gap .order-list-actions > * + * { margin-left: 6px; }

/* Edit supp grid (flex-wrap) */
.no-flex-gap .edit-supp-grid { margin: -3px; }
.no-flex-gap .edit-supp-grid > * { margin: 3px; }

/* Category bar */
.no-flex-gap .category-bar > * + * { margin-left: 6px; }

/* =============================================
   SAFARI 12 COMPAT — aspect-ratio fallback
   ============================================= */
@supports not (aspect-ratio: 1) {
    .table-cell:not(.extended) {
        height: 0;
        padding-bottom: calc(100% - 4px);
        min-height: auto;
        overflow: hidden;
    }
    .table-cell.empty {
        height: 0;
        padding-bottom: calc(100% - 4px);
        min-height: auto;
    }
}

/* =============================================
   STOCK CLOSURE (service close integration)
   ============================================= */
.sc-section {
    border-bottom: 1px solid var(--pos-border);
}

.sc-section:last-child {
    border-bottom: none;
}

.sc-section-title {
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 700;
    color: var(--pos-accent);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(205, 164, 94, 0.06);
}

.sc-section-title.sc-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sc-count {
    font-weight: 400;
    color: var(--pos-text-muted);
    font-size: 12px;
    margin-left: 6px;
}

.sc-cat-title {
    padding: 8px 20px 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pos-text-dim);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sc-row {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
}

.sc-row.touched {
    background: rgba(205, 164, 94, 0.08);
}

.sc-name {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
}

.sc-stock {
    font-size: 12px;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 12px;
}

.sc-stock-ok {
    color: var(--pos-success);
    background: rgba(74, 222, 128, 0.1);
}

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

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

.sc-counter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-counter-val {
    font-size: 16px;
    font-weight: 700;
    min-width: 28px;
    text-align: center;
    color: var(--pos-accent);
}

.sc-counter-val.zero {
    color: var(--pos-text-dim);
    font-weight: 400;
}

/* Summary after submission */
.sc-summary-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sc-summary-stat {
    font-size: 14px;
    color: var(--pos-text-muted);
    margin-bottom: 16px;
}

.sc-alert-section {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.sc-alert-section.critical {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.sc-alert-section.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.sc-alert-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sc-alert-section.critical .sc-alert-title {
    color: var(--pos-danger);
}

.sc-alert-section.warning .sc-alert-title {
    color: var(--pos-warning);
}

.sc-alert-item {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    padding: 2px 0;
    color: var(--pos-text-muted);
}

.sc-footer-btns {
    display: flex;
    gap: 12px;
}

/* No-flex-gap fallback */
.no-flex-gap .sc-counter > * + * { margin-left: 8px; }
.no-flex-gap .sc-section-title.sc-toggle > * + * { margin-left: 6px; }
.no-flex-gap .sc-summary-title > * + * { margin-left: 8px; }
.no-flex-gap .sc-alert-title > * + * { margin-left: 6px; }
.no-flex-gap .sc-footer-btns > * + * { margin-left: 12px; }