:root {
    --sidebar-width: 292px;
    --color-ink: #17211f;
    --color-muted: #66736f;
    --color-page: #f3f6f4;
    --color-panel: #ffffff;
    --color-line: #dfe7e3;
    --color-accent: #166a5b;
    --color-accent-strong: #0e4b41;
    --color-gold: #e6bf58;
    --shadow-soft: 0 18px 50px rgba(18, 38, 34, .10);
    --shadow-drawer: 0 24px 70px rgba(10, 23, 20, .28);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--color-ink);
    background:
        radial-gradient(circle at 100% 0, rgba(22, 106, 91, .10), transparent 30%),
        linear-gradient(180deg, #f8faf9 0, var(--color-page) 320px);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--color-accent);
}

.app-shell {
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.sidebar {
    position: fixed;
    inset: 14px auto 14px 14px;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    width: var(--sidebar-width);
    height: calc(100dvh - 28px);
    max-height: calc(100dvh - 28px);
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(180deg, #0f332e 0%, #102520 100%);
    box-shadow: var(--shadow-drawer);
    transform: translateX(0);
    transition: transform .22s ease, opacity .22s ease;
}

.app-shell[data-sidebar-state="closed"] .sidebar {
    opacity: 0;
    pointer-events: none;
    transform: translateX(calc(-100% - 24px));
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1030;
    background: rgba(9, 19, 17, .34);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.app-shell[data-sidebar-state="open"] .sidebar-backdrop {
    opacity: 0;
    pointer-events: none;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 14px;
    color: #14221f;
    background: linear-gradient(135deg, #ffe08a, var(--color-gold));
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(230, 191, 88, .26);
}

.brand-text {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.brand-text strong {
    font-size: 1.08rem;
    letter-spacing: .04em;
}

.brand-text small {
    color: rgba(255, 255, 255, .62);
    font-size: .78rem;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    flex: 1 1 auto;
    margin-top: 18px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 8px;
    padding-bottom: 16px;
    scrollbar-color: rgba(255, 255, 255, .42) rgba(255, 255, 255, .08);
    scrollbar-width: thin;
}

.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .08);
    border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .42);
    border-radius: 999px;
}

.sidebar-actions {
    display: none;
    gap: 10px;
    flex: 0 0 auto;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.sidebar-actions form {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: rgba(255, 255, 255, .76);
    text-decoration: none;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, .10);
    border-color: rgba(255, 255, 255, .10);
}

.nav-link.active {
    box-shadow: inset 3px 0 0 var(--color-gold);
}

.nav-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 10px;
    color: #16302b;
    background: rgba(255, 255, 255, .82);
    font-size: .82rem;
    font-weight: 800;
}

.nav-text {
    font-weight: 650;
}

.main-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-left: calc(var(--sidebar-width) + 28px);
    transition: padding-left .22s ease;
}

.app-shell[data-sidebar-state="closed"] .main-panel {
    padding-left: 0;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-width: 0;
    min-height: 76px;
    padding: 14px 28px;
    border-bottom: 1px solid rgba(223, 231, 227, .75);
    background: rgba(248, 250, 249, .88);
    backdrop-filter: blur(14px);
}

.menu-button {
    position: relative;
    z-index: 1055;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(18, 38, 34, .06);
}

.menu-button span {
    display: block;
    width: 19px;
    height: 2px;
    margin: 2px 0;
    border-radius: 999px;
    background: var(--color-ink);
    transition: transform .18s ease, opacity .18s ease;
}

.app-shell[data-sidebar-state="open"] .menu-button span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.app-shell[data-sidebar-state="open"] .menu-button span:nth-child(2) {
    opacity: 0;
}

