:root {
    --ckk-brown: #4a2c1f;
    --ckk-brown-dark: #3a2118;
    --ckk-amber: #d98c3d;
    --ckk-amber-light: #f2a65a;
    --ckk-cream: #faf6f1;
    --ckk-card: #ffffff;
    --ckk-text: #2b1b12;
    --ckk-muted: #8a7568;
    --sidebar-width: 240px;
}

* {
    box-sizing: border-box;
}

html, body {
    /* Belt-and-suspenders: no single element should ever be wider than
       the screen, but this guarantees the page itself never grows a
       horizontal scrollbar even if one does. */
    overflow-x: hidden;
}

body {
    margin: 0;
    background-color: var(--ckk-cream);
    color: var(--ckk-text);
    font-family: "Segoe UI", Roboto, -apple-system, BlinkMacSystemFont, sans-serif;
}

.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--ckk-brown) 0%, var(--ckk-brown-dark) 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1030;
    transition: transform 0.2s ease-in-out;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-brand-logo {
    height: 20px;
    width: auto;
    display: block;
}

.sidebar-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar .nav-link.active {
    background-color: var(--ckk-amber);
    color: #2b1b12;
    font-weight: 700;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.logout-link {
    cursor: pointer;
}

.sidebar-credit {
    margin: 0.6rem 0 0;
    padding: 0 0.5rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
}

.sidebar-credit a {
    color: rgba(255, 255, 255, 0.6);
}

/* Main content */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: margin-left 0.2s ease-in-out;
}

/* Collapsible sidebar (desktop only — mobile already has its own
   off-canvas show/hide via .sidebar.show at the bottom of this file). */
@media (min-width: 992px) {
    body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    body.sidebar-collapsed .app-main {
        margin-left: 0;
    }
}

.impersonation-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.6rem 1.5rem;
    background-color: #c0392b;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1021;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background-color: var(--ckk-card);
    border-bottom: 1px solid #eee0d3;
    position: sticky;
    top: 0;
    z-index: 1020;
}

/* Stacks directly beneath the impersonation banner rather than both being
   pinned to the very top and overlapping. */
body.impersonating .topbar {
    top: 40px;
}

.topbar-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-name {
    font-weight: 600;
}

.role-badge {
    font-weight: 500;
    text-transform: capitalize;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

.sidebar-user .user-name {
    font-size: 0.9rem;
}

.content {
    padding: 1.5rem;
    flex: 1;
}

/* Cards */
.stat-card-row {
    display: grid;
    /* auto-fit instead of a hardcoded column count — this is reused for
       both the Dashboard's 4 cards and Reports' 3, and needs to fill the
       row evenly either way rather than leaving a gap for a card that
       isn't there. */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.stat-card-col {
    min-width: 0;
}

@media (max-width: 991.98px) {
    .stat-card-row {
        display: flex;
        gap: 0.75rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
        margin: 0 -1.5rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .stat-card-col {
        flex: 0 0 220px;
    }
}

.stat-card {
    background-color: var(--ckk-card);
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(43, 27, 18, 0.08);
    border: 1px solid #f0e5d8;
    height: 100%;
}

.stat-card .stat-label {
    color: var(--ckk-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-card .stat-value {
    font-size: 1.9rem;
    font-weight: 700;
    margin-top: 0.25rem;
    color: var(--ckk-text);
}

.stat-card .stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fbe9d4;
    color: var(--ckk-amber);
    font-size: 1.3rem;
}

.panel {
    background-color: var(--ckk-card);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(43, 27, 18, 0.08);
    border: 1px solid #f0e5d8;
}

.btn-ckk {
    background-color: var(--ckk-amber);
    border-color: var(--ckk-amber);
    color: #2b1b12;
    font-weight: 600;
}

.btn-ckk:hover {
    background-color: var(--ckk-amber-light);
    border-color: var(--ckk-amber-light);
    color: #2b1b12;
}

/* Auth page */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--ckk-brown) 0%, var(--ckk-brown-dark) 60%);
    padding: 1rem;
}

.auth-card {
    background-color: var(--ckk-card);
    border-radius: 16px;
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.auth-brand {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.auth-brand-logo {
    height: 28px;
    width: auto;
    display: block;
}

.auth-subtitle {
    color: var(--ckk-muted);
    margin-bottom: 1.75rem;
}

.auth-footer {
    margin: 1.5rem 0 0;
    text-align: center;
    font-size: 0.8rem;
    color: var(--ckk-muted);
}

.auth-footer a {
    color: var(--ckk-muted);
    text-decoration: underline;
}

/* POS */
.pos-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.pos-products-pane {
    flex: 1 1 60%;
    min-width: 0;
}

.pos-search-bar {
    position: relative;
    margin-bottom: 0.75rem;
}

.pos-search-bar i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--ckk-muted);
}

.pos-search-bar input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.5rem;
    font-size: 1.05rem;
    border: 1px solid #e6d8c8;
    border-radius: 12px;
    background-color: var(--ckk-card);
}

