* {
    box-sizing: border-box
}

:root {
    --ink: #17212b;
    --muted: #718096;
    --line: #e5e8ec;
    --surface: #ffffff;
    --canvas: #f4f6f5;
    --sidebar: #18232b;
    --sidebar-soft: #22313a;
    --accent: #ef6a56;
    --accent-dark: #d95442;
    --mint: #2e9b83;
    --mint-soft: #e1f3ed;
    --button-bg: #eef1f2;
    --button-text: #17212b;
    --button-border: #d8dfe2;
    --info: #0476bd;
    --shadow: 0 12px 30px rgba(26, 42, 51, .07)
}

body.dark {
    --ink: #edf3f4;
    --muted: #9aabb0;
    --line: #34444b;
    --surface: #233139;
    --canvas: #121c21;
    --sidebar: #0d1519;
    --sidebar-soft: #263941;
    --button-bg: #30434b;
    --button-text: #f3f7f7;
    --button-border: #4a6068;
    --shadow: 0 12px 30px rgba(0, 0, 0, .24)
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--canvas);
    color: var(--ink)
}

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

.sidebar {
    width: 78px;
    background: var(--sidebar);
    color: #fff;
    padding: 22px 14px;
    position: fixed;
    height: calc(100vh - 72px);
    left: 0;
    top: 72px;
    transition: width .28s ease;
    z-index: 10
}

.sidebar.hidden {
    width: 0;
    padding-left: 0;
    padding-right: 0;
    overflow: hidden
}

.sidebar.expanded {
    width: 240px
}

.sidebar nav {
    display: grid;
    gap: 6px
}

.nav-btn {
    border: 0;
    background: transparent;
    color: #aebdc5;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    padding: 13px 14px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer
}

.nav-icon {
    flex: 0 0 22px;
    text-align: center;
    font-size: 17px
}

.nav-label {
    margin-left: 10px;
    white-space: nowrap;
    opacity: 1
}

.sidebar.collapsed .nav-btn {
    justify-content: center;
    padding-left: 10px;
    padding-right: 10px
}

.sidebar.collapsed .nav-label {
    display: none
}

.sidebar-toggle {
    display: grid;
    place-items: center;
    flex: 0 0 32px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
    transition: transform .18s ease, background .18s ease
}

.sidebar-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: scale(1.08)
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--sidebar-soft);
    box-shadow: inset 3px 0 var(--accent);
    color: white
}

.main {
    margin-left: 78px;
    width: calc(100% - 78px);
    height: 100vh;
    padding-top: 72px;
    transition: margin-left .28s ease, width .28s ease;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--line)
}

.main::-webkit-scrollbar {
    width: 8px
}

.main::-webkit-scrollbar-track {
    background: var(--line);
    border-radius: 999px
}

.main::-webkit-scrollbar-thumb {
    background: var(--accent);
    border: 2px solid var(--line);
    border-radius: 999px
}

.main::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark)
}

body.sidebar-hidden .main {
    margin-left: 0;
    width: 100%
}

body.sidebar-expanded .main {
    margin-left: 240px;
    width: calc(100% - 240px)
}

.topbar {
    height: 72px;
    background: rgba(255, 255, 255);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 28px;
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    top: 0;
    z-index: 5
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: auto
}

.topbar-title {
    margin-left: 20px;
    display: flex;
    align-items: center;
    text-align: left;
    line-height: 1.15;
    gap: 16px
}

.topbar-brand {
    padding-right: 16px;
    font-size: 4.25vh;
    font-weight: 800;
    line-height: 1;
    letter-spacing: .06em;
    white-space: nowrap
}

.topbar-brand span {
    font-weight: 400;
    color: #ff9b82
}

.topbar-title strong {
    font-size: 16px;
    letter-spacing: .02em
}

.topbar small {
    display: block;
    color: var(--muted);
    margin-top: 3px
}

.user-menu {
    position: relative
}

.user {
    border: 1px solid transparent;
    border-radius: 9px;
    padding: 9px 11px;
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease
}

.user:hover,
.user[aria-expanded="true"] {
    background: var(--surface);
    border-color: var(--line)
}

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 160px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
    z-index: 30;
    overflow: hidden;
    animation: dropdownIn .16s ease-out both
}

.user-dropdown.show {
    margin-top: 15px;
    display: grid
}

.user-dropdown button {
    border: 0;
    border-radius: 8px;
    padding: 10px 12px;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    font: inherit
}

.user-dropdown-header {
    display: grid;
    gap: 3px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--line)
}

.user-dropdown-header small {
    color: var(--muted);
    font-size: 11px
}