.app-shell[data-sidebar-state="open"] .menu-button span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.topbar-title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.topbar-title strong {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-company {
    display: block;
    color: var(--color-muted);
    font-size: .78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-spacer {
    flex: 1 1 auto;
    min-width: 24px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 240px;
    min-width: 0;
    max-width: 260px;
    padding: 7px 10px 7px 7px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    background: #fff;
}

.user-avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: var(--color-accent);
    font-weight: 800;
}

.user-meta {
    display: grid;
    min-width: 0;
    line-height: 1.1;
}

.user-meta strong {
    font-size: .88rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta small {
    color: var(--color-muted);
    font-size: .75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-form {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
    margin: 0;
}

.topbar-label,
.eyebrow,
.status-label {
    display: block;
    color: var(--color-muted);
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.content-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 34px 28px 44px;
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 22px;
    padding: 24px;
    border: 1px solid rgba(223, 231, 227, .85);
    border-radius: 18px;
    background: rgba(255, 255, 255, .86);
    box-shadow: var(--shadow-soft);
}

.page-heading > div {
    flex: 1 1 280px;
    min-width: 0;
}

.page-heading h1 {
    margin: 4px 0 0;
    font-size: clamp(1.9rem, 3vw, 2.55rem);
    font-weight: 850;
}

.btn {
    border-radius: 12px;
    font-weight: 650;
}

.btn-primary {
    --bs-btn-bg: var(--color-accent);
    --bs-btn-border-color: var(--color-accent);
    --bs-btn-hover-bg: var(--color-accent-strong);
    --bs-btn-hover-border-color: var(--color-accent-strong);
    box-shadow: 0 10px 24px rgba(22, 106, 91, .18);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 235px), 1fr));
    gap: 16px;
    margin-top: 18px;
}

.status-card,
.table-panel,
.form-panel,
.filter-panel {
    border: 1px solid rgba(223, 231, 227, .9);
    border-radius: 18px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 14px 38px rgba(18, 38, 34, .07);
}

.status-card {
    min-height: 166px;
    min-width: 0;
    padding: 22px;
    overflow-wrap: anywhere;
}

.status-card strong {
    display: block;
    margin: 14px 0 8px;
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    line-height: 1.15;
}

.status-card p {
    margin: 0;
    color: var(--color-muted);
}

.table-panel {
    overflow: hidden;
}

.table {
    --bs-table-bg: transparent;
}

.table > :not(caption) > * > * {
    padding: 14px 18px;
}

.table-panel .table th {
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.panel-title {
    padding: 18px 20px;
    border-bottom: 1px solid var(--color-line);
    font-weight: 850;
}

.panel-subtitle {
    margin: 0;
    font-size: 1rem;
    font-weight: 850;
}

.filter-panel,
.form-panel {
    padding: 20px;
}

.filter-panel {
    margin-bottom: 18px;
}

.filter-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 12px;
}

.filter-form-wide {
    grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto auto;
}

.filter-form-advanced {
    grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) 150px 150px auto auto;
}

.filter-actions {
    display: flex;
    align-items: end;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-top: 18px;
}

.table-subtext,
.text-muted {
    color: var(--color-muted) !important;
}

.amount-debt {
    color: #b42318;
}

.amount-credit {
    color: #175cd3;
}

.amount-zero {
    color: var(--color-ink);
}

.payment-balance-display {
    min-width: 180px;
    padding: 10px 16px;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    background: #fff;
    text-align: center;
    box-shadow: var(--shadow-soft);
}

.payment-balance-display span {
    display: block;
    color: var(--color-muted);
    font-size: .72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.payment-balance-display strong {
    display: block;
    font-size: 1.12rem;
}

.push-toggle {
    white-space: nowrap;
}

.push-setup-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #f3d08b;
    border-radius: 14px;
    background: #fff4d8;
    color: #614200;
}

.push-setup-banner strong,
.push-setup-banner span {
    display: block;
}

.push-setup-banner span {
    font-size: .92rem;
}

.notification-toast {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1080;
    max-width: min(360px, calc(100vw - 36px));
    padding: 14px 16px;
    border: 1px solid #b7e4d8;
    border-radius: 14px;
    background: #ecfdf7;
    box-shadow: var(--shadow-soft);
    color: var(--color-ink);
    cursor: pointer;
}

.notification-toast strong {
    display: block;
    margin-bottom: 4px;
}

.notification-toast small {
    display: block;
    margin-top: 8px;
    color: var(--color-muted);
    font-weight: 800;
}

.inline-status-form {
    display: inline-flex;
    gap: .45rem;
    align-items: center;
}