.pos-search-bar input:focus {
    outline: none;
    border-color: var(--ckk-amber);
    box-shadow: 0 0 0 3px rgba(217, 140, 61, 0.2);
}

.pos-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pos-category-btn {
    border: 1px solid #e6d8c8;
    background-color: var(--ckk-card);
    color: var(--ckk-text);
    padding: 0.5rem 1.1rem;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.pos-category-btn.active {
    background-color: var(--ckk-brown);
    border-color: var(--ckk-brown);
    color: #fff;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.pos-product-card {
    background-color: var(--ckk-card);
    border: 1px solid #f0e5d8;
    border-radius: 14px;
    padding: 1rem 0.85rem;
    text-align: left;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(43, 27, 18, 0.06);
}

.pos-product-card:active {
    transform: scale(0.97);
}

.pos-product-card:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.pos-product-name {
    font-weight: 400;
    font-size: 1rem;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

.pos-product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.pos-product-price {
    font-weight: 700;
    color: var(--ckk-amber);
}

.pos-product-stock {
    color: var(--ckk-muted);
    font-size: 0.75rem;
}

.pos-product-stock.low {
    color: #c0392b;
    font-weight: 600;
}

@media (max-width: 900px) {
    .pos-categories {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.6rem;
    }

    .pos-category-btn {
        flex: 0 0 auto;
        touch-action: manipulation;
    }

    /* Menu-style list instead of a card grid — a name on the left, price
       (and stock) on the right, one product per row. Bigger, full-width
       rows are far easier to tap accurately than a cramped small-card
       grid. */
    .pos-product-grid {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .pos-product-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: auto;
        padding: 0.9rem 1rem;
        touch-action: manipulation;
    }

    /* Fixed 80/20 split (no row gap — the name's own padding-right gives
       breathing room) so the price/stock column always lands inside the
       viewport instead of depending on how much the name shrinks. */
    .pos-product-name {
        margin-bottom: 0;
        flex: 1 1 80%;
        max-width: 80%;
        min-width: 0;
        padding-right: 0.5rem;
    }

    .pos-product-meta {
        flex: 0 0 20%;
        max-width: 20%;
        min-width: 0;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.1rem;
    }
}

/* Cart */
.pos-cart-pane {
    flex: 0 0 380px;
    background-color: var(--ckk-card);
    border-radius: 16px;
    border: 1px solid #f0e5d8;
    box-shadow: 0 1px 3px rgba(43, 27, 18, 0.08);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 110px);
}

.pos-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #f0e5d8;
}

.pos-cart-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.pos-cart-items {
    flex: 1;
    overflow-y: auto;
    /* Horizontal padding matches .pos-cart-summary's 1.25rem below it —
       they were 1rem/1.25rem before, a few px out of step so item rows
       and summary rows didn't line up on either edge. */
    padding: 0.5rem 1.25rem;
    min-height: 120px;
}

.pos-cart-line {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid #f5ece0;
}

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

.pos-cart-line-name {
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.25;
    /* Wrap long names onto a second line instead of pushing the qty/price/
       remove controls around — clamped to 2 lines so one very long name
       still can't grow the row indefinitely. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pos-cart-line-price {
    color: var(--ckk-muted);
    font-size: 0.78rem;
}

.pos-cart-qty {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.pos-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #e6d8c8;
    background-color: #faf6f1;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.pos-qty-input {
    width: 46px;
    text-align: center;
    border: 1px solid #e6d8c8;
    border-radius: 6px;
    padding: 0.2rem;
    font-size: 0.85rem;
    -moz-appearance: textfield;
}

/* Redundant with the +/- buttons already next to this field. */
.pos-qty-input::-webkit-inner-spin-button,
.pos-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pos-cart-line-total {
    width: 64px;
    flex-shrink: 0;
    text-align: right;
    font-weight: 700;
    font-size: 0.9rem;
}

.pos-remove-btn {
    flex-shrink: 0;
    color: #c0392b;
    background: none;
    border: none;
    padding: 0 0.15rem;
}

.pos-cart-summary {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid #f0e5d8;
}

.pos-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.92rem;
    padding: 0.3rem 0;
}

.pos-discount-controls {
    display: flex;
    gap: 0.4rem;
    width: 60%;
}

.pos-total-row {
    font-size: 1.3rem;
    font-weight: 800;
    border-top: 1px dashed #e6d8c8;
    margin-top: 0.4rem;
    padding-top: 0.6rem;
}

.pos-payment {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    padding: 1rem 1.25rem 1.25rem;
}

.pos-tables-strip-wrap {
    margin-bottom: 0.9rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px dashed #e6d8c8;
}