.user-dropdown-content {
    display: grid;
    gap: 2px;
    padding: 7px
}

.user-dropdown-footer {
    padding: 7px;
    border-top: 1px solid var(--line)
}

.user-dropdown .logout-button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    color: var(--accent-dark)
}

.user-dropdown .logout-button:hover {
    background: #fff0ec;
    color: var(--accent-dark)
}

.user-dropdown button:hover {
    background: var(--sidebar-soft);
    color: #fff
}

@keyframes dropdownIn {
    from {
        opacity: 0;
        transform: translateY(-5px) scale(.98)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: transform .18s ease, background .18s ease, color .18s ease
}

.theme-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: rotate(12deg)
}

.page {
    display: none;
    padding: 15px
}

.page.active {
    display: block;
    animation: pageSlideIn .28s ease-out both
}

@keyframes pageSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20%)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

.cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 22px
}

.card,
.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow)
}

.card small {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .08em;
    font-size: 11px;
    font-weight: 700
}

.card h2 {
    margin: 10px 0 0
}

.panel-head,
.page-actions,
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.panel-head h3 {
    margin: auto;
    margin-left: 5px;
}

.panel-head.co {
    border-bottom: 1px solid var(--line);
    padding-bottom: 5px;
}

.page-actions {
    margin-bottom: 20px
}

.page-actions h2 {
    margin: 0
}

.btn,
.checkout,
.text-btn {
    border: 1px solid var(--button-border);
    border-radius: 9px;
    padding: 10px 15px;
    cursor: pointer;
    font-weight: 600
}

.btn {
    background: var(--button-bg);
    color: var(--button-text)
}

.btn.primary,
.checkout {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff
}

.btn:hover,
.checkout:hover {
    transform: translateY(-1px);
    background: var(--accent-dark);
    border-color: var(--accent-dark)
}

.text-btn {
    background: none;
    border-color: transparent;
    color: var(--accent-dark)
}

.btn:disabled,
.checkout:disabled {
    background: var(--button-bg);
    border-color: var(--button-border);
    color: var(--muted);
    opacity: .6
}

.toolbar {
    justify-content: flex-start;
    margin-bottom: 18px
}

.toolbar input,
.toolbar select,
input {
    width: 100%;
    padding: 11px;
    border: 1px solid #d8dfe2;
    border-radius: 9px;
    outline: none;
    background: #fbfcfc;
    color: var(--ink)
}

input:focus,
select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(239, 106, 86, .14)
}

.toolbar input {
    max-width: 400px
}

.toolbar select {
    max-width: 190px
}

.pos-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 15px
}

.product-panel {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 92px;
    align-self: start;
    height: calc(100vh - 116px);
    min-height: 560px;
    max-height: calc(100vh - 116px);
    overflow: hidden
}

.product-grid {
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 3px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    direction: ltr;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--line);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px
}

.product-grid>* {
    direction: ltr
}

.product-grid::-webkit-scrollbar {
    width: 8px
}

.product-grid::-webkit-scrollbar-track {
    background: var(--line);
    border-radius: 999px
}

.product-grid::-webkit-scrollbar-thumb {
    background: var(--accent);
    border: 2px solid var(--line);
    border-radius: 999px
}

.product-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark)
}

.product-grid>.empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 300px;
    padding: 24px
}

.product-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: auto;
    padding-top: 20px
}

.product-pagination .btn:disabled {
    cursor: not-allowed;
    opacity: .5
}

.product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 135px;
    min-width: 150px;
    height: 135px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    background: #fff;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease
}

.product-card:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 18px rgba(239, 106, 86, .12);
    transform: translateY(-2px)
}

.product-card strong {
    display: block;
    font-weight: 500;
    margin-bottom: 7px
}

.price {
    margin-top: 4px;
    color: var(--accent-dark)
}

.price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.stock {
    color: var(--mint);
    font-size: 11px;
}

.stock.low {
    color: var(--accent-dark)
}

.stock-category {
    margin-top: auto;
    padding-top: 14px;
    color: var(--muted);
    font-size: 12px
}

.cart-panel {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 92px;
    align-self: start;
    height: calc(100vh - 116px);
    min-height: 560px;
    max-height: calc(100vh - 116px);
    background: #fffdfb;
    overflow: hidden
}

.cart-head-actions {
    display: flex;
    align-items: center;
    gap: 8px
}

.cart-view-toggle {
    display: none;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--button-border);
    border-radius: 7px;
    background: var(--button-bg);
    color: var(--button-text);
    cursor: pointer;
    font-size: 18px;
    line-height: 1
}