.inline-status-form .form-control {
    width: 10rem;
}

.form-panel-narrow {
    max-width: 680px;
}

.form-control,
.form-select {
    border-radius: 12px;
}

.form-actions,
.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.form-actions {
    margin-top: 22px;
}

.action-row {
    justify-content: flex-end;
}

.action-row form {
    margin: 0;
}

.target-user {
    display: grid;
    gap: 2px;
    margin-bottom: 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--color-line);
}

.target-user span {
    color: var(--color-muted);
}

.weekday-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.weekday-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background: #fff;
    font-weight: 650;
}

.import-help {
    display: grid;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    background: #f8faf9;
    color: var(--color-muted);
}

.import-help strong {
    color: var(--color-ink);
}

.import-help code {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: #0e4b41;
    background: rgba(22, 106, 91, .08);
    white-space: normal;
}

.total-preview {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--color-line);
    border-radius: 14px;
    background: #f8faf9;
    text-align: right;
}

.btn-client-search {
    width: 100%;
    margin-top: 8px;
}

.client-search-results {
    margin-top: 10px;
}

.product-search-input {
    min-width: 280px;
    margin-bottom: 8px;
}

.product-type-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
    scrollbar-width: thin;
}

.product-type-tab {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid var(--color-line);
    border-radius: 999px;
    background: #fff;
    color: var(--color-muted);
    font-weight: 800;
}

.product-type-tab.active,
.product-type-tab:hover,
.product-type-tab:focus {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: #fff;
    outline: 0;
}

.product-search-results {
    margin-bottom: 8px;
}

.product-select-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.search-match-list {
    overflow: hidden;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background: #fff;
}

.search-match-row {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--color-line);
    background: #fff;
    color: var(--color-ink);
    text-align: left;
    white-space: normal;
    font-weight: 750;
}

.search-match-row:last-child {
    border-bottom: 0;
}

.search-match-row:hover,
.search-match-row:focus {
    background: rgba(22, 106, 91, .08);
    outline: 0;
}

.product-match-photo {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.product-match-photo img {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    object-fit: cover;
    background: #eef4f1;
}

.product-match-photo span {
    min-width: 0;
}

.product-match-photo strong {
    white-space: nowrap;
}

.product-image-current {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
}

.product-image-current img {
    width: 86px;
    height: 86px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--color-line);
}

.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--color-line);
    background: #eef4f1;
}

[data-consumption-lines] th:first-child,
[data-consumption-lines] td:first-child {
    min-width: 320px;
}

.account-summary {
    margin-top: 0;
    margin-bottom: 18px;
}

.diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.diagnostic-grid > div {
    padding: 14px;
    border: 1px solid var(--color-line);
    border-radius: 12px;
    background: #f8faf9;
}

.diagnostic-grid span {
    display: block;
    color: var(--color-muted);
    font-size: .78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.diagnostic-grid strong {
    display: block;
    margin-top: 4px;
}

.instruction-list {
    color: var(--color-muted);
}

.instruction-list p {
    margin-bottom: 12px;
}

.push-actions {
    justify-content: flex-start;
    gap: 10px;
}

.auth-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 50% 0, rgba(22, 106, 91, .14), transparent 34%),
        #eef4f1;
}

.auth-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    width: min(440px, 100%);
    padding: 30px;
    border: 1px solid var(--color-line);
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(18, 60, 54, .16);
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.auth-brand h1 {
    margin: 4px 0 0;
    font-size: 1.55rem;
    font-weight: 850;
}

.auth-company {
    margin: 4px 0 0;
    color: var(--color-muted);
    font-size: .92rem;
}

@media (max-width: 1199.98px) {
    .main-panel {
        padding-left: 0;
    }

    .sidebar {
        inset: 0 auto 0 0;
        width: min(88vw, 340px);
        border-radius: 0 18px 18px 0;
        transform: translateX(-105%);
        overflow-y: auto;
    }

    .sidebar-actions {
        display: grid;
    }

    .app-shell[data-sidebar-state="open"] .sidebar {
        opacity: 1;
        pointer-events: auto;
        transform: translateX(0);
    }

    .app-shell[data-sidebar-state="open"] .sidebar-backdrop {
        opacity: 1;
        pointer-events: auto;
    }
}