.pos-tables-strip-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--ckk-muted);
    margin-bottom: 0.5rem;
}

.pos-tables-strip {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.6rem;
}

/* Thin, rounded, on-brand scrollbar — applied app-wide to every scrolling
   strip or panel, not just POS: dining tables, category tabs, the
   table-order popup, the sidebar nav, and every data table's
   .table-responsive wrapper (Bootstrap's own scroll container, used by
   every index page's table — sales, products, staff, etc.). Firefox via
   scrollbar-width/-color, WebKit/Blink via ::-webkit-*. The padding-bottom
   set on the individual scrollers (.pos-tables-strip, .pos-categories,
   .table-responsive below) is what gives the scrollbar breathing room
   from the content instead of sitting flush against it. */
.pos-tables-strip,
.pos-categories,
.pos-table-order-products,
.pos-cart-items,
.sidebar-nav,
.table-responsive {
    scrollbar-width: thin;
    scrollbar-color: var(--ckk-brown) transparent;
}

.pos-tables-strip::-webkit-scrollbar,
.pos-categories::-webkit-scrollbar,
.pos-table-order-products::-webkit-scrollbar,
.pos-cart-items::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar {
    height: 2px;
    width: 4px;
}

.pos-tables-strip::-webkit-scrollbar-track,
.pos-categories::-webkit-scrollbar-track,
.pos-table-order-products::-webkit-scrollbar-track,
.pos-cart-items::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.pos-tables-strip::-webkit-scrollbar-thumb,
.pos-categories::-webkit-scrollbar-thumb,
.pos-table-order-products::-webkit-scrollbar-thumb,
.pos-cart-items::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--ckk-brown);
    border-radius: 999px;
}

.pos-tables-strip::-webkit-scrollbar-button,
.pos-categories::-webkit-scrollbar-button,
.pos-table-order-products::-webkit-scrollbar-button,
.pos-cart-items::-webkit-scrollbar-button,
.sidebar-nav::-webkit-scrollbar-button,
.table-responsive::-webkit-scrollbar-button {
    display: none;
    width: 0;
    height: 0;
}

.table-responsive {
    padding-bottom: 0.6rem;
    /* .panel (its usual parent, via <div class="panel p-0">) rounds all
       four corners, but table cell backgrounds are square and sit flush
       against it — without clipping, they overhang past the curve, most
       visible on the top corners where the header row's background
       shows square edges against the panel's rounded ones. overflow-y:
       hidden clips that (the table has no vertical overflow to lose
       anyway) while overflow-x stays auto so horizontal scroll still
       works. */
    border-radius: 14px;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Table cells wrap their text by default, which — on a narrow screen —
   just squeezes every column down and wraps each cell across several
   lines instead of letting .table-responsive's horizontal scroll do its
   job, making the whole table look cramped. Forcing single-line cells
   makes the table keep its natural column widths and scroll horizontally
   instead, which is what the scrollbar above is actually for. */
.table-responsive table th,
.table-responsive table td {
    white-space: nowrap;
}

.pos-table-card {
    position: relative;
    flex: 0 0 auto;
    width: 120px;
    background-color: var(--ckk-card);
    border: 2px solid #f0e5d8;
    border-radius: 12px;
    padding: 0.6rem 0.65rem;
    text-align: left;
    min-height: 64px;
    box-shadow: 0 1px 3px rgba(43, 27, 18, 0.06);
    cursor: pointer;
}

.pos-table-card.status-available {
    border-color: #98d4a5;
}

.pos-table-card.status-occupied {
    border-color: #e08585;
    background-color: #fdf1f1;
}

.pos-table-card.status-reserved {
    border-color: #e6c568;
    background-color: #fdf8ea;
}

.pos-table-card.active {
    border-color: var(--ckk-brown);
    box-shadow: 0 0 0 2px var(--ckk-brown);
}

.pos-table-card-name {
    font-weight: 700;
    font-size: 0.9rem;
}

.pos-table-card-meta {
    color: var(--ckk-muted);
    font-size: 0.72rem;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.pos-table-card-free {
    position: absolute;
    top: 0.2rem;
    right: 0.3rem;
    font-size: 1rem;
    line-height: 1;
    color: #c0392b;
    background: none;
    border: none;
    padding: 0.1rem;
}

/* Table order popup — a self-contained mini-POS scoped to one table,
   independent of the counter cart below the page. */
.pos-table-order-layout {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.25rem;
    max-height: calc(100vh - 160px);
}

.pos-table-order-products {
    flex: 1 1 60%;
    min-width: 0;
    overflow-y: auto;
    max-height: calc(100vh - 200px);
}

.pos-table-order-cart {
    flex: 0 0 360px;
    background-color: var(--ckk-card);
    border-radius: 16px;
    border: 1px solid #f0e5d8;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 200px);
}

.pos-table-order-cart .pos-cart-items {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 1.25rem;
}

.pos-kot-action {
    padding: 0 1rem;
}

.pos-kot-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(217, 140, 61, 0.35);
    animation: pos-kot-pulse 1.8s ease-in-out infinite;
}

.pos-kot-btn .badge {
    font-size: 0.75em;
}

@keyframes pos-kot-pulse {
    0%, 100% { box-shadow: 0 2px 6px rgba(217, 140, 61, 0.35); }
    50% { box-shadow: 0 2px 12px rgba(217, 140, 61, 0.75); }
}

.pos-kot-uptodate {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: var(--ckk-muted);
    font-size: 0.82rem;
    margin: 0;
    padding: 0.45rem 0;
}

@media (max-width: 900px) {
    .pos-table-order-layout {
        flex-direction: column;
        /* Same fix as .pos-layout above: the desktop rule's align-items:
           flex-start is a vertical alignment there, but flex-direction:
           column makes it horizontal — left unreset, it shrinks
           .pos-table-order-products to its content width instead of
           stretching it to the modal's width. */
        align-items: stretch;
    }

    .pos-table-order-cart {
        flex-basis: auto;
        width: 100%;
    }
}

.pos-pay-btn {
    background-color: var(--ckk-amber);
    border: none;
    color: #2b1b12;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.85rem 0.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.pos-pay-btn:hover {
    background-color: var(--ckk-amber-light);
}

.pos-pay-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pos-receipt-preview {
    max-height: 220px;
    overflow-y: auto;
    background-color: #faf6f1;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
}

.pos-receipt-preview .pos-receipt-line {
    display: flex;
    justify-content: space-between;
    padding: 0.2rem 0;
}

.pos-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background-color: #2b1b12;
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2000;
    max-width: 90vw;
}

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