.cart-view-toggle:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff
}

.cart-modal-backdrop {
    display: none
}

body.cart-modal-open {
    overflow: hidden
}

.cart-modal-backdrop.show {
    display: block;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(18, 29, 35, .58);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 14
}

.cart-panel.is-modal {
    position: fixed;
    margin-top: 15px;
    top: 15px;
    right: 15px;
    bottom: 15px;
    left: 15px;
    width: auto;
    height: 80vh;
    min-height: 0;
    max-height: none;
    z-index: 15;
    border-radius: 16px;
    box-shadow: 0 22px 60px rgba(10, 20, 24, .32)
}

.cart-items {
    padding-right: 10px;
    padding-left: 10px;
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    direction: ltr;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--line)
}

.cart-items::-webkit-scrollbar {
    width: 8px
}

.cart-items::-webkit-scrollbar-track {
    background: var(--line);
    border-radius: 999px
}

.cart-items::-webkit-scrollbar-thumb {
    background: var(--accent);
    border: 1px solid var(--line);
    border-radius: 999px
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dark)
}

.cart-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-bottom: .50px solid #bebebe;
    direction: ltr
}

.delete-cart-item {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    margin-right: 2px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 20px;
    line-height: 1
}

.delete-cart-item:hover {
    border-color: var(--accent);
    background: #fff0ec;
    color: var(--accent-dark)
}

.confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px
}

.confirm-actions .btn {
    min-width: 110px
}

.confirm-actions .danger {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff
}

.confirm-actions .danger:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark)
}

.cart-row strong {
    font-weight: 500;
    font-size: 15px;
}

.cart-info {
    min-width: 0
}

.cart-info strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.cart-actions {
    display: flex;
    min-width: 82px;
    align-items: flex-end;
    flex-direction: column;
    gap: 7px
}

.cart-actions>strong {
    color: var(--accent-dark);
    white-space: nowrap
}

.cart-row small {
    display: block;
    color: var(--muted);
    padding-top: 5px;
}

.qty button {
    border: 1px solid #d8dfe2;
    background: #fff;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    cursor: pointer
}

.qty {
    display: flex;
    align-items: center;
    gap: 5px
}

.qty span {
    min-width: 16px;
    text-align: center;
    font-size: 13px
}

.qty button:hover {
    border-color: var(--accent);
    color: var(--accent-dark)
}

.totals {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 16px
}

.totals>div {
    display: flex;
    justify-content: space-between;
    margin: 8px 0
}

.grand {
    font-size: 15px;
    color: var(--accent-dark);

    /* border: 1px solid var(--accent);
    border-radius: 12px;

 
    margin-top: 10px;
    padding: 10px; */
}

.checkout {
    width: 100%;
    margin-top: 15px;
    padding: 14px
}

table {
    width: 100%;
    border-collapse: collapse
}

th,
td {
    text-align: left;
    padding: 13px;
    border-bottom: 1px solid var(--line)
}

tbody tr:hover {
    background: #fff8f5
}

th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .07em
}

.badge {
    padding: 5px 9px;
    border-radius: 20px;
    background: var(--mint-soft);
    color: #237862;
    font-size: 12px
}

.empty {
    padding: 50px;
    text-align: center;
    color: var(--muted)
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px
}

.form-grid label {
    font-size: 13px;
    font-weight: 600
}

.form-grid input {
    display: block;
    margin-top: 7px
}

.full {
    width: 100%;
    margin-top: 20px
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(18, 29, 35, .58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 20;
    animation: modalBackdropIn .22s ease-out both
}

.modal.show {
    display: flex
}

.modal-box {
    background: var(--surface);
    border-radius: 16px;
    padding: 25px;
    width: min(500px, 92%);
    position: relative;
    box-shadow: inset 3px 0 var(--accent);
    animation: modalPanelIn .28s cubic-bezier(.22, 1, .36, 1) both
}

.table-session-modal {
    width: min(540px, calc(100% - 32px));
    max-height: min(720px, calc(100vh - 32px));
    overflow-y: auto;
}

.table-session-modal>h2 {
    margin: 0 0 22px;
    padding-right: 28px;
    font-size: 22px;
}

.table-session-modal>label,
.table-session-modal .table-mode-fields label {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.table-session-modal input,
.table-session-modal select {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--button-border);
    border-radius: 10px;
    background: var(--button-bg);
    color: var(--button-text);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.table-session-modal input[readonly] {
    background: var(--line);
    color: var(--muted);
}

.table-session-modal input:focus,
.table-session-modal select:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(239, 106, 86, .14);
    outline: none;
}

.table-session-modal .table-mode-fields {
    margin: 16px 0 2px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--canvas) 72%, var(--surface));
}

