:root {
    --brand-primary: #7b1e2b;
    --brand-primary-2: #611722;
    --brand-accent: #b54758;
    --brand-dark: #1d1f23;
    --brand-bg: #f4f6fa;
    --brand-surface: #ffffff;
    --brand-border: #e3e8f1;
    --brand-muted: #6f7785;
    --brand-success: #1f9d68;
    --brand-warning: #d68a1f;
    --brand-danger: #c63d4d;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --shadow-sm: 0 8px 18px rgba(25, 30, 38, 0.06);
    --shadow-md: 0 15px 35px rgba(25, 30, 38, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Tajawal', 'Cairo', sans-serif;
    background: linear-gradient(180deg, #f9fbff 0%, #f3f6fb 38%, #eef2f8 100%);
    color: #1f252d;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 300px 1fr;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
}
.app-shell.sidebar-collapsed .app-sidebar {
    display: none;
}

.app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    padding: .9rem;
    border-left: 1px solid rgba(255,255,255,.12);
    background:
        radial-gradient(circle at 100% 0%, rgba(255,255,255,.07), transparent 30%),
        linear-gradient(170deg, #231017 0%, #401722 46%, #6d1d2c 100%);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: var(--radius-md);
    background: rgba(255,255,255,.08);
    color: #fff;
    margin-bottom: .85rem;
}

.sidebar-brand h5 { font-weight: 800; }
.sidebar-brand small { opacity: .85; }

.brand-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 12px;
    background: #fff;
    padding: 4px;
}

.sidebar-nav {
    display: grid;
    gap: .55rem;
}

.sidebar-group {
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    background: rgba(255,255,255,.04);
    overflow: hidden;
}

.sidebar-group > summary {
    list-style: none;
    cursor: pointer;
    padding: .62rem .75rem;
    font-weight: 700;
    color: rgba(255,255,255,.92);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-group > summary::-webkit-details-marker { display: none; }

.sidebar-group-links {
    display: grid;
    gap: .18rem;
    padding: .4rem;
}

.sidebar-nav .nav-link {
    color: rgba(255,255,255,.94);
    text-decoration: none;
    padding: .56rem .65rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid transparent;
    transition: .16s ease;
    font-size: .94rem;
}

.sidebar-nav .nav-link:hover {
    background: rgba(255,255,255,.13);
    border-color: rgba(255,255,255,.2);
}

.sidebar-nav .nav-link.active {
    background: rgba(255,255,255,.96);
    color: var(--brand-primary);
    font-weight: 800;
    border-color: rgba(255,255,255,.9);
}

.sidebar-nav .nav-link-pos {
    background: linear-gradient(120deg, #bf4a5b, var(--brand-primary));
    color: #fff;
}
.sidebar-nav .nav-link-pos.active {
    background: #fff;
    color: var(--brand-primary);
}

.app-main { min-width: 0; }

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    padding: .65rem .95rem;
    border-bottom: 1px solid var(--brand-border);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(6px);
}

.header-start,
.header-end {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.header-title {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.header-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--brand-border);
    padding: 3px;
    object-fit: contain;
}

.header-title h1 {
    margin: 0;
    font-weight: 800;
    font-size: 1.08rem;
}

.header-title small {
    color: var(--brand-muted);
    font-size: .82rem;
}

.header-quick {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.quick-link {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    text-decoration: none;
    color: #374150;
    background: #f3f6fb;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: .38rem .65rem;
    font-size: .86rem;
}

.quick-link.active,
.quick-link:hover {
    background: rgba(123,30,43,.1);
    color: var(--brand-primary);
    border-color: rgba(123,30,43,.24);
}

.header-chip {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--brand-border);
    background: #fff;
    color: #2f3540;
    text-decoration: none;
    display: grid;
    place-items: center;
    position: relative;
}

.header-chip span {
    position: absolute;
    left: -5px;
    top: -5px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    background: var(--brand-primary);
    color: #fff;
    font-size: .72rem;
    display: grid;
    place-items: center;
    border: 2px solid #fff;
}

.header-chip-btn {
    cursor: pointer;
    padding: 0;
}

.header-chip-btn.is-muted {
    background: #f2f4f8;
    color: #7f8794;
}

.header-chip-btn.is-enabled {
    background: rgba(31, 157, 104, .14);
    border-color: rgba(31, 157, 104, .38);
    color: #0f7c52;
}

.header-mobile-menu-btn {
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 12px;
    display: inline-grid;
    place-items: center;
    border-width: 2px;
    color: #263447;
    border-color: #aebccc;
    background: #f6f9fd;
}

.header-mobile-menu-btn .bi {
    font-size: 1.18rem;
    line-height: 1;
}

.header-mobile-menu-btn:hover,
.header-mobile-menu-btn:focus {
    color: #172537;
    border-color: #8ea3ba;
    background: #edf3fa;
}

.header-user {
    display: flex;
    align-items: center;
    gap: .45rem;
    background: #f3f6fb;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    padding: .23rem .48rem .23rem .23rem;
}

.role-badge {
    background: rgba(123,30,43,.12);
    color: var(--brand-primary);
    border-radius: 999px;
    padding: .14rem .45rem;
    font-size: .78rem;
    font-weight: 700;
}

.app-content {
    min-height: calc(100vh - 76px);
    padding-top: .9rem !important;
    padding-bottom: 1rem !important;
}

.app-card {
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--brand-surface);
    box-shadow: var(--shadow-sm);
}

.app-card .card-header {
    background: linear-gradient(120deg, #fff, #f5f8fe);
    border-bottom: 1px solid var(--brand-border);
    color: #2d3541;
    font-weight: 800;
}

.kpi-card {
    border-radius: var(--radius-lg);
    padding: .95rem;
    color: #fff;
    background: linear-gradient(130deg, var(--brand-primary), var(--brand-primary-2));
    box-shadow: var(--shadow-md);
    min-height: 118px;
}
.kpi-card h3, .kpi-card h4 {
    margin: .28rem 0;
    font-weight: 800;
}
.kpi-card p { margin: 0; opacity: .88; }
.kpi-gold { background: linear-gradient(130deg, #b47a1d, #e2aa4a); color: #2f230f; }
.kpi-dark { background: linear-gradient(130deg, #262b35, #333c4a); }
.kpi-brown { background: linear-gradient(130deg, #7f2938, #9c3a4d); }

.mini-stat {
    border: 1px solid var(--brand-border);
    border-radius: var(--radius-md);
    background: #fff;
    padding: .72rem;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: .2rem;
}
.mini-stat small { color: var(--brand-muted); }
.mini-stat strong { font-size: 1.25rem; line-height: 1; }
.mini-stat.warning { border-color: rgba(214,138,31,.25); background: #fff8eb; }
.mini-stat.success { border-color: rgba(31,157,104,.25); background: #f1fcf7; }
.mini-stat.danger { border-color: rgba(198,61,77,.25); background: #fff2f4; }
.mini-stat.dark { border-color: rgba(38,43,53,.25); background: #f3f5f9; }

.notification-item {
    border: 1px solid var(--brand-border);
    border-right-width: 5px;
    border-radius: 12px;
    padding: .7rem;
    margin-bottom: .6rem;
    background: #fff;
}
.notification-item h6 { margin: 0 0 .25rem; }
.notification-item p { margin: 0; color: #556073; }
.notification-item.priority-high { border-right-color: var(--brand-danger); }
.notification-item.priority-medium { border-right-color: var(--brand-warning); }
.notification-item.priority-low { border-right-color: var(--brand-success); }

.form-control,
.form-select {
    border-radius: 11px;
    border: 1px solid #dce3ef;
    box-shadow: none !important;
}
.form-control:focus,
.form-select:focus {
    border-color: rgba(123,30,43,.45);
    box-shadow: 0 0 0 3px rgba(123,30,43,.12) !important;
}

.btn {
    border-radius: 11px;
    font-weight: 700;
}
.btn-primary {
    background: linear-gradient(120deg, var(--brand-primary), #8d2738);
    border: 0;
}
.btn-primary:hover { filter: brightness(.95); }
.btn-danger { background: #b92f42; border-color: #b92f42; }
.btn-success { background: #1f9d68; border-color: #1f9d68; }
.btn-warning { color: #2d2a24; }

.alert {
    border-radius: 12px;
    border: 1px solid transparent;
}
.alert-success { background: #eefbf5; border-color: #c5efd9; color: #13643f; }
.alert-danger { background: #fff1f3; border-color: #f7c7ce; color: #8e2734; }

.preview-logo, .thumb-40 {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 10px;
    background: #f3f3f3;
    border: 1px solid #eee;
}
.thumb-40 { width: 40px; height: 40px; }

.table {
    --bs-table-striped-bg: #f8fbff;
    --bs-table-hover-bg: #f3f8ff;
}
.table > :not(caption) > * > * {
    border-bottom-color: #e5eaf3;
}

.toast-stack {
    position: fixed;
    left: 16px;
    bottom: 16px;
    z-index: 1200;
    display: grid;
    gap: .55rem;
}

.app-toast {
    min-width: 260px;
    max-width: 360px;
    border-radius: 12px;
    color: #fff;
    padding: .68rem .75rem;
    box-shadow: var(--shadow-md);
    animation: toastIn .18s ease;
}
.app-toast.success { background: linear-gradient(120deg, #158f5d, #1fa56c); }
.app-toast.warning { background: linear-gradient(120deg, #c78520, #dc9a33); color: #2e250e; }
.app-toast.danger { background: linear-gradient(120deg, #ab2f40, #c53f52); }
.app-toast.info { background: linear-gradient(120deg, #3b475a, #525f73); }

.online-order-alert-host {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1300;
    width: min(720px, 96vw);
    display: grid;
    gap: .5rem;
    pointer-events: none;
}

.program-lock-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: #fff;
    display: grid;
    place-items: center;
    padding: 0;
}

.program-unlock-panel {
    display: grid;
    place-items: center;
}

.program-unlock-start-btn {
    width: 124px;
    height: 124px;
    border-radius: 999px;
    border: 0;
    display: grid;
    place-items: center;
    gap: .2rem;
    color: #fff;
    background: linear-gradient(135deg, #1b8a5b, #24a86f);
    box-shadow: 0 14px 30px rgba(20, 117, 79, .35);
    font-weight: 800;
}

.program-unlock-start-btn i {
    font-size: 2.2rem;
    line-height: 1;
}

.program-unlock-start-btn span {
    font-size: .95rem;
    line-height: 1;
}

.online-order-banner {
    pointer-events: auto;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.35);
    border-right: 8px solid #ffe08a;
    background: linear-gradient(125deg, #952034, #b9374c 60%, #d6563f 100%);
    color: #fff;
    box-shadow: 0 20px 35px rgba(97, 22, 34, .36);
    padding: .8rem .95rem;
    animation: onlineOrderAlertIn .2s ease;
}

.online-order-banner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin-bottom: .2rem;
}

.online-order-banner-title {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
}

.online-order-banner-time {
    opacity: .92;
    font-size: .82rem;
}

.online-order-banner-message {
    margin: 0;
    font-size: .95rem;
    line-height: 1.55;
    font-weight: 500;
}

.online-order-banner-close {
    border: 0;
    border-radius: 999px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    background: rgba(255,255,255,.2);
    color: #fff;
}

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

@keyframes toastIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.mobile-nav-list {
    display: grid;
    gap: .42rem;
}

#sidebarCanvas {
    --bs-offcanvas-width: min(90vw, 360px);
}

#sidebarCanvas .offcanvas-header {
    border-bottom: 1px solid #dde4f0;
    background: linear-gradient(120deg, #fff, #f3f7fe);
}

#sidebarCanvas .offcanvas-title {
    font-weight: 800;
    color: #243447;
}

#sidebarCanvas .offcanvas-body {
    background: #f7f9fd;
    padding-bottom: calc(.8rem + env(safe-area-inset-bottom));
}

.mobile-menu {
    padding: .3rem;
}

.mobile-group-title {
    margin: .32rem .12rem .1rem;
    font-size: .76rem;
    color: #6a7484;
    font-weight: 800;
}

.mobile-nav-list .btn {
    width: 100%;
    min-height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .45rem;
    text-align: right;
    font-size: .9rem;
    font-weight: 700;
    padding: .52rem .62rem;
}

.mobile-nav-list .btn i {
    width: 1.1rem;
    text-align: center;
}

.mobile-nav-list .mobile-nav-logout {
    margin-top: .35rem;
}
.mobile-nav-list .btn.active {
    border-color: rgba(123,30,43,.35);
    color: var(--brand-primary);
    background: rgba(123,30,43,.08);
}

/* Login */
.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        radial-gradient(circle at 0% 0%, rgba(193, 64, 83, .34), transparent 30%),
        radial-gradient(circle at 100% 100%, rgba(88, 34, 44, .30), transparent 28%),
        linear-gradient(160deg, #130f16 0%, #34121b 45%, #4d1826 100%);
}

.login-card {
    width: min(760px, 96vw);
    background: rgba(255,255,255,.97);
    border-radius: 24px;
    padding: 2.2rem;
    box-shadow: 0 30px 50px rgba(0,0,0,.32);
}

.login-logo {
    width: 190px;
    height: 190px;
    object-fit: contain;
    background: #fff;
    border-radius: 28px;
    padding: 12px;
    box-shadow: 0 10px 22px rgba(18, 20, 26, .16);
}

.login-brand h2 {
    font-size: 2rem;
    font-weight: 800;
}

.btn-login {
    background: linear-gradient(120deg, var(--brand-primary), #9b3145);
    color: #fff;
    border: 0;
}

/* POS */
.pos-shell {
    display: grid;
    grid-template-columns: minmax(360px, 27%) 1fr;
    gap: .75rem;
    min-height: calc(100vh - 135px);
}

.pos-left,
.pos-right { min-width: 0; }

.pos-shell.has-hall-panel {
    grid-template-columns: minmax(340px, 24%) minmax(0, 1fr) minmax(320px, 30%);
}

.pos-hall-panel {
    min-width: 0;
    border-radius: 18px;
    overflow: hidden;
    position: sticky;
    top: 84px;
    height: calc(100vh - 102px);
    display: flex;
    flex-direction: column;
    animation: hallPanelIn .2s ease;
}

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

.pos-toolbar {
    border-radius: var(--radius-lg);
    position: sticky;
    top: 84px;
    z-index: 60;
}
.pos-search {
    min-width: 300px;
    font-size: 1rem;
}

.pos-toolbar .card-body {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) auto;
    gap: .55rem;
}

.toolbar-search-wrap {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: wrap;
}

.pos-toolbar .toolbar-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: .7rem;
    margin: .75rem 0;
}

.category-card {
    border: 1px solid #dce4ef;
    border-radius: 16px;
    background: linear-gradient(170deg, #fff, #f4f8ff);
    display: grid;
    place-items: center;
    gap: .3rem;
    padding: .65rem;
    min-height: 170px;
    transition: transform .14s ease, box-shadow .14s ease;
    box-shadow: 0 8px 15px rgba(23, 34, 45, .06);
    cursor: grab;
}
.category-card:hover { transform: translateY(-1px); box-shadow: 0 11px 19px rgba(23, 34, 45, .09); }
.category-card:active { transform: scale(.98); }
.category-card.is-dragging {
    opacity: .65;
    cursor: grabbing;
}
.category-card.drag-over {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, .18);
}

.category-card img {
    width: 100%;
    max-width: 128px;
    height: 88px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid #e4ebf6;
    background: #fff;
}

.category-card span {
    font-weight: 800;
    color: #2a3340;
    text-align: center;
}

.category-card small {
    color: #6d7582;
    font-size: .78rem;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .7rem;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}
.products-grid.list-view .product-card {
    min-height: 110px;
    display: grid;
    grid-template-columns: 130px 1fr;
}
.products-grid.list-view .product-image {
    height: 100%;
}

.product-card {
    border-radius: 16px;
    border: 1px solid #e0e7f3;
    background: #fff;
    min-height: 190px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .14s ease;
    user-select: none;
    touch-action: manipulation;
}
.product-card:active { transform: scale(.98); }

.product-image {
    height: 106px;
    width: 100%;
    object-fit: cover;
    background: linear-gradient(120deg,#f4f8ff,#eef3fb);
}

.product-body {
    padding: .45rem .55rem .6rem;
    display: grid;
    gap: .2rem;
}

.product-title {
    font-weight: 800;
    line-height: 1.24;
    font-size: .95rem;
}

.product-meta {
    font-size: .79rem;
    color: #68707f;
    display: flex;
    justify-content: space-between;
}

.product-category-chip {
    display: inline-block;
    padding: .08rem .42rem;
    border-radius: 999px;
    border: 1px solid #d7deea;
    background: #f5f8ff;
    color: #374558;
    font-size: .72rem;
    font-weight: 700;
}

.product-size-row {
    display: flex;
    gap: .24rem;
    flex-wrap: wrap;
    margin-top: .08rem;
}

.product-size-chip {
    display: inline-block;
    padding: .05rem .38rem;
    border-radius: 999px;
    border: 1px solid #b9c4d7;
    background: #fff;
    color: #374558;
    font-size: .68rem;
    line-height: 1.35;
    font-weight: 700;
}

.product-price {
    color: var(--brand-primary);
    font-weight: 800;
    font-size: 1rem;
}

.pos-right {
    border-radius: 18px;
    overflow: hidden;
    position: sticky;
    top: 84px;
    height: calc(100vh - 102px);
    display: flex;
    flex-direction: column;
}

.hall-panel-head {
    padding: .55rem .7rem;
}

.hall-panel-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.hall-tabs-wrap,
.hall-filters-wrap {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.hall-tabs-wrap .btn {
    border-radius: 999px;
    font-weight: 800;
    min-height: 38px;
}

.hall-tabs-wrap .btn.active {
    background: linear-gradient(120deg, var(--brand-primary), #943144);
    color: #fff;
    border-color: transparent;
}

.hall-filters-wrap .btn {
    border-radius: 999px;
    font-weight: 700;
}

.hall-summary {
    background: #f4f8ff;
    border: 1px solid #dde5f2;
    border-radius: 11px;
    padding: .45rem .6rem;
}

.hall-units-grid {
    flex: 1 1 auto;
    min-height: 220px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: .45rem;
    align-content: start;
    padding-inline-end: .1rem;
}

.hall-unit-card {
    border: 1px solid #dce3ef;
    background: #fff;
    border-radius: 13px;
    min-height: 118px;
    padding: .55rem .5rem;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: .15rem;
    text-align: center;
    transition: transform .14s ease, box-shadow .14s ease, border-color .18s ease, background-color .18s ease;
    box-shadow: 0 7px 16px rgba(22, 30, 39, .06);
}

.hall-unit-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 11px 18px rgba(22, 30, 39, .1);
}

.hall-unit-card:active {
    transform: scale(.98);
}

.hall-unit-card .hall-icon {
    font-size: 1.3rem;
    line-height: 1;
    color: #516074;
}

.hall-unit-card .hall-number {
    font-weight: 800;
    font-size: 1.05rem;
    color: #243141;
}

.hall-unit-card .hall-zone {
    font-size: .73rem;
    color: #6d7889;
    line-height: 1.2;
}

.hall-unit-card .hall-status {
    font-size: .76rem;
    font-weight: 800;
    border-radius: 999px;
    padding: .18rem .45rem;
    justify-self: center;
}

.hall-unit-card .hall-merge {
    font-size: .68rem;
    color: #4f5d72;
    line-height: 1.2;
}

.hall-unit-card.status-empty {
    background: #fff;
    border-color: #dce3ef;
}

.hall-unit-card.status-empty .hall-status {
    background: #f1f4f9;
    color: #3f4e61;
}

.hall-unit-card.status-reserved {
    background: #fff2f4;
    border-color: rgba(198, 61, 77, .45);
}

.hall-unit-card.status-reserved .hall-status {
    background: #c63d4d;
    color: #fff;
}

.hall-unit-card.status-busy {
    background: #ecf9f3;
    border-color: rgba(31, 157, 104, .45);
}

.hall-unit-card.status-busy .hall-status {
    background: #1f9d68;
    color: #fff;
}

.hall-unit-card.hall-updated {
    animation: hallStatusPulse .3s ease;
}

@keyframes hallStatusPulse {
    0% { transform: scale(.96); }
    100% { transform: scale(1); }
}

.hall-unit-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}

.hall-unit-modal-content {
    animation: hallModalIn .16s ease;
}

@keyframes hallModalIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.hall-unit-meta-item {
    border: 1px solid #dde5f2;
    border-radius: 11px;
    background: #f9fbff;
    padding: .45rem;
}

.hall-unit-meta-item small {
    display: block;
    color: #6c788b;
    margin-bottom: .08rem;
}

.hall-unit-meta-item strong {
    color: #273445;
}

.hall-unit-actions {
    justify-content: center;
}

.hall-unit-actions .btn {
    min-width: 120px;
}

.hall-merge-list {
    display: grid;
    gap: .35rem;
}

.hall-merge-item {
    border: 1px solid #dce4f1;
    border-radius: 11px;
    padding: .5rem .6rem;
    background: #fff;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.hall-merge-item label {
    margin: 0;
    flex: 1 1 auto;
}

.hall-merge-item.is-disabled {
    opacity: .6;
    background: #f5f7fb;
}

.hall-board-shell {
    display: grid;
    gap: .55rem;
}

.hall-board-toolbar .card-body {
    min-height: 64px;
}

.hall-board-tabs,
.hall-board-filters {
    display: flex;
    gap: .35rem;
    flex-wrap: wrap;
}

.hall-board-tabs .btn {
    border-radius: 999px;
    font-weight: 800;
    min-height: 40px;
}

.hall-board-tabs .btn.active {
    background: linear-gradient(130deg, #3b4d66 0%, #25364c 100%);
    border-color: #25364c;
    color: #fff;
}

.hall-board-filters .btn {
    border-radius: 999px;
    min-height: 36px;
    font-weight: 700;
}

.hall-refresh-select {
    width: 92px;
}

.hall-board-legend .card-body {
    min-height: 52px;
}

.hall-legend-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: .25rem .7rem;
    font-size: .8rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.hall-legend-pill.is-empty {
    color: #29405e;
    background: linear-gradient(135deg, #f8fbff 0%, #e7f0ff 100%);
    border-color: #b6cff7;
}

.hall-legend-pill.is-reserved {
    color: #fff;
    background: linear-gradient(135deg, #ff6f7f 0%, #d94456 100%);
    border-color: #b53545;
}

.hall-legend-pill.is-busy {
    color: #fff;
    background: linear-gradient(135deg, #27b96e 0%, #138a52 100%);
    border-color: #0e7745;
}

.hall-board-grid-wrap .card-body {
    min-height: calc(100vh - 240px);
}

.hall-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(148px, 148px));
    justify-content: center;
    gap: .72rem;
    align-content: start;
}

.hall-board-card {
    min-height: 150px;
    border-radius: 16px;
    border-width: 2px;
    padding: .64rem .52rem;
    box-shadow: 0 12px 22px rgba(17, 23, 33, .09);
}

.hall-board-card .hall-card-icon-wrap {
    width: 46px;
    height: 46px;
    margin: 0 auto .3rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .62);
    border: 1px solid rgba(255,255,255,.75);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.hall-board-card.type-tent .hall-card-icon-wrap {
    background: linear-gradient(145deg, rgba(33, 97, 180, .25), rgba(16, 56, 122, .12));
    border-color: rgba(29, 78, 153, .34);
}

.hall-board-card.type-table .hall-card-icon-wrap {
    background: linear-gradient(145deg, rgba(236, 151, 54, .28), rgba(207, 117, 24, .14));
    border-color: rgba(193, 108, 15, .34);
}

.hall-svg-icon {
    width: 30px;
    height: 30px;
    display: block;
}

.hall-svg-icon .icon-surface {
    fill: currentColor;
    opacity: .25;
}

.hall-svg-icon .icon-surface-soft {
    fill: currentColor;
    opacity: .12;
}

.hall-svg-icon .icon-door,
.hall-svg-icon .icon-leg {
    fill: currentColor;
    opacity: .55;
}

.hall-svg-icon .icon-accent {
    fill: currentColor;
    opacity: .38;
}

.hall-svg-icon .icon-line {
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .84;
}

.hall-board-card .hall-number {
    font-size: 1.16rem;
    font-variant-numeric: tabular-nums;
}

.hall-board-card .hall-zone {
    min-height: 2.2em;
    line-height: 1.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hall-board-card .hall-status {
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.15);
}

.hall-board-card .hall-alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    border-radius: 999px;
    padding: .13rem .42rem;
    font-size: .63rem;
    font-weight: 800;
    color: #7f2f00;
    background: rgba(255, 198, 104, .36);
    border: 1px solid rgba(198, 129, 49, .45);
    margin-top: .16rem;
}

.hall-board-card.status-empty {
    color: #314d73;
    background: linear-gradient(145deg, #ffffff 0%, #edf4ff 100%);
    border-color: #9fc0f3;
}

.hall-board-card.status-empty .hall-status {
    background: #dfeeff;
    color: #2e4f7a;
}

.hall-board-card.status-reserved {
    color: #7f1d2b;
    background: linear-gradient(145deg, #ffe8eb 0%, #ffd3d9 100%);
    border-color: #f07a8b;
    box-shadow: 0 12px 20px rgba(223, 77, 96, .22);
}

.hall-board-card.status-reserved .hall-status {
    background: linear-gradient(145deg, #eb4d61 0%, #ce3347 100%);
    color: #fff;
}

.hall-board-card.status-busy {
    color: #0d5b36;
    background: linear-gradient(145deg, #e1f9ec 0%, #c8f1dc 100%);
    border-color: #50c38b;
    box-shadow: 0 12px 20px rgba(24, 164, 97, .22);
}

.hall-board-card.status-busy .hall-status {
    background: linear-gradient(145deg, #22ad6a 0%, #148a51 100%);
    color: #fff;
}

.hall-board-card.status-busy .hall-card-icon-wrap {
    animation: hallBusyGlow 1.2s ease-in-out infinite alternate;
}

.hall-admin-wrap .card-header {
    border-bottom: 1px solid #e3e9f3;
}

.hall-admin-search {
    width: 230px;
}

.hall-admin-type-filter {
    width: 170px;
}

.hall-admin-table th,
.hall-admin-table td {
    white-space: nowrap;
    vertical-align: middle;
}

.hall-admin-table td:nth-child(2),
.hall-admin-table td:nth-child(4) {
    max-width: 220px;
    white-space: normal;
}

.hall-admin-table .hall-admin-status {
    border-radius: 999px;
    font-size: .7rem;
    font-weight: 800;
    padding: .14rem .45rem;
}

.hall-admin-table .hall-admin-status.status-empty {
    color: #2e4f7a;
    background: #dfeeff;
}

.hall-admin-table .hall-admin-status.status-reserved {
    color: #fff;
    background: #ce3347;
}

.hall-admin-table .hall-admin-status.status-busy {
    color: #fff;
    background: #148a51;
}

.hall-admin-alert-flags .form-check-label {
    font-size: .86rem;
    font-weight: 700;
}

@keyframes hallBusyGlow {
    from { box-shadow: 0 0 0 rgba(34, 173, 106, 0); }
    to { box-shadow: 0 0 14px rgba(34, 173, 106, .42); }
}

.pos-right > .card-header {
    flex: 0 0 auto;
    padding: .5rem .7rem;
}

.pos-right > .card-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: auto;
}

.pos-right > .card-body > .p-3.border-bottom {
    flex: 0 0 auto;
    padding: .5rem .65rem !important;
    gap: .35rem !important;
}

.delivery-fields {
    border: 1px solid #e6d8db;
    background: #fff8f9;
    border-radius: 12px;
    padding: .6rem;
}

.hall-order-context {
    border: 1px solid #d9e4f6;
    background: linear-gradient(145deg, #f8fbff 0%, #eef4ff 100%);
    border-radius: 12px;
    padding: .48rem .58rem;
}

.hall-order-context-title {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    font-size: .79rem;
    font-weight: 800;
    color: #2d4566;
    margin-bottom: .35rem;
}

.hall-order-context-body {
    display: flex;
    flex-wrap: wrap;
    gap: .34rem;
}

.hall-context-chip {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .16rem .58rem;
    font-size: .73rem;
    font-weight: 800;
    color: #2d4566;
    background: #ffffff;
    border: 1px solid #c8d8f3;
}

.hall-order-context-alert {
    margin-top: .35rem;
    font-size: .74rem;
    color: #b34a12;
    font-weight: 700;
}

.cart-list {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: none;
    overflow: auto;
    padding: .5rem;
}

.pos-summary-bar {
    flex: 0 0 auto;
    background: #fff;
    position: static;
    z-index: auto;
    padding: .5rem .65rem !important;
}

.pos-actions-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .3rem;
}

.cart-item {
    border: 1px solid #e0e7f3;
    background: #fbfdff;
    border-radius: 12px;
    padding: .38rem .45rem;
    margin-bottom: .35rem;
}

.cart-item-head {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    align-items: start;
}

.cart-item-main {
    flex: 1 1 auto;
    min-width: 0;
}

.cart-item-text {
    min-width: 0;
}

.cart-item-name {
    font-weight: 700;
    word-break: break-word;
}
.cart-item-note { font-size: .8rem; color: #7f3a46; }

.qty-controls {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .35rem;
    flex-wrap: wrap;
}

.qty-controls .qty-step-btn {
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--brand-primary);
    color: #fff;
    font-size: .95rem;
}

.qty-value-btn {
    min-width: 52px;
    min-height: 30px;
    border-radius: 8px;
    border: 1px solid #d4dceb;
    background: #fff;
    color: #2e3542;
    font-weight: 800;
    font-size: .84rem;
    padding: 0 .3rem;
}

.btn-pay {
    background: linear-gradient(120deg, var(--brand-primary), #a23145);
    color: #fff;
    border: 0;
    min-height: 54px;
}

.pos-action-compact {
    min-height: 34px;
    min-width: 34px;
    padding: .2rem .25rem;
    font-size: .8rem;
    line-height: 1.15;
    font-weight: 700;
    border-radius: 8px;
}

.pos-right .form-label {
    font-size: .78rem;
    margin-bottom: .2rem !important;
}

.pos-right .form-select,
.pos-right .form-control {
    min-height: 34px;
    padding-top: .25rem;
    padding-bottom: .25rem;
    font-size: .86rem;
}

.pos-summary-bar .py-1 {
    padding-top: .12rem !important;
    padding-bottom: .12rem !important;
    font-size: .9rem;
}

.pos-summary-bar hr {
    margin: .35rem 0;
}

.btn-print-mini {
    min-height: 44px !important;
    font-size: .93rem;
    padding: .42rem .7rem;
}

.btn-print-mini .bi,
.btn-print-mini i,
.btn .bi-printer,
.btn .bi-printer-fill {
    font-size: .9rem;
}

.payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.payment-btn {
    min-height: 46px;
    min-width: 110px;
    font-weight: 700;
}

.payment-btn.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

#paymentModal .payment-modal-dialog {
    max-width: 560px;
}

#paymentModal .modal-content {
    max-height: 86vh;
}

#paymentModal .modal-header {
    padding: .55rem .75rem;
}

#paymentModal .modal-body {
    padding: .65rem .75rem;
    overflow-y: auto;
}

#paymentModal .row.g-3 {
    --bs-gutter-x: .55rem;
    --bs-gutter-y: .55rem;
}

#paymentModal .form-label {
    margin-bottom: .2rem;
    font-size: .82rem;
}

#paymentModal .form-control,
#paymentModal .form-select {
    min-height: 34px;
    font-size: .9rem;
    padding: .25rem .55rem;
}

#paymentModal .form-control-lg {
    min-height: 38px;
    padding: .3rem .55rem;
    font-size: .95rem;
}

.touch-numpad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .35rem;
}

.touch-numpad button {
    min-height: 50px;
    border: 0;
    border-radius: 10px;
    background: #edf3fb;
    font-size: 1.2rem;
    font-weight: 700;
}

#paymentModal .touch-numpad button {
    min-height: 38px;
    font-size: .95rem;
}

#paymentModal .modal-footer {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: .5rem .75rem;
    border-top: 1px solid #e3e8f2;
    z-index: 1;
}

#paymentModal .modal-footer .btn {
    min-height: 38px;
    padding: .35rem .65rem;
    font-size: .88rem;
}

#paymentModal .alert {
    padding: .45rem .6rem;
    font-size: .84rem;
}

#hallClosePreviewModal .hall-close-preview-dialog {
    max-width: 560px;
}

#hallClosePreviewModal .modal-body {
    max-height: 72vh;
    overflow-y: auto;
}

#hallClosePreviewModal .table th,
#hallClosePreviewModal .table td {
    font-size: .88rem;
}

#networkPaymentModal .network-payment-dialog {
    max-width: 520px;
}

.network-receipt-preview {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    margin-top: .5rem;
    border: 1px solid var(--brand-border);
    border-radius: 10px;
    background: #f9fbff;
    padding: .25rem;
}

@media (max-width: 576px) {
    #paymentModal .modal-content {
        max-height: 100vh;
    }
    #paymentModal .touch-numpad button {
        min-height: 34px;
        font-size: .9rem;
    }
}

.touch-number-display {
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: .03em;
}

.touch-number-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .35rem;
}

.touch-number-grid button {
    min-height: 56px;
    border: 0;
    border-radius: 12px;
    background: #edf3fb;
    color: #2a3340;
    font-weight: 800;
    font-size: 1.15rem;
}

.touch-number-grid .touch-number-done {
    background: var(--brand-primary);
    color: #fff;
}

.touch-quick-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.touch-quick-buttons .btn {
    min-height: 42px;
    font-weight: 700;
}

.modal-footer .btn {
    min-height: 44px;
}

.quick-notes {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}
.quick-notes .btn {
    min-height: 42px;
    font-weight: 700;
}

.pos-help-list {
    display: grid;
    gap: .55rem;
}

.pos-help-item {
    border: 1px solid #e0e7f3;
    background: #f8fbff;
    border-radius: 12px;
    padding: .55rem .65rem;
    line-height: 1.55;
}

.pos-mobile-actions {
    display: none;
}

/* Public Menu + QR */
.menu-public-shell {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem .8rem 2rem;
}

.menu-public-header {
    text-align: center;
    padding: 1rem .8rem;
    border: 1px solid #dfd7db;
    border-radius: 18px;
    background: linear-gradient(140deg, #fff, #f8f4f5);
    margin-bottom: 1rem;
}

.menu-public-logo {
    width: 86px;
    height: 86px;
    object-fit: contain;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e7dadd;
    padding: 4px;
    margin-bottom: .45rem;
}

.menu-public-header h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.menu-public-header p {
    margin: .2rem 0 .8rem;
    color: #6e7787;
}

.menu-public-search-wrap {
    max-width: 420px;
    margin: 0 auto;
}

.menu-public-section {
    margin-bottom: 1rem;
}

.menu-public-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    margin-bottom: .6rem;
}

.menu-public-section-head h2 {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 800;
}

.menu-public-section-head span {
    color: #6e7685;
    font-size: .9rem;
}

.menu-public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: .65rem;
}

.menu-public-card {
    border: 1px solid #e2e8f2;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.menu-public-card img {
    width: 100%;
    height: 108px;
    object-fit: cover;
    background: #f5f8fd;
}

.menu-public-body {
    padding: .55rem;
}

.menu-public-body h3 {
    margin: 0 0 .3rem;
    font-size: .95rem;
    font-weight: 700;
}

.menu-public-body strong {
    color: var(--brand-primary);
    font-size: .95rem;
}

/* Online Ordering Frontend */
.guest-body {
    background:
        radial-gradient(circle at 0% 0%, rgba(123, 30, 43, .08), transparent 35%),
        radial-gradient(circle at 100% 100%, rgba(43, 74, 123, .07), transparent 34%),
        #f6f8fc;
}

.online-shell {
    max-width: 1220px;
    margin: 0 auto;
    padding: 1rem .75rem 5.8rem;
}

.online-header-card {
    border: 1px solid #e2e8f4;
    background: linear-gradient(125deg, #ffffff, #f8fafc);
    border-radius: 18px;
    padding: .85rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
}

.online-branding {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.online-brand-logo {
    width: 78px;
    height: 78px;
    border-radius: 14px;
    border: 1px solid #e2e7f2;
    background: #fff;
    object-fit: contain;
    padding: 4px;
}

.online-branding h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
}

.online-branding p {
    margin: .2rem 0 0;
    color: #657084;
    font-size: .92rem;
}

.online-header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-wrap: wrap;
}

.online-cart-badge {
    position: absolute;
    top: -7px;
    left: -8px;
    min-width: 21px;
    height: 21px;
    border-radius: 999px;
    border: 2px solid #fff;
    display: grid;
    place-items: center;
    font-size: .72rem;
    font-weight: 800;
    background: #12151a;
    color: #fff;
}

.online-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.online-category-chips .chip {
    border: 1px solid #dce4f2;
    border-radius: 999px;
    text-decoration: none;
    color: #2e3746;
    background: #fff;
    padding: .35rem .62rem;
    font-size: .86rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
}

.online-category-chips .chip small {
    color: #6f7a8a;
}

.online-category-chips .chip.active,
.online-category-chips .chip:hover {
    border-color: rgba(123, 30, 43, .32);
    background: rgba(123, 30, 43, .08);
    color: var(--brand-primary);
}

.online-products-grid {
    display: grid;
    gap: .75rem;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.online-product-card {
    border: 1px solid #dee6f2;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    display: grid;
    box-shadow: var(--shadow-sm);
}

.online-product-link {
    display: block;
}

.online-product-link img {
    width: 100%;
    height: 145px;
    object-fit: cover;
    background: #eff4fb;
}

.online-product-body {
    padding: .62rem;
}

.online-product-body h3 {
    margin: 0 0 .35rem;
    font-size: 1rem;
    min-height: 42px;
}

.online-product-body h3 a {
    color: #232d3a;
    text-decoration: none;
}

.online-product-card.is-disabled {
    opacity: .72;
}

.online-price {
    color: var(--brand-primary);
    font-weight: 800;
    font-size: 1.06rem;
}

.online-floating-cart {
    display: none;
    position: fixed;
    bottom: max(.7rem, env(safe-area-inset-bottom));
    left: .7rem;
    right: .7rem;
    min-height: 54px;
    border-radius: 14px;
    background: linear-gradient(115deg, var(--brand-primary), #942c3f);
    color: #fff;
    text-decoration: none;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .62rem .9rem;
    box-shadow: 0 14px 26px rgba(123, 30, 43, .34);
    z-index: 1020;
}

.online-floating-cart span {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 700;
}

.online-floating-cart b {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .18);
    display: grid;
    place-items: center;
    font-size: .9rem;
}

.online-product-hero {
    width: 100%;
    max-height: 390px;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid #e1e8f3;
    background: #edf3fb;
}

.online-option-list {
    display: grid;
    gap: .45rem;
}

.online-option-item {
    border: 1px solid #dfe7f2;
    border-radius: 12px;
    background: #fff;
    padding: .45rem .6rem;
    display: flex;
    align-items: center;
    gap: .45rem;
}

.online-cart-item {
    border: 1px solid #e0e8f2;
    background: #fbfdff;
    border-radius: 13px;
    padding: .48rem;
    margin-bottom: .55rem;
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: .52rem;
}

.online-cart-item img {
    width: 86px;
    height: 86px;
    border-radius: 12px;
    object-fit: cover;
    background: #edf2fa;
}

.online-cart-item h3 {
    margin: 0;
    font-size: .98rem;
}

.online-sticky-card {
    position: sticky;
    top: 88px;
}

.online-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .7rem;
}

.online-timeline li {
    border-right: 4px solid rgba(123, 30, 43, .26);
    padding-right: .6rem;
    display: grid;
    gap: .15rem;
    background: #fff;
}

.online-timeline strong {
    font-size: .96rem;
}

.online-timeline span {
    color: #5d687b;
    font-size: .88rem;
}

.online-timeline small {
    color: #8690a0;
}

/* Kitchen */
.kitchen-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: .8rem;
}

.kitchen-ticket {
    border: 1px solid var(--brand-border);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    display: grid;
    gap: .55rem;
    padding: .75rem;
}
.kitchen-ticket header,
.kitchen-ticket footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    flex-wrap: wrap;
}

.kitchen-item-row {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .25rem 0;
    border-bottom: 1px dashed #e8edf6;
    flex-wrap: wrap;
}
.kitchen-item-row:last-child { border-bottom: 0; }

.kitchen-qty-badge {
    min-width: 58px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.kq-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    direction: ltr;
}

.kq-mixed-int {
    font-weight: 700;
}

.kq-frac {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    line-height: 1;
}

.kq-top,
.kq-bottom {
    font-size: 11px;
}

.kq-line {
    font-size: 10px;
    line-height: 1;
}

/* Mobile table transform */
@media (max-width: 980px) {
    .app-shell {
        min-height: 100dvh;
    }

    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { display: none; }
    .app-header {
        top: 0;
        z-index: 1040;
        min-height: 66px;
        padding: calc(.45rem + env(safe-area-inset-top)) .65rem .45rem;
        gap: .55rem;
    }
    .header-start {
        flex: 1 1 auto;
        min-width: 0;
    }
    .header-title {
        min-width: 0;
        gap: .42rem;
    }
    .header-title h1 {
        font-size: .96rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 48vw;
    }
    .header-title small {
        display: none;
    }
    .header-logo {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }
    .header-end .header-chip {
        display: none;
    }
    .header-end { gap: .3rem; }
    .header-user {
        border-radius: 10px;
        padding: .15rem .2rem .15rem .15rem;
        gap: .3rem;
        background: #fff;
    }
    .header-user .role-badge {
        display: none;
    }
    .header-user strong { display: none; }
    .header-user .btn {
        min-height: 34px;
        padding: .2rem .55rem;
        border-radius: 8px;
    }

    .pos-shell {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .pos-shell.has-hall-panel {
        grid-template-columns: 1fr;
    }

    .pos-shell.mobile-mode #catalogPanel,
    .pos-shell.mobile-mode #orderPanel {
        display: none;
    }
    .pos-shell.mobile-mode #catalogPanel.mobile-active,
    .pos-shell.mobile-mode #orderPanel.mobile-active {
        display: block;
    }

    #catalogPanel { order: 1; }
    #orderPanel { order: 2; }
    #hallPanel { order: 3; }

    .pos-hall-panel {
        position: fixed;
        top: 72px;
        right: 0;
        left: 0;
        bottom: 76px;
        height: auto;
        border-radius: 0;
        z-index: 1080;
    }

    .hall-units-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-toolbar {
        position: sticky;
        top: 66px;
        z-index: 80;
    }

    .pos-toolbar .form-control,
    .pos-toolbar .form-select,
    .pos-toolbar .btn {
        min-width: 100%;
    }
    .pos-toolbar .card-body {
        grid-template-columns: 1fr;
    }
    .toolbar-search-wrap {
        display: grid;
        grid-template-columns: 1fr;
    }
    .pos-toolbar .toolbar-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pos-right {
        position: static;
        height: auto;
    }

    .pos-right > .card-body {
        display: block;
        overflow: visible;
    }

    .cart-list {
        min-height: 0;
        max-height: 46vh;
    }

    .pos-summary-bar {
        position: static;
    }

    .pos-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .products-grid,
    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-card {
        min-height: 155px;
        padding: .55rem;
    }

    .category-card img { height: 78px; }

    .table-mobile-cards thead { display: none; }
    .table-mobile-cards,
    .table-mobile-cards tbody,
    .table-mobile-cards tr,
    .table-mobile-cards td {
        display: block;
        width: 100%;
    }

    .table-mobile-cards tr {
        border: 1px solid var(--brand-border);
        padding: .55rem;
        margin-bottom: .4rem;
        background: #fff;
        border-radius: 10px;
    }

    .table-mobile-cards td {
        border: 0;
        padding: .2rem 0;
    }

    .table-mobile-cards td::before {
        content: attr(data-label);
        font-weight: 700;
        color: #4f5662;
        margin-left: .4rem;
    }

    .pos-mobile-actions {
        display: flex;
        align-items: stretch;
        gap: .38rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        position: fixed;
        right: .5rem;
        left: .5rem;
        bottom: max(.45rem, env(safe-area-inset-bottom));
        z-index: 1100;
        background: rgba(255, 255, 255, .95);
        border: 1px solid #dce3ef;
        border-radius: 16px;
        padding: .4rem;
        box-shadow: 0 16px 30px rgba(16, 23, 33, .17);
        backdrop-filter: blur(8px);
    }

    .mobile-action-btn {
        flex: 0 0 78px;
        border: 1px solid #d5deeb;
        border-radius: 12px;
        background: #fff;
        color: #243447;
        min-height: 58px;
        padding: .32rem .2rem;
        display: grid;
        place-items: center;
        gap: .08rem;
        font-weight: 700;
        font-size: .76rem;
        line-height: 1.1;
    }

    .mobile-action-btn i {
        font-size: 1rem;
        color: #243447;
    }

    .mobile-action-btn b {
        font-size: .72rem;
        color: #4b5b71;
        font-weight: 800;
    }

    .mobile-action-btn.is-active {
        border-color: rgba(123,30,43,.4);
        background: rgba(123,30,43,.11);
        color: var(--brand-primary);
    }
    .mobile-action-btn.is-active i,
    .mobile-action-btn.is-active b {
        color: var(--brand-primary);
    }

    .mobile-action-btn.mobile-action-pay {
        border-color: rgba(123,30,43,.4);
        background: linear-gradient(120deg, rgba(123,30,43,.13), rgba(123,30,43,.2));
    }
    .mobile-action-btn.mobile-action-pay i {
        color: #7b1e2b;
    }

    .app-content {
        padding-bottom: 6.6rem !important;
    }

    .online-floating-cart {
        display: flex;
    }

    .hall-board-toolbar .card-body {
        gap: .55rem !important;
    }

    .hall-admin-wrap .card-header {
        gap: .45rem !important;
    }

    .hall-admin-search {
        width: 100%;
    }

    .hall-admin-type-filter {
        width: 100%;
    }

    .hall-board-grid-wrap .card-body {
        min-height: auto;
    }

    .hall-board-grid {
        grid-template-columns: repeat(2, minmax(132px, 1fr));
        justify-content: stretch;
        gap: .56rem;
    }

    .hall-board-card {
        min-height: 136px;
    }
}

@media (max-width: 576px) {
    .login-card {
        width: min(100%, 96vw);
        padding: 1.25rem;
    }

    .login-logo {
        width: 145px;
        height: 145px;
        border-radius: 20px;
    }

    .login-brand h2 { font-size: 1.35rem; }

    .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .product-card { min-height: 165px; }
    .product-image { height: 78px; }

    .btn,
    .form-control,
    .form-select { min-height: 44px; }

    .kpi-card { min-height: 105px; }

    .app-content {
        padding-left: .5rem !important;
        padding-right: .5rem !important;
    }

    .header-chip {
        width: 34px;
        height: 34px;
    }

    .modal-footer .btn {
        flex: 1 1 auto;
    }

    .mobile-action-btn {
        min-height: 54px;
        font-size: .71rem;
    }

    .mobile-action-btn i {
        font-size: .95rem;
    }

    .mobile-action-btn b {
        font-size: .68rem;
    }

    .hall-unit-actions .btn {
        min-width: auto;
    }

    .hall-board-tabs .btn,
    .hall-board-filters .btn {
        min-height: 40px;
    }

    .hall-board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-content: stretch;
        gap: .42rem;
    }

    .hall-board-card {
        min-height: 122px;
        padding: .5rem .42rem;
    }

    .hall-order-context-body {
        flex-direction: column;
        gap: .25rem;
    }

    .hall-board-card .hall-card-icon-wrap {
        width: 40px;
        height: 40px;
        margin-bottom: .2rem;
    }

    .hall-svg-icon {
        width: 25px;
        height: 25px;
    }

    .hall-board-card .hall-number {
        font-size: 1.03rem;
    }

    .menu-public-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .online-shell {
        padding-bottom: 6rem;
    }

    .online-header-card {
        padding: .65rem;
    }

    .online-brand-logo {
        width: 60px;
        height: 60px;
    }

    .online-branding h1 {
        font-size: 1.1rem;
    }

    .online-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .online-product-link img {
        height: 118px;
    }

    .online-product-body h3 {
        font-size: .92rem;
        min-height: 38px;
    }

    .online-floating-cart {
        min-height: 50px;
    }

    .online-cart-item {
        grid-template-columns: 72px 1fr;
    }

    .online-cart-item img {
        width: 72px;
        height: 72px;
    }

    .online-sticky-card {
        position: static;
    }
}