@media (max-width: 991.98px) {
    .sidebar {
        width: min(90vw, 330px);
    }

    .topbar {
        flex-wrap: nowrap;
        padding: 12px 16px;
        gap: 10px;
    }

    .topbar-spacer {
        display: none;
        flex-basis: 0;
        min-width: 0;
        height: 0;
    }

    .topbar-user {
        display: none;
    }

    .logout-form {
        display: none;
    }

    .topbar-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-title strong {
        font-size: .96rem;
    }

    .push-setup-banner {
        align-items: stretch;
        flex-direction: column;
    }

    .content-wrap {
        padding: 22px 16px 34px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
        padding: 18px;
    }

    .page-heading > div {
        flex: 0 1 auto;
    }

    .page-heading h1 {
        font-size: clamp(1.65rem, 8vw, 2.1rem);
    }

    .filter-form,
    .filter-form-wide,
    .filter-form-advanced,
    .report-grid {
        grid-template-columns: 1fr;
    }

    .status-grid {
        grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    }
}

@media (max-width: 767.98px) {
    .sidebar {
        width: min(92vw, 320px);
        padding: 16px;
    }

    .sidebar-nav {
        gap: 7px;
    }

    .nav-link {
        min-height: 48px;
    }

    .topbar {
        min-height: 68px;
    }

    .menu-button {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .topbar-user {
        flex: 0 1 220px;
        border-radius: 14px;
    }

    .logout-form {
        flex: 0 0 auto;
    }
}

@media (max-width: 575.98px) {
    .topbar {
        gap: 10px;
    }

    .status-grid {
        grid-template-columns: 1fr;
    }

    .page-heading h1 {
        font-size: 1.7rem;
    }

    .page-heading .btn {
        width: 100%;
    }

    .form-panel,
    .filter-panel {
        padding: 16px;
    }

    .total-preview {
        text-align: left;
    }
}

.nav-section {
    color: rgba(255,255,255,.62);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .08em;
    margin: .85rem .75rem .35rem;
    text-transform: uppercase;
}

.compact-heading {
    min-height: auto !important;
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
}

.pos-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: .75rem;
}

.pos-product {
    border: 1px solid rgba(23, 107, 91, .2);
    border-radius: .75rem;
    background: #fff;
    padding: .9rem;
    text-align: left;
    min-height: 92px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.pos-product-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: .65rem;
    object-fit: cover;
    margin-bottom: .65rem;
    background: #eef4f1;
}

.pos-product strong,
.pos-product span {
    display: block;
}

.pos-product span {
    color: #61736f;
    font-size: .85rem;
    margin-top: .35rem;
}

.kitchen-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.kitchen-ticket h2 {
    font-size: 1.35rem;
    margin: .15rem 0 0;
}

.qr-placeholder {
    align-items: center;
    aspect-ratio: 1;
    background: repeating-linear-gradient(45deg, #111 0 8px, #fff 8px 16px);
    border: 10px solid #fff;
    box-shadow: 0 16px 40px rgba(0,0,0,.14);
    color: transparent;
    display: flex;
    max-width: 240px;
    width: 100%;
}

.qr-menu-card {
    max-width: 720px;
    width: min(720px, calc(100vw - 2rem));
}

.qr-product-row {
    align-items: center;
    border: 1px solid rgba(15, 23, 42, .12);
    border-radius: .75rem;
    display: grid;
    gap: .75rem;
    grid-template-columns: 1fr 78px auto;
    margin-bottom: .65rem;
    padding: .75rem;
}

.qr-product-info {
    align-items: center;
    display: flex;
    gap: .75rem;
    min-width: 0;
}

.qr-product-image {
    width: 64px;
    height: 64px;
    border-radius: .65rem;
    object-fit: cover;
    background: #eef4f1;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .pos-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-product { min-height: 104px; padding: .75rem; }
    .qr-product-row { grid-template-columns: 1fr; }
}


.type-color-swatch {
    border: 1px solid rgba(15, 23, 42, .18);
    border-radius: 999px;
    display: inline-block;
    height: 22px;
    width: 44px;
}

.pos-shell {
    padding-bottom: 1rem;
}

.pos-layout {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(280px, 340px) 1fr;
}

.pos-order-panel,
.pos-catalog-panel {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .07);
    padding: 1rem;
}