.table-session-modal .full {
    min-height: 44px;
    margin-top: 18px;
}

.modal-note {
    margin: -8px 0 18px;
    color: var(--muted);
    line-height: 1.5;
}

.tournament-checkout-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding: 15px;
    border: 1px solid var(--accent);
    border-radius: 12px;
    background: var(--surface);
    color: var(--muted);
}

.tournament-checkout-summary strong {
    color: var(--accent-dark);
    font-size: 20px;
}

@media (max-width: 560px) {
    .table-session-modal {
        width: calc(100% - 20px);
        max-height: calc(100vh - 20px);
        padding: 18px;
    }

    .table-session-modal .table-mode-fields {
        padding: 12px;
    }
}



.modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 34px 18px 0;
    border-bottom: 1px solid var(--line)
}

.modal-header h2 {
    margin: 0;
    font-size: 20px
}

.modal-header small {
    display: block;
    margin-top: 4px;
    color: var(--muted)
}

.modal-content {
    padding: 20px 0 4px;
    color: var(--ink)
}

.modal-content p {
    line-height: 1.5;
    margin: 0 0 14px
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 18px;
    border-top: 1px solid var(--line)
}

.modal-footer .full {
    margin-top: 0
}

.modal-icon {
    display: grid;
    flex: 0 0 42px;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #e5efff;
    color: #2563c7;
    font-size: 22px;
    font-weight: 800
}

@keyframes modalBackdropIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes modalPanelIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(.97)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

@media (prefers-reduced-motion: reduce) {

    .page,
    .modal,
    .modal-box {
        animation: none
    }
}

.message-box {
    width: min(430px, 92%)
}

.message-box .modal-header {
    padding: 0 34px 18px 0;
}

.message-box .modal-content {
    padding-top: 16px
}

.message-box .modal-content p {
    white-space: pre-line
}

.message-box.success .modal-icon {
    background: var(--mint-soft);
    color: var(--mint)
}

.message-box.danger .modal-icon,
.message-box.confirm .modal-icon {
    background: #fff0ec;
    color: var(--accent-dark)
}

.message-box.danger .modal-footer .btn.primary {
    background: var(--accent);
    border-color: var(--accent)
}

.message-box.success .modal-footer .btn.primary {

    background: var(--mint);
    border-color: var(--mint)
}

.close {
    position: absolute;
    right: 16px;
    top: 12px;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 28px;
    cursor: pointer
}

.payment-methods {
    display: flex;
    gap: 8px;
    margin: 18px 0
}

.pay {
    flex: 1;
    padding: 11px;
    border: 1px solid var(--button-border);
    background: var(--button-bg);
    color: var(--button-text);
    border-radius: 7px;
    cursor: pointer
}

.pay.active {
    background: var(--mint);
    border-color: var(--mint);
    color: #fff
}

.modal-box label {
    font-size: 13px;
    font-weight: 600
}

.modal-box input {
    display: block;
    margin-top: 7px
}

.table-wrap {
    overflow: auto;
    border-radius: 10px
}

.table-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px
}

.table-toolbar input {
    max-width: 360px
}

.table-action {
    padding: 7px 11px;
    font-size: 12px
}

.table-action:hover {
    background: var(--accent);
    color: #fff
}

@media(max-width:900px) {
    .sidebar {
        width: 64px;
        padding-left: 8px;
        padding-right: 8px
    }

    .sidebar.expanded {
        width: 220px
    }

    .sidebar.hidden {
        width: 0
    }

    .main,
    body.sidebar-collapsed .main {
        margin-left: 64px;
        width: calc(100% - 64px)
    }

    body.sidebar-expanded .main {
        margin-left: 220px;
        width: calc(100% - 220px)
    }

    body.sidebar-hidden .main {
        margin-left: 0;
        width: 100%
    }

    .cards {
        grid-template-columns: repeat(2, 1fr)
    }

    .pos-layout {
        grid-template-columns: 1fr
    }

    .cart-panel {
        position: static;
        height: auto;
        min-height: 560px;
        max-height: none
    }

    .product-panel {
        position: static;
        height: auto;
        min-height: 560px;
        max-height: none
    }

    .product-grid {
        flex: none;
        max-height: none;
        overflow: visible;
        grid-template-columns: repeat(3, 1fr)
    }

    .toolbar {
        flex-wrap: wrap
    }

    .toolbar input,
    .toolbar select,
    .toolbar .btn {
        max-width: none;
        flex: 1 1 180px
    }

    .product-card strong {
        font-size: 15px
    }

    .cart-view-toggle {
        display: grid
    }

    .product-panel {
        height: 50vh;
        min-height: 0;
        max-height: 50vh
    }


}


