/**
 * CORN CITY POS v1.0 — Production polish (UI/UX only)
 */

:root {
    --cc-gray: #f4f6f9;
    --cc-gray-border: #e9ecef;
    --cc-text-muted: #6c757d;
    --cc-info: #1565c0;
    --cc-danger: #c62828;
    --cc-warning: var(--corn-orange);
    --cc-success: var(--corn-green);
    --btn-radius: 12px;
    --btn-min-height: 44px;
}

/* ── Typography ── */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
}

.page-heading { font-size: 1.25rem; font-weight: 600; }
h5, .h5 { font-size: 1.05rem; font-weight: 600; }

/* ── Unified buttons ── */
.btn,
.btn-corn,
.btn-yellow,
.btn-login,
.payment-btn {
    border-radius: var(--btn-radius);
    min-height: var(--btn-min-height);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.btn:focus-visible,
.btn-corn:focus-visible,
.btn-yellow:focus-visible,
.payment-btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible,
.nav-item:focus-visible,
.category-btn:focus-visible {
    outline: 2px solid var(--corn-yellow);
    outline-offset: 2px;
}

.btn-corn {
    background: var(--corn-green);
    color: #fff;
    border: none;
}

.btn-corn:hover, .btn-corn:active {
    background: var(--corn-green-dark);
    color: #fff;
}

.btn-yellow {
    background: var(--corn-yellow);
    color: #333;
    border: none;
}

.btn-yellow:hover {
    background: var(--corn-yellow-dark);
    color: #333;
}

.btn-outline-primary {
    border-color: var(--corn-green);
    color: var(--corn-green);
}

.btn-outline-primary:hover {
    background: var(--corn-green);
    border-color: var(--corn-green);
    color: #fff;
}

.btn-outline-danger {
    border-color: var(--cc-danger);
    color: var(--cc-danger);
}

.btn-outline-warning {
    border-color: var(--corn-orange);
    color: #b45309;
}

.btn.is-loading {
    pointer-events: none;
    opacity: 0.85;
}

/* Payment — brand-aligned */
.payment-btn.pay-cash { border-color: var(--corn-green); background: #e8f5e9; color: var(--corn-green-dark); }
.payment-btn.pay-upi { border-color: var(--cc-info); background: #e8f4fd; color: #0d47a1; }
.payment-btn.pay-card { border-color: var(--cc-gray-border); background: #fff; color: #444; }
.payment-btn.pay-split { border-color: var(--corn-orange); background: #fff8e6; color: #b45309; }

.payment-btn.pay-cash.active { background: #c8e6c9; }
.payment-btn.pay-upi.active { background: #bbdefb; }
.payment-btn.pay-card.active { background: var(--cc-gray); border-color: var(--corn-green); color: var(--corn-green-dark); }
.payment-btn.pay-split.active { background: #ffe8b3; }

/* Stat cards — brand palette only */
.stat-card.blue .stat-icon { background: rgba(21, 101, 192, 0.12); color: var(--cc-info); }
.stat-card.purple .stat-icon { background: rgba(245, 197, 24, 0.2); color: var(--corn-yellow-dark); }

/* ── Empty states ── */
.empty-state {
    padding: 2.5rem 1.5rem;
    color: var(--cc-text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    color: #ccc;
    margin-bottom: 0.75rem;
}

.empty-state p {
    margin: 0;
    font-size: 0.95rem;
}

.empty-state-inline {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--cc-text-muted);
}

.empty-state-inline i {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
    color: #ccc;
}

/* ── Mobile table → cards ── */
@media (max-width: 767.98px) {
    .table-mobile-stack thead {
        display: none;
    }

    .table-mobile-stack tbody tr {
        display: block;
        background: #fff;
        border: 1px solid var(--cc-gray-border);
        border-radius: var(--btn-radius);
        margin-bottom: 0.75rem;
        padding: 0.75rem 1rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    }

    .dark-mode .table-mobile-stack tbody tr {
        background: #252830;
        border-color: #333;
    }

    .table-mobile-stack tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.35rem 0;
        border: none;
        text-align: right;
    }

    .table-mobile-stack tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--cc-text-muted);
        text-align: left;
        flex-shrink: 0;
    }

    .table-mobile-stack tbody td.actions-cell {
        justify-content: flex-end;
        padding-top: 0.5rem;
        border-top: 1px dashed var(--cc-gray-border);
        margin-top: 0.25rem;
    }

    .table-mobile-stack tbody td.actions-cell::before {
        display: none;
    }
}

/* ── Overflow guard ── */
.main-content,
.content-card,
.table-responsive {
    max-width: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* ── Form validation hints ── */
.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--cc-danger);
}

.invalid-feedback {
    display: block;
    color: var(--cc-danger);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ── Login polish ── */
.login-card .btn-login {
    min-height: 48px;
    border-radius: var(--btn-radius);
}

/* ══════════════════════════════════════════════════════════════
   POS Billing layout v3 — fit one screen, all devices
   ══════════════════════════════════════════════════════════════ */

body.pos-page {
    --pos-chrome-height: var(--topbar-height, 60px);
    --pos-cart-width: clamp(250px, 26vw, 310px);
}

body.cashier-fullscreen.pos-page {
    --pos-chrome-height: 48px;
}

body.pos-page .app-footer {
    display: none;
}

body.pos-page .main-content {
    padding: 4px 6px;
    display: flex;
    flex-direction: column;
    height: calc(100dvh - var(--pos-chrome-height));
    max-height: calc(100dvh - var(--pos-chrome-height));
    overflow: hidden;
    box-sizing: border-box;
}

body.pos-page .main-content > .alert {
    flex-shrink: 0;
    margin-bottom: 4px;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
}

body.pos-page .pos-billing-root {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    gap: 4px;
    overflow: hidden;
}

/* ── Toolbar: stats + search + fullscreen ── */
body.pos-page .pos-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    min-height: 0;
}

body.pos-page .pos-stats-row {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

body.pos-page .pos-stat-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    min-height: 28px;
    background: #fff;
    border: 1px solid var(--cc-gray-border, #e0e0e0);
    border-radius: 5px;
    white-space: nowrap;
}

.dark-mode.pos-page .pos-stat-pill {
    background: #252830;
    border-color: #333;
}

body.pos-page .pos-stat-label {
    font-size: 0.58rem;
    color: var(--cc-text-muted, #888);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

body.pos-page .pos-stat-value {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--corn-green, #2d8a4e);
    line-height: 1;
}

body.pos-page .pos-stat-next .pos-stat-value {
    color: var(--corn-yellow-dark, #d4a90a);
}

body.pos-page .pos-toolbar .pos-search-input-wrap {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 8px;
    min-height: 30px;
    background: #fff;
    border: 1px solid var(--cc-gray-border, #ddd);
    border-radius: 5px;
}

.dark-mode.pos-page .pos-toolbar .pos-search-input-wrap {
    background: #252830;
    border-color: #444;
}

body.pos-page .pos-search-input-wrap > i {
    color: #999;
    font-size: 0.85rem;
    flex-shrink: 0;
}

body.pos-page .pos-search-input-wrap .form-control {
    border: none;
    background: transparent;
    box-shadow: none;
    padding: 0.2rem 0;
    font-size: 0.8rem;
    min-height: 28px;
}

body.pos-page .pos-search-input-wrap .form-control:focus {
    box-shadow: none;
}

body.pos-page .pos-fullscreen-btn {
    flex-shrink: 0;
    width: 32px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 0.9rem;
}

body.pos-page .pos-favorites-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    padding: 0;
    overflow: hidden;
    max-height: 26px;
}

body.pos-page .pos-favorites-label {
    font-size: 0.62rem;
    color: var(--cc-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

body.pos-page .favorites-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.pos-page .fav-btn {
    padding: 2px 8px;
    font-size: 0.65rem;
    border-radius: 10px;
    border: 1px solid var(--cc-gray-border);
    background: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    line-height: 1.3;
}

.dark-mode.pos-page .fav-btn {
    background: #1e2128;
    border-color: #444;
    color: #ddd;
}

/* ── 3-column workspace — must fill remaining height ── */
body.pos-page .pos-container {
    flex: 1 1 0;
    min-height: 0;
    display: flex;
    gap: 5px;
    align-items: stretch;
    overflow: hidden;
    height: auto !important;
}

body.pos-page .pos-categories {
    width: clamp(120px, 11vw, 150px);
    min-width: 110px;
    max-width: 150px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    border: 1px solid var(--cc-gray-border, #e0e0e0);
    border-radius: 5px;
    -webkit-overflow-scrolling: touch;
}

.dark-mode.pos-page .pos-categories {
    background: #252830;
    border-color: #333;
}

body.pos-page .category-btn {
    width: 100%;
    min-height: 36px;
    max-height: 40px;
    padding: 4px 6px;
    margin: 0;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.15;
    text-align: left;
    border-radius: 4px;
    border: 1px solid transparent;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    flex-shrink: 0;
}

.dark-mode.pos-page .category-btn {
    background: #1e2128;
    color: #ddd;
}

body.pos-page .category-btn:hover,
body.pos-page .category-btn.active {
    background: var(--corn-green, #2d8a4e);
    color: #fff;
    border-color: var(--corn-green-dark, #1e6b3a);
}

body.pos-page .pos-products {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--cc-gray-border, #e0e0e0);
    border-radius: 5px;
}

.dark-mode.pos-page .pos-products {
    background: #252830;
    border-color: #333;
}

body.pos-page .pos-items-grid {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 4px;
    padding: 4px;
    align-content: start;
    -webkit-overflow-scrolling: touch;
}

body.pos-page .pos-loading {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 1.5rem;
    color: #888;
    font-size: 0.8rem;
}

body.pos-page .menu-item-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: 112px;
    min-height: 108px;
    max-height: 118px;
    padding: 5px 4px 4px;
    border-radius: 5px;
    border: 1px solid #e8e8e8;
    background: #fff;
    cursor: pointer;
    text-align: center;
}

.dark-mode.pos-page .menu-item-card {
    background: #1e2128;
    border-color: #3a3f4a;
}

body.pos-page .menu-item-card:hover {
    border-color: var(--corn-green);
}

body.pos-page .menu-item-card .item-img {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    margin-bottom: 2px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: #f5f5f5;
    overflow: hidden;
}

body.pos-page .menu-item-card .item-name {
    font-weight: 600;
    font-size: 0.68rem;
    line-height: 1.15;
    margin-bottom: 1px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    width: 100%;
    color: #1565c0;
}

body.pos-page .menu-item-card .item-price {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--corn-green, #2d8a4e);
    flex-shrink: 0;
}

/* ── Cart panel — flex column, footer always visible ── */
body.pos-page .pos-cart {
    width: var(--pos-cart-width);
    min-width: 0;
    flex: 0 0 var(--pos-cart-width);
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--cc-gray-border, #e0e0e0);
    border-radius: 5px;
}

.dark-mode.pos-page .pos-cart {
    background: #252830;
    border-color: #333;
}

body.pos-page .cart-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    font-size: 0.8rem;
    font-weight: 700;
    border-bottom: 1px solid var(--cc-gray-border, #e0e0e0);
    gap: 4px;
}

body.pos-page .cart-header-main {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1 1 auto;
}

body.pos-page .parcel-toggle-btn {
    background: var(--corn-green, #2d8a4e);
    color: #fff;
    border: none;
    font-size: 0.65rem;
    padding: 2px 7px;
    border-radius: 6px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

body.pos-page .parcel-toggle-btn.is-on {
    background: #e65100;
    color: #fff;
}

body.pos-page .parcel-toggle-btn:hover,
body.pos-page .parcel-toggle-btn:focus {
    color: #fff;
    opacity: 0.92;
}

body.pos-page .cart-title {
    display: flex;
    align-items: center;
    gap: 4px;
}

body.pos-page .cart-header-actions {
    display: flex;
    align-items: center;
    gap: 3px;
}

body.pos-page .cart-header-actions .btn {
    padding: 2px 6px;
    font-size: 0.75rem;
    line-height: 1;
}

body.pos-page .cart-held-btn {
    position: relative;
}

body.pos-page .cart-held-btn .held-count {
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 0.55rem;
    padding: 1px 4px;
}

body.pos-page .held-resume-banner {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    font-size: 0.68rem;
    background: #fff8e1;
    border-bottom: 1px solid #ffe082;
    color: #795548;
}

body.pos-page .cart-items {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 2px 6px;
    -webkit-overflow-scrolling: touch;
}

body.pos-page .cart-items .empty-state {
    padding: 0.75rem 0.25rem;
    text-align: center;
    color: #999;
    font-size: 0.75rem;
}

body.pos-page .cart-items .empty-state i {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 4px;
}

body.pos-page .cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 3px 4px;
    align-items: center;
    padding: 5px 1px;
    border-bottom: 1px solid var(--cc-gray-border, #eee);
}

body.pos-page .cart-item-name {
    font-weight: 600;
    font-size: 0.72rem;
    line-height: 1.2;
    min-width: 0;
    color: #1565c0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.pos-page .cart-item-info {
    min-width: 0;
}

body.pos-page .cart-item-detail,
body.pos-page .cart-item-parcel {
    font-size: 0.64rem;
    line-height: 1.25;
    color: #666;
}

body.pos-page .cart-item-parcel {
    color: #e65100;
    font-weight: 600;
}

body.pos-page .cart-item.cart-item--parcel {
    align-items: start;
    padding-top: 6px;
    padding-bottom: 6px;
}

body.pos-page .cart-item-total {
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    min-width: 44px;
    text-align: right;
}

body.pos-page .qty-control button {
    width: 20px;
    height: 20px;
    font-size: 0.75rem;
    padding: 0;
    border-radius: 3px;
    border: 1px solid #ccc;
    background: #f5f5f5;
    cursor: pointer;
    line-height: 1;
}

body.pos-page .qty-control .qty {
    min-width: 14px;
    font-size: 0.72rem;
    font-weight: 600;
    text-align: center;
}

body.pos-page .cart-item .btn-remove {
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--cc-danger, #c62828);
    font-size: 0.7rem;
    cursor: pointer;
}

body.pos-page .cart-footer {
    flex: 0 0 auto;
    border-top: 1px solid var(--cc-gray-border, #e0e0e0);
    background: #fff;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    max-height: min(52vh, 340px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.pos-page .cart-summary {
    padding: 4px 8px 2px;
}

body.pos-page .summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0;
    font-size: 0.68rem;
    line-height: 1.35;
}

body.pos-page .summary-row.total {
    font-size: 0.88rem;
    font-weight: 700;
    padding-top: 2px;
    margin-top: 2px;
    border-top: 1px dashed #ddd;
    color: var(--corn-green, #2d8a4e);
}

body.pos-page .cart-actions {
    display: flex;
    flex-direction: column;
    padding: 3px 6px 5px;
    gap: 4px;
}

body.pos-page .cart-actions-compact {
    display: flex;
    align-items: center;
    gap: 4px;
}

body.pos-page .cart-actions-compact > .btn {
    width: 32px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

body.pos-page .cart-extras-details {
    position: relative;
    flex-shrink: 0;
}

body.pos-page .cart-extras-details > summary {
    list-style: none;
    width: 32px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

body.pos-page .cart-extras-details > summary::-webkit-details-marker {
    display: none;
}

body.pos-page .cart-extras-body {
    position: absolute;
    right: 0;
    bottom: calc(100% + 4px);
    z-index: 20;
    width: min(240px, 70vw);
    padding: 6px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dark-mode.pos-page .cart-extras-body {
    background: #252830;
    border-color: #444;
}

body.pos-page .cart-extras-body .form-control {
    font-size: 0.72rem;
    min-height: 26px;
    padding: 0.2rem 0.4rem;
}

body.pos-page .note-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

body.pos-page .note-shortcuts .btn {
    font-size: 0.58rem;
    padding: 1px 5px;
    min-height: 20px;
    line-height: 1.2;
}

body.pos-page .payment-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

body.pos-page .payment-btn {
    min-height: 30px;
    padding: 2px;
    font-size: 0.68rem;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    line-height: 1.1;
}

body.pos-page .payment-btn .pay-icon {
    font-size: 0.85rem;
    line-height: 1;
}

body.pos-page .payment-btn .pay-label {
    font-size: 0.62rem;
}

body.pos-page .cart-checkout-stack {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 100%;
}

body.pos-page .cart-checkout-stack .btn {
    width: 100%;
    min-height: 34px;
    font-size: 0.8rem;
    border-radius: 5px;
}

body.pos-page .cart-checkout-stack .pos-checkout-btn {
    min-height: 36px;
    font-weight: 700;
}

body.pos-page .cart-checkout-row .btn {
    min-height: 32px;
    font-size: 0.78rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
}

/* Browser fullscreen mode */
body.pos-browser-fullscreen .sidebar,
body.pos-browser-fullscreen .topbar,
body.pos-browser-fullscreen .cashier-topbar {
    display: none !important;
}

body.pos-browser-fullscreen .main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
}

body.pos-browser-fullscreen.pos-page .main-content {
    height: 100dvh;
    max-height: 100dvh;
    padding: 4px 6px;
}

/* ── Responsive breakpoints ── */

/* Large desktop */
@media (min-width: 1600px) {
    body.pos-page {
        --pos-cart-width: clamp(280px, 22vw, 340px);
    }

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

    body.pos-page .menu-item-card {
        height: 118px;
    }
}

/* Standard desktop / laptop */
@media (min-width: 1200px) and (max-width: 1599px) {
    body.pos-page .pos-items-grid {
        grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    }
}

/* Small laptop 1366×768 */
@media (min-width: 992px) and (max-height: 820px) {
    body.pos-page .main-content {
        padding: 3px 5px;
    }

    body.pos-page {
        --pos-cart-width: clamp(235px, 24vw, 280px);
    }

    body.pos-page .pos-stat-pill {
        min-height: 26px;
        padding: 2px 5px;
    }

    body.pos-page .pos-stat-value {
        font-size: 0.78rem;
    }

    body.pos-page .category-btn {
        min-height: 32px;
        max-height: 36px;
        font-size: 0.66rem;
    }

    body.pos-page .menu-item-card {
        height: 104px;
        min-height: 100px;
    }

    body.pos-page .menu-item-card .item-img {
        width: 36px;
        height: 36px;
    }

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

    body.pos-page .payment-btn {
        min-height: 28px;
    }

    body.pos-page .cart-checkout-stack .btn {
        min-height: 32px;
    }

    body.pos-page .cart-checkout-stack .pos-checkout-btn {
        min-height: 34px;
    }

    body.pos-page .cart-footer {
        max-height: min(48vh, 300px);
    }
}

/* Tablet portrait / small */
@media (max-width: 991.98px) {
    body.pos-page .main-content {
        height: calc(100dvh - var(--pos-chrome-height));
        max-height: calc(100dvh - var(--pos-chrome-height));
        overflow: hidden;
    }

    body.pos-page .pos-toolbar {
        flex-wrap: wrap;
    }

    body.pos-page .pos-stats-row {
        order: 1;
        width: 100%;
    }

    body.pos-page .pos-toolbar .pos-search-input-wrap {
        order: 2;
        flex: 1;
    }

    body.pos-page .pos-fullscreen-btn {
        order: 3;
    }

    body.pos-page .pos-container {
        flex-direction: column;
        flex: 1 1 0;
    }

    body.pos-page .pos-categories {
        width: 100%;
        max-width: none;
        min-width: 0;
        max-height: 42px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        flex-shrink: 0;
    }

    body.pos-page .category-btn {
        width: auto;
        min-width: 72px;
        min-height: 32px;
        max-height: 34px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    body.pos-page .pos-products {
        flex: 1 1 0;
        min-height: 0;
    }

    body.pos-page .pos-cart {
        flex: 0 0 auto;
        width: 100%;
        max-height: 42vh;
    }

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

/* Mobile */
@media (max-width: 575.98px) {
    body.pos-page .pos-stat-label {
        display: none;
    }

    body.pos-page .pos-stat-pill {
        padding: 2px 6px;
    }

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

    body.pos-page .menu-item-card {
        height: 98px;
        min-height: 94px;
    }

    body.pos-page .pos-cart {
        max-height: 45vh;
    }

    body.pos-page .payment-btn .pay-label {
        display: none;
    }
}

/* Landscape tablet */
@media (min-width: 768px) and (max-width: 991.98px) and (orientation: landscape) {
    body.pos-page .pos-container {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    body.pos-page .pos-categories {
        width: 110px;
        max-height: none;
        flex-direction: column;
        overflow-y: auto;
    }

    body.pos-page .pos-products {
        flex: 1;
        min-width: 0;
    }

    body.pos-page .pos-cart {
        width: clamp(220px, 30vw, 280px);
        flex: 0 0 clamp(220px, 30vw, 280px);
        max-height: 100%;
    }
}

.held-bill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #eee;
}

.held-bill-row:last-child {
    border-bottom: none;
}

.held-bill-info {
    flex: 1;
    min-width: 0;
}

.held-bill-total {
    font-weight: 700;
    color: var(--corn-green, #2d8a4e);
    margin-left: 6px;
}

.held-bill-info small {
    font-size: 0.7rem;
    line-height: 1.25;
}

/* ══════════════════════════════════════════════════════════════
   Cashier fullscreen — no sidebar, maximum billing area
   ══════════════════════════════════════════════════════════════ */

body.cashier-fullscreen .main-wrapper.cashier-main {
    margin-left: 0;
    width: 100%;
    max-width: 100vw;
}

body.cashier-fullscreen .cashier-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    min-height: 48px;
    padding: 0 12px;
    background: linear-gradient(90deg, var(--corn-green-dark), var(--corn-green));
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

body.cashier-fullscreen .cashier-topbar-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}

body.cashier-fullscreen .cashier-topbar-brand .logo-icon {
    font-size: 1.2rem;
}

body.cashier-fullscreen .cashier-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.cashier-fullscreen .cashier-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s ease;
}

body.cashier-fullscreen .cashier-nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

body.cashier-fullscreen .cashier-nav-link.active {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

body.cashier-fullscreen .cashier-topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

body.cashier-fullscreen .cashier-topbar-actions .user-info {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.78rem;
}

body.cashier-fullscreen .btn-topbar-switch-user {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

body.cashier-fullscreen .btn-topbar-switch-user:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border-color: #fff;
}

/* Legacy alias */
body.cashier-fullscreen .cashier-logout {
    border-color: rgba(255, 255, 255, 0.65);
    color: #fff;
}

body.cashier-fullscreen .app-footer {
    display: none;
}

body.cashier-fullscreen.pos-page .main-content {
    height: calc(100dvh - 48px);
    max-height: calc(100dvh - 48px);
    padding: 3px 5px;
}

body.cashier-fullscreen.pos-browser-fullscreen.pos-page .main-content {
    height: 100dvh;
    max-height: 100dvh;
}

body.cashier-fullscreen:not(.pos-page) .main-content {
    height: calc(100vh - 48px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    padding: 12px 14px;
}

@media (max-width: 575.98px) {
    body.cashier-fullscreen .cashier-topbar-brand .brand-name {
        display: none;
    }

    body.cashier-fullscreen .cashier-nav-link {
        padding: 6px 8px;
        font-size: 0.75rem;
    }

    body.cashier-fullscreen .cashier-nav-link i {
        margin: 0;
    }

    .btn-topbar-switch-user .btn-switch-label {
        display: none;
    }

    .btn-topbar-switch-user {
        padding: 0.35rem 0.5rem;
    }
}
