:root {
    --bg: #f4f5f7;
    --surface: #ffffff;
    --sidebar: #1f2933;
    --sidebar-text: #d9e2ec;
    --sidebar-muted: #9aa5b1;
    --accent: #2f6f5e;
    --accent-hover: #275c4e;
    --text: #1f2933;
    --muted: #616e7c;
    --border: #d9e2ec;
    --error: #b42318;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
    --radius: 8px;
    --sidebar-width: 210px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 13px;
    line-height: 1.4;
}

a {
    color: inherit;
}

.guest-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-shell {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}

.auth-brand h1 {
    margin: 10px 0 4px;
    font-size: 1.35rem;
    font-weight: 650;
}

.auth-brand p {
    margin: 0;
    color: var(--muted);
}

.brand-mark {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 6px 8px;
    border-radius: 4px;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.field {
    display: grid;
    gap: 4px;
    font-size: 0.82rem;
}

.field span {
    color: var(--muted);
}

.field input,
.field select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 9px;
    font: inherit;
    background: #fff;
}

.field input:focus,
.field select:focus {
    outline: 2px solid #c6dfd6;
    border-color: var(--accent);
}

.error {
    color: var(--error);
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
}

.btn-primary {
    appearance: none;
    border: 0;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.app-body {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    background: var(--sidebar);
    color: var(--sidebar-text);
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
}

.brand-text {
    font-weight: 650;
    font-size: 0.88rem;
}

.nav {
    display: grid;
    gap: 4px;
}

.nav-link {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    padding: 7px 8px;
    border-radius: 6px;
    color: var(--sidebar-text);
    font-size: 0.82rem;
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.9;
}

.nav-link.is-active {
    background: #334e41;
    color: #fff;
}

.nav-link.is-active .nav-icon {
    opacity: 1;
}

.nav-link.is-disabled {
    color: var(--sidebar-muted);
    cursor: default;
}

.nav-link em {
    font-style: normal;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.app-main {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.app-credit {
    position: fixed;
    right: 14px;
    bottom: 8px;
    z-index: 15;
    margin: 0;
    font-size: 0.72rem;
    color: var(--muted);
    pointer-events: none;
}

.app-credit a {
    pointer-events: auto;
    color: inherit;
    text-decoration: none;
}

.app-credit a:hover {
    color: var(--accent);
    text-decoration: underline;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
}

.topbar-title {
    font-weight: 650;
    font-size: 0.95rem;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--muted);
    font-size: 0.82rem;
}

.btn-link {
    appearance: none;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    font: inherit;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
}

.btn-link:hover {
    background: var(--bg);
}

.menu-btn {
    display: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    background: #fff;
}

.content {
    padding: 16px 16px 32px;
}

.finance-summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px;
    margin: 0;
    min-width: 0;
    scroll-margin-top: 12px;
}

.finance-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.finance-head h2 {
    margin: 0;
    color: var(--accent);
    font-size: 1.05rem;
    font-weight: 700;
}

.finance-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
}

.finance-filter label {
    display: grid;
    gap: 4px;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.finance-filter input {
    min-width: 0;
    width: 132px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
    border-radius: 6px;
    padding: 7px 10px;
    font: inherit;
}

.finance-refresh {
    appearance: none;
    border: 0;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
}

.finance-refresh:hover {
    background: var(--accent-hover);
}

.finance-refresh:disabled {
    opacity: 0.7;
    cursor: wait;
}

.finance-error {
    margin: 0 0 10px;
    color: #b42318;
    font-size: 0.82rem;
}

.finance-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
}

.finance-cards .info-box {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
}

.finance-cards .info-box-body {
    padding: 8px 6px;
}

.finance-cards .info-box-body strong {
    font-size: 0.82rem;
    word-break: break-word;
}

.finance-cards .info-box-body span {
    font-size: 0.65rem;
    margin-top: 2px;
}

.finance-pl {
    display: block;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 16px;
}

.info-box {
    position: relative;
    color: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 112px;
    box-shadow: var(--shadow);
}

.info-box-body {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 12px;
    position: relative;
    z-index: 1;
}

.info-box-body strong {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}

.info-box-body span {
    display: block;
    font-size: 0.78rem;
    opacity: 0.92;
    margin-top: 3px;
}