.pos-toast.error {
    background-color: #c0392b;
}

@media (max-width: 1199.98px) {
    .pos-cart-pane {
        flex-basis: 320px;
    }
}

/* Floating mobile cart bar — collapsed summary pill fixed at the bottom
   of the screen; tapping it (or the handle atop the cart pane) slides the
   full cart up as a bottom sheet. Hidden on desktop; the counter cart
   (.pos-cart-pane) and the table-order cart (.pos-table-order-cart) share
   this behavior since both apply the same mobile bottom-sheet pattern. */
.pos-mobile-cart-bar {
    display: none;
}

.pos-cart-mobile-handle {
    display: none;
}

.pos-cart-backdrop {
    display: none;
}

@media (max-width: 900px) {
    .pos-layout {
        flex-direction: column;
        /* The desktop rule's align-items: flex-start is a cross-axis
           (vertical) alignment there, but flex-direction: column makes
           the cross-axis horizontal — flex-start would then shrink each
           child to its content's width instead of stretching it to fill
           the screen, so a wide child (like the tables strip) balloons
           .pos-products-pane past the viewport and the whole page grows
           a horizontal scrollbar instead of just that child scrolling. */
        align-items: stretch;
    }

    .pos-cart-pane,
    .pos-table-order-cart {
        /* .pos-cart-pane's desktop rule sets position: sticky; top: 88px —
           left unset, that lingering top fights with bottom: 0 below and
           pins the sheet near the top of the screen instead of letting it
           slide fully off-screen. */
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: 82vh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -8px 30px rgba(43, 27, 18, 0.25);
        transform: translateY(calc(100% - 0px));
        transition: transform 0.25s ease;
        z-index: 1050;
    }

    .pos-cart-pane.pos-mobile-expanded,
    .pos-table-order-cart.pos-mobile-expanded {
        transform: translateY(0);
    }

    .pos-cart-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(43, 27, 18, 0.45);
        z-index: 1045;
    }

    .pos-cart-backdrop.show {
        display: block;
    }

    .pos-cart-mobile-handle {
        display: flex;
        justify-content: center;
        padding: 0.6rem 0 0.3rem;
        background: none;
        border: none;
        flex-shrink: 0;
    }

    .pos-cart-mobile-handle span {
        width: 40px;
        height: 5px;
        border-radius: 999px;
        background-color: #e6d8c8;
    }

    .pos-mobile-cart-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        background-color: var(--ckk-brown);
        color: #fff;
        border: none;
        border-radius: 14px;
        padding: 0.9rem 1.15rem;
        font-weight: 600;
        box-shadow: 0 8px 24px rgba(43, 27, 18, 0.35);
        z-index: 1040;
    }

    .pos-mobile-cart-bar-left,
    .pos-mobile-cart-bar-right {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    /* Name + role badge move into the sidebar (.sidebar-user, shown only
       below lg) so the mobile topbar has room to breathe — the store
       switcher stays here since it's an action, not just identity. */
    .topbar-user .user-name,
    .topbar-user .role-badge {
        display: none;
    }
}