.pos-order-panel {
    position: sticky;
    top: 86px;
}

.pos-search-row {
    margin-bottom: .85rem;
}

.pos-category-tabs {
    display: flex;
    gap: .55rem;
    overflow-x: auto;
    padding-bottom: .65rem;
    scrollbar-width: thin;
}

.pos-category-tab {
    background: #fff;
    border: 2px solid color-mix(in srgb, var(--type-color, #0f766e) 45%, #fff);
    border-radius: 999px;
    color: #10201d;
    flex: 0 0 auto;
    font-weight: 800;
    min-height: 46px;
    padding: .55rem 1rem;
}

.pos-category-tab.active {
    background: var(--type-color, #0f766e);
    color: #fff;
}

.pos-category-section {
    display: none;
}

.pos-category-section.active {
    display: block;
}

.pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}

.pos-product {
    border-top: 7px solid var(--product-color, #0f766e);
    min-height: 138px;
    position: relative;
}

.pos-product strong {
    font-size: 1rem;
    line-height: 1.2;
}

.pos-product em {
    background: #991b1b;
    border-radius: 999px;
    color: #fff;
    font-size: .75rem;
    font-style: normal;
    font-weight: 800;
    padding: .2rem .45rem;
    position: absolute;
    right: .6rem;
    top: .6rem;
}

.pos-product.is-sold-out {
    filter: grayscale(1);
    opacity: .62;
}

.pos-current-order {
    border-top: 1px solid rgba(15, 23, 42, .08);
    padding-top: 1rem;
}

.pos-order-items {
    display: grid;
    gap: .7rem;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: .25rem;
}

.pos-order-line {
    border: 1px solid rgba(15, 23, 42, .1);
    border-radius: 14px;
    display: grid;
    gap: .55rem;
    grid-template-columns: 1fr auto;
    padding: .75rem;
}

.pos-order-line-main {
    min-width: 0;
}

.pos-order-line-main strong,
.pos-order-line-main small {
    display: block;
}

.pos-qty {
    align-items: center;
    display: flex;
    gap: .25rem;
}

.pos-qty button {
    align-items: center;
    background: #0f766e;
    border: 0;
    border-radius: 10px;
    color: #fff;
    display: inline-flex;
    font-size: 1.2rem;
    font-weight: 900;
    height: 40px;
    justify-content: center;
    width: 40px;
}

.pos-qty input {
    border: 1px solid rgba(15, 23, 42, .15);
    border-radius: 10px;
    font-weight: 800;
    height: 40px;
    text-align: center;
    width: 58px;
}

.pos-total {
    align-items: center;
    border-top: 1px solid rgba(15, 23, 42, .08);
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
}

.pos-total strong {
    font-size: 1.35rem;
}

@media (max-width: 980px) {
    .pos-layout { grid-template-columns: 1fr; }
    .pos-order-panel { position: static; }
}

@media (max-width: 640px) {
    .pos-order-line { grid-template-columns: 1fr; }
    .pos-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pos-product { min-height: 132px; }
}


.pos-add-toast {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 1090;
    max-width: min(360px, calc(100vw - 32px));
    padding: 14px 16px;
    border: 1px solid rgba(153, 27, 27, .28);
    border-radius: 16px;
    color: #ffffff;
    background: #dc2626;
    box-shadow: 0 18px 45px rgba(153, 27, 27, .28);
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity .18s ease, transform .18s ease;
}

.pos-add-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.pos-add-toast strong,
.pos-add-toast span {
    display: block;
}

.pos-add-toast strong {
    font-weight: 900;
}

.pos-add-toast span {
    margin-top: 2px;
    color: rgba(255, 255, 255, .9);
    font-size: .92rem;
}

@media (max-width: 720px) {
    .pos-add-toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
    }
}

/* POS / Comandero optimizado para celular */
@media (max-width: 720px) {
    .page-heading.compact-heading {
        align-items: stretch;
        gap: .75rem;
        margin-bottom: .75rem;
        padding: 1rem;
    }

    .page-heading.compact-heading h1 {
        font-size: 2rem;
        line-height: 1.05;
        margin: 0;
    }

    .page-heading.compact-heading .btn {
        width: 100%;
    }

    .pos-shell {
        padding-bottom: 5rem;
    }

    .pos-layout {
        display: flex;
        flex-direction: column;
        gap: .8rem;
    }

    .pos-order-panel,
    .pos-catalog-panel {
        border-radius: 14px;
        box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
        padding: .85rem;
    }

    .pos-order-panel {
        position: static;
    }

    .pos-order-panel .form-label {
        font-size: .82rem;
        font-weight: 800;
        margin-bottom: .25rem;
    }

    .pos-order-panel .form-select,
    .pos-order-panel .form-control,
    .pos-search-row .form-control {
        border-radius: 12px;
        font-size: 1rem;
        min-height: 46px;
    }

    .pos-current-order {
        margin-top: .75rem !important;
        padding-top: .75rem;
    }

    .pos-order-items {
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }

    .pos-order-line {
        border-radius: 12px;
        gap: .5rem;
        grid-template-columns: 1fr;
        padding: .65rem;
    }

    .pos-order-line-main strong {
        font-size: .95rem;
        line-height: 1.2;
    }

    .pos-order-line-main .form-control {
        margin-top: .4rem;
    }

    .pos-qty {
        justify-content: space-between;
    }

    .pos-qty button {
        height: 42px;
        width: 42px;
    }

    .pos-qty input {
        flex: 1;
        max-width: 88px;
    }

    .pos-total {
        background: #f8fafc;
        border: 1px solid rgba(15, 23, 42, .08);
        border-radius: 12px;
        margin-top: .75rem;
        padding: .75rem;
    }

    .pos-search-row {
        margin-bottom: .65rem;
    }

    .pos-category-tabs {
        gap: .45rem;
        margin-left: -.15rem;
        margin-right: -.15rem;
        padding: 0 .15rem .55rem;
    }

    .pos-category-tab {
        border-width: 1px;
        font-size: .86rem;
        min-height: 42px;
        padding: .45rem .75rem;
        white-space: nowrap;
    }

    .pos-product-grid {
        display: flex;
        gap: .65rem;
        overflow-x: auto;
        overflow-y: hidden;
        padding: .15rem .15rem .8rem;
        scroll-snap-type: x mandatory;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .pos-product {
        border-radius: 13px;
        border-top-width: 5px;
        flex: 0 0 176px;
        min-height: 122px;
        padding: .7rem;
        scroll-snap-align: start;
        text-align: left;
    }

    .pos-product strong {
        display: -webkit-box;
        font-size: .93rem;
        line-height: 1.15;
        overflow: hidden;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
    }

    .pos-product span {
        display: block;
        font-size: .82rem;
        line-height: 1.2;
        margin-top: .3rem;
    }

    .pos-product-image {
        height: 54px;
        width: 54px;
    }
}

@media (max-width: 420px) {
    .pos-product {
        flex-basis: 168px;
        min-height: 118px;
    }

    .pos-product-image {
        height: 52px;
        width: 52px;
    }

    .pos-product strong {
        -webkit-line-clamp: 2;
    }
}



/* Ajuste: carrusel horizontal de productos en celular */
@media (max-width: 720px) {
    .pos-category-section.active {
        overflow: hidden;
    }

    .pos-product-grid::after {
        content: "";
        flex: 0 0 .25rem;
    }
}
/* Correccion fuerte POS movil: productos desplazables horizontalmente */
@media (max-width: 720px) {
    .pos-catalog-panel {
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .pos-category-section.active {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    .pos-product-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        grid-template-columns: none !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: scroll !important;
        overflow-y: hidden !important;
        gap: .65rem !important;
        padding: .15rem .15rem .9rem !important;
        scroll-snap-type: x proximity !important;
        touch-action: pan-x !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .pos-product {
        flex: 0 0 172px !important;
        width: 172px !important;
        max-width: 172px !important;
        min-width: 172px !important;
        scroll-snap-align: start !important;
    }
}

/* Drag tactil real para carrusel POS */
@media (max-width: 720px) {
    .pos-product-grid {
        cursor: grab;
        user-select: none;
    }

    .pos-product-grid.is-dragging {
        cursor: grabbing;
        scroll-snap-type: none !important;
    }
}

/* Controles visibles para mover productos en POS movil */
.pos-product-scroll-controls {
    display: none;
}

@media (max-width: 720px) {
    .pos-product-scroll-controls {
        display: grid;
        gap: .6rem;
        grid-template-columns: 1fr 1fr;
        margin: -.15rem 0 .7rem;
    }

    .pos-product-scroll-controls .btn {
        border-radius: 999px;
        font-size: 1.25rem;
        font-weight: 900;
        min-height: 42px;
        padding: .35rem .75rem;
    }
}

/* POS movil final: mostrar productos hacia abajo, sin carrusel */
@media (max-width: 720px) {
    .pos-product-scroll-controls {
        display: none !important;
    }

    .pos-catalog-panel {
        overflow: visible !important;
    }

    .pos-category-section.active {
        overflow: visible !important;
    }

    .pos-product-grid,
    .pos-product-grid.pos-product-grid-all {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: .65rem !important;
        overflow: visible !important;
        padding: 0 !important;
        scroll-snap-type: none !important;
        touch-action: auto !important;
    }

    .pos-product-grid::after {
        display: none !important;
        content: none !important;
    }

    .pos-product {
        align-items: center !important;
        display: grid !important;
        grid-template-columns: 58px 1fr !important;
        gap: .6rem !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        min-height: 76px !important;
        padding: .65rem !important;
    }

    .pos-product:not(:has(.pos-product-image)) {
        grid-template-columns: 1fr !important;
    }

    .pos-product-image {
        grid-row: span 2 !important;
        height: 52px !important;
        width: 52px !important;
    }

    .pos-product strong {
        -webkit-line-clamp: 2 !important;
        font-size: .92rem !important;
    }

    .pos-product span {
        margin-top: .1rem !important;
    }
}

/* POS movil: categorias visibles en varias lineas */
@media (max-width: 720px) {
    .pos-category-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: .5rem !important;
        overflow: visible !important;
        padding: 0 0 .7rem !important;
    }

    .pos-category-tab {
        flex: 0 1 auto !important;
        max-width: 100% !important;
        min-height: 38px !important;
        padding: .42rem .72rem !important;
        white-space: normal !important;
    }
}
/* POS categorias: mantener colores definidos por tipo */
.pos-category-tab {
    border-color: var(--type-color, #0f766e) !important;
    color: var(--type-color, #0f766e) !important;
    background: color-mix(in srgb, var(--type-color, #0f766e) 10%, #fff) !important;
}

.pos-category-tab.active {
    background: var(--type-color, #0f766e) !important;
    border-color: var(--type-color, #0f766e) !important;
    color: #fff !important;
}

@media (max-width: 720px) {
    .pos-category-tab {
        box-shadow: inset 0 -3px 0 var(--type-color, #0f766e);
    }
}



.kitchen-live-status {
    color: var(--muted);
    font-size: 0.9rem;
    margin: -0.5rem 0 1rem;
}


.app-shell.kitchen-fullscreen-mode[data-sidebar-state="closed"] .topbar {
    transform: translateY(-100%);
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
}

.app-shell.kitchen-fullscreen-mode[data-sidebar-state="closed"] .content-wrap {
    max-width: none;
    padding-top: 14px;
}

.app-shell.kitchen-fullscreen-mode[data-sidebar-state="closed"] .main-panel {
    padding-left: 0;
}


.modifier-option-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.modifier-option-group {
    border: 1px solid var(--border-color, #d7dfdc);
    border-radius: 10px;
    padding: 12px;
    background: #fff;
}

.modifier-option-group > strong {
    display: block;
    margin-bottom: 8px;
    color: #374151;
    font-size: .82rem;
    text-transform: uppercase;
}

.modifier-option-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.modifier-table td {
    min-width: 130px;
}

@media (max-width: 680px) {
    .modifier-option-row {
        grid-template-columns: 1fr;
    }
}