.info-box-body em {
    display: block;
    font-style: normal;
    font-size: 0.68rem;
    opacity: 0.82;
    margin-top: 8px;
}

.info-box-cmp {
    text-align: right;
}

.info-box-cmp strong {
    font-size: 1.05rem;
}

.info-box-more {
    margin-top: auto;
    background: rgba(0, 0, 0, 0.14);
    color: #fff;
    text-decoration: none;
    padding: 7px 14px;
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.info-box-more::after {
    content: "›";
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-size: 0.9rem;
}

.info-box-more:hover {
    background: rgba(0, 0, 0, 0.22);
}

.info-box.is-red {
    background: #dd4b39;
}

.info-box.is-green {
    background: #00a65a;
}

.info-box.is-orange {
    background: #f39c12;
}

.info-box.is-blue {
    background: #3c8dbc;
}

.info-box.is-cyan {
    background: #00c0ef;
}

.info-box.is-purple {
    background: #605ca8;
}

.info-box.is-profit {
    background: #00a65a;
}

.info-box.is-loss {
    background: #dd4b39;
}

.chart-tooltip {
    position: fixed;
    z-index: 80;
    max-width: 240px;
    padding: 7px 10px;
    border-radius: 6px;
    background: #1f2933;
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.35;
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.28);
    pointer-events: none;
}

.muted {
    margin: 0 0 16px;
    color: var(--muted);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

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

.stat-card {
    padding: 12px;
    display: grid;
    gap: 4px;
}

.stat-label,
.stat-note {
    color: var(--muted);
    font-size: 0.85rem;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
}

.panel {
    margin-top: 12px;
    padding: 12px 14px;
}

.panel h2 {
    margin: 0 0 8px;
    font-size: 1.05rem;
}

.panel p {
    margin: 0;
    color: var(--muted);
}

.charts-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 14px;
    margin-top: 16px;
}

.bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 16px;
    align-items: start;
}

.chart-panel {
    margin-top: 0;
}

.chart-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.chart-head h2 {
    margin: 0;
}

.chart-head .muted {
    margin: 0;
    font-size: 0.8rem;
}

.chart-bars {
    display: flex;
    align-items: stretch;
    gap: 6px;
    height: 180px;
}

.chart-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.chart-bar-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.chart-bar {
    width: 70%;
    max-width: 28px;
    background: linear-gradient(180deg, #3cb88a 0%, var(--accent) 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.2s ease, filter 0.15s ease, transform 0.15s ease;
}

.chart-col:hover .chart-bar,
.chart-col:focus-visible .chart-bar {
    filter: brightness(1.12);
    transform: scaleX(1.12);
}

.chart-col span {
    font-size: 0.7rem;
    color: var(--muted);
}

.line-chart {
    position: relative;
}

.line-chart-max {
    position: absolute;
    top: 0;
    left: 0;
    font-size: 0.75rem;
    color: var(--muted);
}

.line-chart svg {
    display: block;
    width: 100%;
    height: 160px;
    margin-top: 18px;
}

.line-chart-area {
    fill: rgba(47, 111, 94, 0.16);
}

.line-chart-line {
    stroke: var(--accent);
    stroke-width: 2.5;
    stroke-linejoin: round;
    stroke-linecap: round;
}

.line-chart-hits {
    position: absolute;
    left: 0;
    right: 0;
    top: 18px;
    height: 160px;
    display: flex;
}

.line-hit {
    flex: 1;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.line-hit:hover,
.line-hit:focus-visible {
    background: rgba(47, 111, 94, 0.1);
}

.line-chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--muted);
}

.hbar,
.pay-mix-row {
    cursor: pointer;
}

.hbar-list,
.pay-mix {
    display: grid;
    gap: 12px;
}

.hbar-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 0.9rem;
}

.hbar-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hbar-track {
    height: 8px;
    background: #e8eaed;
    border-radius: 99px;
    overflow: hidden;
    margin: 5px 0 3px;
}

.hbar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
}

.hbar-fill.is-card {
    background: #3d5a80;
}

.hbar-fill.is-online {
    background: #c08a1a;
}

.hbar-fill.is-cod {
    background: #6b3fa0;
}