@media(max-width:1400px) and (orientation: landscape) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr)
    }
}

@media(max-width:1200px) and (orientation: landscape) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media(max-width:1000px) and (orientation: landscape) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr)
    }
}


@media(max-width:900px) and (orientation: portrait) {
    .cart-panel {
        height: auto;
        min-height: 27vh;
        max-height: 29vh
    }

    .product-panel {
        height: auto;
        max-height: 58vh
    }

    .product-grid {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
        overflow-x: hidden
    }
}

@media(max-width:650px) and (orientation: portrait) {
    .cart-panel {
        height: auto;
        min-height: 27vh;
        max-height: 29vh
    }

    .product-panel {
        height: auto;
        max-height: 58vh
    }

    .product-card {
        padding: 10px;
        min-height: 100px;
        height: 100px;
        min-width: 136px;
        width: auto
    }

    .product-card strong {
        margin-bottom: 0;
        font-size: 13px
    }

    .price {
        font-size: 14px
    }

    .stock-category {
        padding-top: 0
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .totals {
        margin-top: auto
    }

    .barcode-input {
        display: none
    }

    .btnscn {
        display: none
    }

}


@media(max-width:560px) and (orientation: portrait) {
    .page {
        padding: 16px
    }

    .cards,
    .form-grid {
        grid-template-columns: 1fr
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr)
    }

    .product-card strong {
        font-size: 15px
    }

    .topbar {
        padding: 0 16px
    }

    .page-actions,
    .panel-head {
        align-items: flex-start;
        flex-wrap: wrap;

    }

    .card,
    .panel {
        padding: 10px
    }

    .table-toolbar input {
        max-width: none
    }

    .cart-panel {
        height: auto;
        min-height: 27vh;
        max-height: 27vh;
    }

}

.barcode-input {
    max-width: 180px !important
}

.scanner-box {
    max-width: 560px
}

.scanner-help {
    color: #64748b
}

.scanner-box video {
    width: 100%;
    height: 280px;
    object-fit: cover;
    background: #111827;
    border-radius: 10px;
    margin: 10px 0
}

#barcodeReader {
    width: 100%;
    margin: 10px 0
}

#barcodeReader video {
    width: 100% !important;
    height: 280px !important;
    object-fit: cover
}

body.dark .topbar {
    background: rgba(35, 49, 57)
}

body.dark .product-card,
body.dark .qty button,
body.dark .pay,
body.dark input,
body.dark select {
    background: #1d2a31;
    color: var(--ink)
}

body.dark .cart-panel {
    background: #202e35
}

body.dark tbody tr:hover {
    background: #2b3b42
}

body.dark .message-mark {
    background: #4b2e2b
}

body.dark .scanner-status {
    background: #1d2a31;
    color: var(--muted)
}

.scanner-status {
    padding: 10px;
    background: #f1f5f9;
    border-radius: 7px;
    margin-bottom: 12px;
    font-size: 13px
}

/* Billiard table management */
.billiard-toolbar {
    display: flex;
    gap: 16px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.billiard-toolbar label {
    min-width: 180px;
}

.table-mode-fields {
    display: grid;
    gap: 12px;
}

.billiard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.billiard-card {
    border: 1px solid var(--border, #ddd);
    border-radius: 16px;
    padding: 18px;
    background: var(--panel, #fff);
    box-shadow: 0 4px 14px rgba(0, 0, 0, .05);
}

.billiard-card.available {
    border-left: 6px solid #16a34a;
}

.billiard-card.playing {
    border-left: 6px solid #f59e0b;
}

.billiard-card.reserved {
    border-left: 6px solid #6366f1;
}

.billiard-card h3 {
    margin: 0 0 8px;
}

.table-status {
    display: inline-block;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.status-available {
    background: #dcfce7;
    color: #166534;
}

.status-playing {
    background: #fef3c7;
    color: #92400e;
}

.status-reserved {
    background: #e0e7ff;
    color: #3730a3;
}

.table-timer {
    font-size: 25px;
    font-weight: 800;
    margin: 12px 0;
    letter-spacing: 1px;
}

.table-info {
    display: grid;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 12px;
}

.table-info strong {
    color: var(--accent-dark)
}

.table-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.table-actions button {
    flex: 1;
    min-width: 90px;
}

.billiard-card .btn {
    min-height: 40px;
}

.hidden {
    display: none !important;
}

.cart-info small {
    line-height: 1.4
}