.hbar-qty {
    font-size: 0.75rem;
    color: var(--muted);
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.page-head .muted {
    margin: 0;
}

.alert {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 6px;
}

.alert-success {
    background: #e8f5ef;
    color: #215c45;
}

.alert-error {
    background: #fdecea;
    color: var(--error);
}

.table-panel {
    padding: 0;
    overflow-x: auto;
}

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

.data-table th,
.data-table td {
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
    font-size: 0.82rem;
}

.data-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.75rem;
}

.data-table tfoot th {
    background: var(--bg);
    color: var(--text);
    font-weight: 700;
    border-bottom: 0;
    border-top: 1px solid var(--border);
}

.peak-hours {
    margin: 0;
    min-width: 0;
    overflow-x: auto;
}

.peak-hours-table {
    width: 100%;
}

.peak-hours-table th,
.peak-hours-table td {
    border: 1px solid var(--border);
}

.peak-hours-table thead th {
    background: #343a40;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

.peak-hours-table td:nth-child(n+2),
.peak-hours-table th:nth-child(n+2) {
    text-align: right;
}

.peak-hours-table tbody tr.is-today {
    background: #f3f4f6;
}

.peak-hours-table tbody tr:hover {
    background: #eef1f4;
}

.actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.actions form {
    margin: 0;
}

.collect-form {
    display: flex;
    align-items: center;
    gap: 6px;
}

.collect-form input {
    width: 88px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 6px;
    font: inherit;
}

.cancel-reason {
    display: block;
    margin-top: 3px;
    font-size: 0.72rem;
    color: var(--muted);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-danger {
    color: var(--error);
}

.btn-link.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.thumb,
.thumb-empty {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    color: var(--muted);
}

.thumb.preview {
    width: 72px;
    height: 72px;
    margin-top: 8px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: capitalize;
}

.badge-active {
    background: #e8f5ef;
    color: #215c45;
}

.badge-completed {
    background: #e8f5ef;
    color: #215c45;
}

.badge-cancelled {
    background: #fdecea;
    color: var(--error);
}

.data-table tr.is-cancelled td {
    color: var(--muted);
}

.badge-admin {
    background: #e8f5ef;
    color: #215c45;
}

.badge-sales {
    background: #e8eef5;
    color: #314e6e;
}

.badge-low {
    background: #fdecea;
    color: var(--error);
    margin-left: 6px;
}

.filter-bar {
    margin: 0 0 12px;
    max-width: 280px;
}

.search-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 8px;
    max-width: none;
}

.search-bar .field {
    min-width: 220px;
    margin: 0;
}

.report-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin: 0 0 16px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.report-toolbar .field {
    margin: 0;
}

.report-toolbar .field input {
    min-width: 150px;
}

.report-type-field {
    flex: 1;
    min-width: 240px;
}

.report-fetch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.report-table-wrap {
    overflow-x: auto;
}

.data-table td.is-num,
.data-table th.is-num {
    text-align: right;
}

.data-table td.is-wrap {
    white-space: normal;
    min-width: 160px;
}

.data-table td.is-low {
    color: var(--error);
    font-weight: 700;
}

.report-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 12px;
    margin: 0 0 16px;
}

.report-filter .field {
    margin: 0;
}

.report-filter .field input {
    min-width: 160px;
}

.report-panel {
    margin-top: 16px;
}

.report-head {
    padding: 14px 14px 0;
}

.form-panel {
    max-width: 640px;
}

.form-panel.voucher-panel {
    max-width: none;
}

.voucher-table input,
.voucher-table select {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 5px 7px;
    font: inherit;
    background: #fff;
}

.voucher-table th,
.voucher-table td {
    padding: 6px 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.pager {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 14px;
}

@media (max-width: 960px) {
    .stats,
    .charts-grid,
    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 800px) {
    .sidebar {
        transform: translateX(-100%);
        z-index: 20;
    }

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

    .menu-btn {
        display: inline-block;
    }

    .nav-toggle:checked ~ .sidebar {
        transform: translateX(0);
    }
}

@media (max-width: 560px) {
    .stats,
    .charts-grid,
    .bottom-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .topbar-user span {
        display: none;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .page-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

.content-pos {
    padding: 0;
    height: calc(100vh - 57px);
    overflow: hidden;
}

.pos-screen {
    display: flex;
    height: 100%;
}

.pos-cart {
    width: 40%;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.pos-catalog {
    width: 60%;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pos-cart-head,
.pos-toolbar,
.pos-totals {
    padding: 12px 14px;
}

.pos-customer {
    position: relative;
}

.pos-customer-label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.pos-customer-row {
    display: flex;
    gap: 8px;
}

.pos-customer-row input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
}

.pos-customer-row .btn-primary {
    padding: 8px 12px;
    white-space: nowrap;
}

.pos-customer-results {
    position: absolute;
    z-index: 8;
    left: 0;
    right: 0;
    top: 100%;
    margin: 4px 0 0;
    padding: 4px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-height: 220px;
    overflow: auto;
}

.pos-customer-results button {
    appearance: none;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 8px 12px;
    font: inherit;
    cursor: pointer;
}

.pos-customer-results button:hover,
.pos-customer-results button.is-active {
    background: #eef6f3;
}

.pos-customer-results strong {
    display: block;
}

.pos-customer-results span {
    color: var(--muted);
    font-size: 0.8rem;
}

.pos-customer-selected {
    margin: 8px 0 0;
    font-size: 0.9rem;
}

.pos-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(31, 41, 51, 0.45);
}

.pos-modal[hidden] {
    display: none;
}

.pos-modal-card {
    width: min(420px, 100%);
    background: #fff;
    border-radius: var(--radius);
    padding: 18px 16px;
    display: grid;
    gap: 12px;
}

.pos-modal-card h2 {
    margin: 0;
    font-size: 1.1rem;
}

.pos-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.pos-panel-title {
    margin: 0;
    font-size: 1rem;
    flex: 1;
}

.pos-toolbar input[type="search"] {
    width: 220px;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 10px;
    font: inherit;
}

.pos-categories {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}

.pos-cat {
    appearance: none;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 999px;
    padding: 6px 12px 6px 6px;
    cursor: pointer;
    font: inherit;
    color: var(--text);
}

.pos-cat.is-active {
    border-color: var(--accent);
    background: #e8f5ef;
}

.pos-cat img,
.pos-cat-fallback {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg);
}

.pos-cat-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--muted);
}

.pos-products-head {
    padding: 10px 14px 0;
}

.pos-cart-items {
    flex: 1;
    overflow: auto;
    padding: 8px 14px 12px;
    border-bottom: 1px solid var(--border);
}

.pos-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.pos-item {
    display: grid;
    min-width: 0;
}

.pos-item span,
.pos-line span {
    color: var(--muted);
    font-size: 0.8rem;
}

.pos-qty {
    display: inline-flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.pos-qty span {
    min-width: 1.25em;
    text-align: center;
    color: var(--text);
    font-size: 0.95rem;
}

.pos-qty button {
    width: 26px;
    height: 26px;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    flex: 0 0 26px;
}

.pos-line-total {
    white-space: nowrap;
}

.pos-totals {
    display: grid;
    gap: 8px;
}

.pos-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pos-row input,
.pos-row select {
    width: 120px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 7px 8px;
    font: inherit;
}

.pos-total-row {
    padding-top: 4px;
    border-top: 1px solid var(--border);
    font-size: 1.05rem;
}

.pos-pay-hint {
    margin: 0;
    font-size: 0.78rem;
    color: var(--error);
}

.pos-quick,
.pos-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.pos-grid {
    flex: 1;
    overflow: auto;
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    align-content: start;
}

.pos-tile {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px;
    text-align: left;
    cursor: pointer;
    display: grid;
    gap: 6px;
    min-height: 140px;
}

.pos-tile img,
.pos-tile-fallback {
    width: 100%;
    height: 72px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg);
}

.pos-tile-fallback {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
}

.pos-tile span {
    color: var(--muted);
    font-size: 0.8rem;
}

.pos-tile.is-disabled {
    opacity: 0.5;
    cursor: default;
}

.field input[readonly] {
    background: var(--bg);
    color: var(--muted);
}

.receipt-totals {
    margin-top: 16px;
    display: grid;
    gap: 6px;
}

.receipt-totals p {
    display: flex;
    justify-content: space-between;
    color: var(--text);
}

@media (max-width: 1100px) {
    .pos-screen {
        flex-direction: column-reverse;
    }

    .pos-cart,
    .pos-catalog {
        width: 100%;
        height: 50%;
    }
}

@media print {
    html,
    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .app-credit,
    .report-print,
    .report-toolbar,
    .report-filter,
    .menu-btn {
        display: none !important;
    }

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

    .app-credit {
        display: none;
    }
}
