:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-soft: #eef3f9;
    --line: #dfe5ec;
    --text: #1f2933;
    --muted: #667085;
    --primary: #2563eb;
    --primary-soft: #dbeafe;
    --green: #159947;
    --amber: #d98b0d;
    --blue: #2563eb;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

.async-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    color: #166534;
    background: #dcfce7;
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}

.async-status svg {
    width: 16px;
    height: 16px;
}

[data-async-status="saving"] .async-status {
    color: #1d4ed8;
    background: #dbeafe;
}

[data-async-status="saving"] .async-status svg {
    animation: spin 0.9s linear infinite;
}

[data-async-status="error"] .async-status {
    color: #991b1b;
    background: #fee2e2;
}

tr[data-async-status="success"] {
    outline: 2px solid rgba(22, 101, 52, 0.22);
    outline-offset: -2px;
}

tr[data-async-status="error"] {
    outline: 2px solid rgba(153, 27, 27, 0.28);
    outline-offset: -2px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

* {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #b8c2ce transparent;
}

*::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #b8c2ce;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
    background-clip: padding-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input {
    font: inherit;
}

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

.sidebar {
    background: #f1f4f8;
    border-right: 1px solid var(--line);
    padding: 12px;
    transition: width 180ms ease;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-weight: 700;
}

.brand-mark,
.user-avatar {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.new-sale {
    display: flex;
    align-items: center;
    gap: 12px;
    width: fit-content;
    min-height: 48px;
    margin: 14px 0 16px;
    padding: 0 18px;
    border-radius: 16px;
    background: #cde9fb;
    color: #123047;
    font-weight: 700;
}

.sidebar__nav {
    display: grid;
    gap: 3px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 38px;
    padding: 0 14px;
    border-radius: 20px;
    color: #313840;
    font-weight: 600;
}

.nav-badge,
.touch-badge {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin-left: auto;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.touch-badge {
    position: absolute;
    top: 3px;
    right: 7px;
    margin: 0;
}

.touch-badge--ready {
    background: #16a34a;
}

.nav-item:hover {
    background: #e8edf5;
}

.nav-item.is-active {
    background: #d7e6ff;
    color: #102a56;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #424b57;
    cursor: pointer;
}

.icon-button:hover {
    background: #e8edf5;
}

.button:disabled,
.icon-button:disabled,
.payment-keypad__keys button:disabled {
    border-color: #cbd5e1;
    background: #eef2f6;
    color: #98a2b3;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
    filter: grayscale(0.25);
}

.button--primary:disabled {
    background: #d0d5dd;
    color: #667085;
}

.button:disabled svg,
.icon-button:disabled svg {
    color: #98a2b3;
    stroke-width: 1.8;
}

.icon-button--danger {
    color: #b42318;
}

.panel--danger {
    border-color: #fecaca;
    background: #fffafa;
}

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

.topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 64px;
    padding: 8px 22px;
    background: var(--bg);
}

.search {
    display: flex;
    align-items: center;
    gap: 12px;
    width: min(760px, 100%);
    height: 52px;
    padding: 0 14px;
    border-radius: 24px;
    background: #e9eef6;
}

.search input {
    flex: 1;
    min-width: 80px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

.topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-left: auto;
}

.topbar__actions form {
    margin: 0;
}

.license-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border-radius: 22px;
    background: #e8edf5;
    white-space: nowrap;
    font-weight: 700;
}

.license-pill span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
}

.plan-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 5px 8px 5px 12px;
    border-radius: 24px;
    background: #e8edf5;
    white-space: nowrap;
}

.plan-pill--warning {
    border: 1px solid #fed7aa;
    background: #fff3cd;
    color: #7a4b00;
}

.plan-pill--danger {
    border: 1px solid #fecaca;
    background: #fee2e2;
    color: #991b1b;
}

.plan-pill__status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--green);
}

.plan-pill--warning .plan-pill__status {
    background: #d98b0d;
}

.plan-pill--danger .plan-pill__status {
    background: #dc2626;
}

.plan-pill strong,
.plan-pill small {
    display: block;
}

.plan-pill small {
    color: var(--muted);
    font-size: 12px;
}

.dashboard-plan {
    width: 100%;
    justify-content: flex-start;
    white-space: normal;
}

.mini-button {
    min-height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 700;
}

.has-badge {
    position: relative;
}

.has-badge span,
.nav-count,
.unread-dot {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.has-badge span {
    position: absolute;
    top: 2px;
    right: 1px;
}

.nav-count {
    margin-left: auto;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
    padding: 4px 8px 4px 4px;
    border-radius: 24px;
}

.user-menu small {
    display: block;
    color: var(--muted);
}

.content {
    min-height: calc(100vh - 64px);
    margin-right: 22px;
    padding: 24px;
    border-radius: 24px 24px 0 0;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.page-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: 30px;
}

h2 {
    margin-bottom: 0;
    font-size: 18px;
}

.heading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.button--primary {
    background: var(--primary);
    color: #fff;
}

.button--light {
    border-color: var(--line);
    background: var(--surface);
    color: var(--text);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card,
.panel,
.empty-module {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.metric-card {
    display: grid;
    gap: 10px;
    padding: 18px;
}

.metric-card span,
.metric-card small,
.state-list dt {
    color: var(--muted);
}

.metric-card strong {
    font-size: 28px;
}

.work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.7fr);
    gap: 18px;
}

.panel {
    padding: 18px;
}

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

.activity-list {
    display: grid;
}

.activity-row {
    display: grid;
    grid-template-columns: 14px 120px 1fr 92px;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    border-top: 1px solid var(--line);
}

.activity-row time {
    color: var(--muted);
    text-align: right;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot--green {
    background: var(--green);
}

.status-dot--amber {
    background: var(--amber);
}

.status-dot--blue {
    background: var(--blue);
}

.state-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.state-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.state-list dd {
    margin: 0;
    font-weight: 700;
}

.empty-module {
    display: grid;
    place-items: center;
    min-height: 360px;
    padding: 30px;
    color: var(--muted);
    text-align: center;
}

.empty-module svg {
    width: 48px;
    height: 48px;
    color: var(--primary);
}

.empty-module h1,
.empty-module h2 {
    color: var(--text);
}

.auth-page {
    display: grid;
    place-items: center;
    min-height: 100vh;
    padding: 24px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.72), rgba(246,248,251,0.94)),
        var(--bg);
}

.auth-card {
    width: min(430px, 100%);
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-card__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 30px;
}

.auth-card__brand small,
.auth-card__heading p {
    display: block;
    color: var(--muted);
}

.auth-card__heading {
    margin-bottom: 22px;
}

.auth-card__heading h1 {
    margin-bottom: 8px;
}

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

.auth-form label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 700;
}

.auth-form input {
    width: 100%;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.auth-form input:focus {
    border-color: var(--primary);
    outline: 3px solid var(--primary-soft);
}

.auth-link {
    display: inline-flex;
    margin-top: 18px;
    color: var(--primary);
    font-weight: 700;
}

.alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.alert--error {
    border: 1px solid #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.alert--success {
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.notice-stack {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.notice-stack--floating {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 80;
    width: min(420px, calc(100vw - 28px));
    margin: 0;
    pointer-events: none;
}

.notice-stack--floating .notice {
    pointer-events: auto;
}

.notice {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.notice p {
    margin: 0;
    font-weight: 700;
}

.notice--success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.notice--warning {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #9a3412;
}

.notice--error {
    border-color: #fecaca;
    background: #fef2f2;
    color: #991b1b;
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

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

.form-panel label {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 700;
}

.form-panel input,
.form-panel select,
.form-panel textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.form-panel textarea {
    resize: vertical;
}

.muted-text {
    color: var(--muted);
}

.thread-list {
    display: grid;
    gap: 8px;
}

.thread-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.thread-row:hover {
    background: var(--surface-soft);
}

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

.conversation {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

.message-bubble {
    width: min(720px, 100%);
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.message-bubble.is-own {
    justify-self: end;
    background: var(--primary-soft);
}

.message-bubble div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.message-bubble time {
    color: var(--muted);
    font-size: 12px;
}

.message-bubble p {
    margin-bottom: 0;
    line-height: 1.5;
}

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

.platform-sidebar {
    display: grid;
    align-content: start;
    gap: 24px;
    padding: 18px 12px;
    border-right: 1px solid var(--line);
    background: #f1f4f8;
}

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

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

.data-table th,
.data-table td {
    padding: 13px 12px;
    border-top: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

.data-table td small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: #344054;
    font-weight: 700;
}

.badge--pending {
    background: #fff7ed;
    color: #9a3412;
}

.badge--prepared {
    background: #dcfce7;
    color: #166534;
}

.badge--cancel {
    background: #fee2e2;
    color: #991b1b;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.tab-link {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-weight: 700;
    white-space: nowrap;
}

.tab-link.is-active {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-count,
.tab-remove {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    margin-left: 8px;
    border-radius: 999px;
    background: var(--surface-soft);
    color: #344054;
    font-size: 12px;
}

.tab-remove {
    background: #fee2e2;
    color: #991b1b;
}

.ops-simulator {
    display: grid;
    gap: 16px;
}

.ops-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.segmented-control {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.segmented-control button {
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 700;
}

.segmented-control button.is-active {
    background: var(--primary);
    color: #fff;
}

.prep-board {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.prep-order,
.current-order {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-left: 5px solid var(--amber);
    border-radius: 8px;
    background: #fff;
}

.prep-order--prepared,
.current-order--prepared {
    border-left-color: var(--green);
    background: #f0fdf4;
}

.prep-order__main {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.prep-order__main small,
.current-order small,
.product-row small,
.phone-topbar small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.prep-order__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.status-dot {
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--amber);
}

.status-dot--prepared {
    background: var(--green);
}

.ops-warning {
    display: inline-flex;
    width: fit-content;
    min-height: 28px;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 700;
}

.ops-warning--compact {
    min-height: 30px;
    padding: 0 8px;
    border-radius: 8px;
    font-size: 0.78rem;
}

.phone-frame {
    width: min(430px, 100%);
    min-height: 720px;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border: 10px solid #111827;
    border-radius: 30px;
    background: #f8fafc;
    box-shadow: var(--shadow);
}

.phone-topbar {
    display: grid;
    grid-template-columns: 86px 1fr 86px;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: #fff;
}

.phone-topbar .touch-button {
    position: relative;
    min-height: 58px;
    padding: 6px;
    border-radius: 8px;
}

.phone-screen {
    min-height: 0;
    overflow: auto;
    padding: 12px;
}

.phone-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.phone-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.phone-list,
.order-form {
    display: grid;
    gap: 10px;
}

.touch-card.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.phone-topbar .touch-button.is-active {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.product-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    width: 100%;
    min-height: 64px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.product-row:hover {
    background: var(--surface-soft);
}

.order-form h2 {
    margin: 0;
}

.product-accordion {
    display: grid;
    gap: 8px;
}

.product-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.product-group summary {
    min-height: 42px;
    padding: 10px 12px;
    cursor: pointer;
    font-weight: 800;
    background: #eef3f9;
}

.product-group--child {
    margin: 8px;
    border-color: #e8edf5;
}

.product-group--child summary {
    background: #f8fafc;
}

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

.current-order-list {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.current-order-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
    min-height: 58px;
    padding: 10px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.current-order-row:first-child {
    border-top: 0;
}

.current-order-row--prepared {
    background: #f0fdf4;
}

.current-order-row--served {
    background: #f8fafc;
    opacity: 0.82;
}

.waiter-product-row__title {
    min-width: 0;
}

.waiter-product-row__title small,
.draft-summary small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
}

.quantity-stepper,
.row-tools,
.service-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quantity-stepper {
    min-width: 116px;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
}

.quantity-stepper .icon-button {
    width: 34px;
    height: 34px;
}

.service-switch {
    grid-column: 1 / -1;
    width: fit-content;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.service-switch button {
    width: 34px;
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    font-weight: 800;
}

.service-switch button.is-active {
    background: var(--primary);
    color: #fff;
}

.complement-picker {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.draft-summary {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.draft-variants {
    grid-column: 1 / -1;
    display: grid;
    gap: 6px;
}

.draft-variant {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
}

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

.central-alert-list {
    display: grid;
    gap: 8px;
}

.central-alert {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-left: 5px solid #ef4444;
    border-radius: 8px;
    background: #fff;
}

.central-alert.is-read {
    border-left-color: var(--line);
    opacity: 0.72;
}

.central-alert__main {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 50px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

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

.ticket-line--alert {
    background: #fee2e2;
    outline: 2px solid rgba(239, 68, 68, 0.35);
    outline-offset: -2px;
}

.order-form label,
.check-list {
    display: grid;
    gap: 7px;
    color: #344054;
    font-weight: 700;
}

.order-form select,
.order-form textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.check-list label {
    grid-template-columns: auto 1fr;
    align-items: center;
    min-height: 36px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.filter-panel {
    margin-bottom: 18px;
}

.filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr)) auto;
    gap: 10px;
    align-items: center;
}

.filter-form--short {
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 260px) auto;
}

.filter-form input,
.filter-form select,
.inline-edit-row input,
.inline-edit-row select,
.compact-form input,
.compact-form select {
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}

.compact-list {
    display: grid;
    gap: 8px;
}

.inline-edit-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}

.inline-edit-row--category {
    grid-template-columns: minmax(150px, 1fr) minmax(150px, 220px) minmax(180px, 1fr) 90px 92px auto;
}

.inline-edit-row--preparation {
    grid-template-columns: minmax(180px, 1fr) auto;
}

.row-delete-form {
    margin: -4px 0 8px;
}

.row-details {
    min-width: 150px;
}

.row-details summary {
    cursor: pointer;
    color: var(--primary);
    font-weight: 700;
}

.compact-form {
    min-width: 280px;
    margin-top: 10px;
}

.compact-form-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) repeat(4, minmax(140px, 1fr)) auto;
    align-items: center;
}

.compact-form-row--table {
    grid-template-columns: minmax(180px, 1fr) minmax(160px, 240px) 100px 100px 150px auto;
}

.compact-form-row--area {
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) 110px auto;
}

.compact-form-row--customer {
    grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
}

.form-grid {
    display: grid;
    gap: 12px;
}

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

.form-grid__full {
    grid-column: 1 / -1;
}

.edit-row {
    display: none;
}

.edit-row.is-open {
    display: table-row;
}

.edit-row td {
    background: #f8fafc;
}

.modal {
    width: min(560px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
}

.modal--wide {
    width: min(860px, calc(100vw - 32px));
}

.tpv-modal[data-tpv-dialog="operations"] {
    width: min(980px, calc(100vw - 24px));
}

.modal::backdrop {
    background: rgba(15, 23, 42, 0.35);
}

.modal-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 6px;
}

.operations-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
}

.operations-back {
    min-height: 42px;
    white-space: nowrap;
}

.operations-header h2 {
    justify-self: start;
}

.operation-lines {
    display: grid;
    gap: 8px;
    max-height: min(58vh, 520px);
    overflow-y: auto;
    padding-right: 2px;
}

.operation-line {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 84px auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.operation-line span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.operation-line small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.operation-line input[type="number"] {
    width: 100%;
    min-height: 40px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.operation-line em {
    color: var(--muted);
    font-style: normal;
    font-weight: 800;
    white-space: nowrap;
}

.transfer-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    min-height: min(60vh, 560px);
}

.transfer-column {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.transfer-column h3 {
    margin: 0;
    font-size: 16px;
}

.transfer-column__meta {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.transfer-list {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
}

.transfer-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.transfer-row strong,
.transfer-row small {
    display: block;
    overflow-wrap: anywhere;
}

.transfer-row small {
    margin-top: 3px;
    color: var(--muted);
}

.transfer-row__actions {
    display: grid;
    grid-template-columns: 44px 44px;
    gap: 8px;
}

.transfer-row__actions .icon-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.transfer-destination {
    display: grid;
    gap: 8px;
}

.transfer-destination-picker {
    display: grid;
    gap: 12px;
}

.transfer-destination__tables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    max-height: 150px;
    overflow-y: auto;
}

.transfer-selected-table {
    display: grid;
    gap: 6px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.transfer-selected-table strong,
.transfer-selected-table small {
    display: block;
}

.transfer-selected-table small {
    color: var(--muted);
    font-weight: 800;
}

.transfer-submit {
    align-self: end;
}

@media (max-width: 760px) {
    .transfer-board {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .transfer-column {
        max-height: none;
    }
}

.ticket-row--child td:first-child {
    border-left: 4px solid #2e90fa;
    padding-left: 12px;
}

.ticket-link-label {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.rich-toolbar {
    display: flex;
    gap: 6px;
}

.settings-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    font-weight: 700;
}

.checkbox-card--inline {
    width: fit-content;
}

.form-hint {
    margin: -6px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.balance-positive {
    color: #067647;
    font-weight: 800;
}

.balance-negative {
    color: #b42318;
    font-weight: 800;
}

.cash-count-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    min-width: min(720px, 100%);
}

.data-table .cash-count-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    min-width: 260px;
}

.cash-count-field {
    display: grid;
    gap: 6px;
}

.cash-lines {
    display: grid;
    gap: 5px;
    min-width: 190px;
}

.cash-lines div,
.cash-meta-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: baseline;
}

.cash-lines span,
.cash-lines em,
.cash-meta-line span {
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
    font-weight: 700;
}

.cash-lines strong,
.cash-lines em,
.cash-meta-line strong {
    text-align: right;
    white-space: nowrap;
}

.cash-meta-line--muted strong {
    color: var(--muted);
    font-weight: 700;
}

.is-invalid {
    border-color: #d92d20 !important;
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12);
}

.field-error {
    display: block;
    margin-top: 6px;
    color: #b42318;
    font-size: 0.9rem;
    font-weight: 800;
}

.tpv {
    --tpv-group-card-width: 142px;
    --tpv-group-card-height: 68px;
    --tpv-product-card-width: 164px;
    --tpv-product-card-height: 76px;
    --tpv-card-gap: 7px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
    height: calc(100vh - 92px);
    overflow: hidden;
}

.tpv-toolbar {
    display: grid;
    grid-template-columns: repeat(6, minmax(86px, 1fr));
    gap: 8px;
    min-height: 0;
}

.touch-button,
.touch-card {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 8px;
    min-height: 64px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    text-align: center;
}

.touch-button--primary,
.touch-card.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.touch-button--danger {
    color: #b42318;
}

.touch-button:disabled,
.touch-card:disabled {
    border-color: #cbd5e1;
    background: repeating-linear-gradient(135deg, #f2f4f7 0, #f2f4f7 8px, #e4e7ec 8px, #e4e7ec 16px);
    color: #98a2b3;
    cursor: not-allowed;
    opacity: 1;
    box-shadow: none;
}

.touch-button:disabled svg,
.touch-card:disabled svg {
    color: #98a2b3;
}

.tpv-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(360px, 0.8fr);
    gap: 10px;
    min-height: 0;
    overflow: hidden;
}

.tpv-catalog,
.tpv-ticket {
    min-width: 0;
    min-height: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.tpv-catalog {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 8px;
    overflow: hidden;
}

.tpv-catalog--no-subgroups {
    grid-template-rows: auto minmax(0, 1fr);
}

.tpv-band {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    min-height: 0;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 8px;
}

.tpv-band[hidden] {
    display: none;
}

.tpv-band--groups {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.tpv-band--subgroups {
    background: #f7f8f3;
    border-color: #e6e8d8;
}

.tpv-band--products {
    background: #f7f9fb;
    border-color: #dce7ef;
}

.tpv-section-title {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.touch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
    gap: var(--tpv-card-gap, 8px);
}

.tpv-carousel {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 7px;
    min-height: 0;
    overflow: hidden;
}

.tpv-carousel--single-row {
    height: calc(var(--tpv-group-card-height) + 8px);
}

.tpv-carousel--products {
    height: 100%;
}

.tpv-carousel__arrow {
    display: grid;
    place-items: center;
    width: 38px;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    cursor: pointer;
}

.tpv-carousel__arrow--tall {
    min-height: 100%;
}

.touch-grid--groups {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--tpv-group-card-width);
    grid-template-columns: none;
    grid-template-rows: 1fr;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.touch-grid--products {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: var(--tpv-product-card-width);
    grid-template-columns: none;
    grid-template-rows: repeat(auto-fill, var(--tpv-product-card-height));
    align-content: start;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.touch-grid--tables {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.tpv-table-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: -4px 0 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.tpv-table-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 24px;
}

.tpv-table-legend__swatch {
    width: 16px;
    height: 16px;
    border: 2px solid var(--line);
    border-radius: 4px;
}

.tpv-table-legend__swatch--free {
    border-color: #12b76a;
    background: #ecfdf3;
}

.tpv-table-legend__swatch--busy {
    border-color: #f04438;
    background: #fff1f3;
}

.tpv-table-legend__swatch--linked {
    border-color: #2e90fa;
    background: linear-gradient(135deg, #eff8ff 0 48%, #d1e9ff 48% 100%);
}

.touch-card--table {
    position: relative;
    border-width: 2px;
}

.touch-card--free {
    border-color: #12b76a;
    background: #ecfdf3;
}

.touch-card--busy {
    border-color: #f04438;
    background: #fff1f3;
}

.touch-card--linked {
    border-color: #2e90fa;
    background: #eff8ff;
}

.touch-card--table.is-active {
    box-shadow: 0 0 0 3px rgba(46, 144, 250, 0.18);
}

.touch-card--free.is-active {
    background: #ecfdf3;
    color: var(--text);
}

.touch-card--busy.is-active {
    background: #fff1f3;
    color: var(--text);
}

.touch-card--linked.is-active {
    background: #eff8ff;
    color: var(--text);
}

.touch-card--free small {
    color: #067647;
}

.touch-card--busy small {
    color: #b42318;
}

.touch-card--linked small {
    color: #175cd3;
}

.touch-product {
    position: relative;
    width: var(--tpv-product-card-width);
    height: var(--tpv-product-card-height);
    min-height: 0;
    scroll-snap-align: start;
}

.touch-product .touch-card {
    width: 100%;
    height: 100%;
}

.touch-product--addons .touch-card {
    padding-right: 48px;
}

.touch-product__addons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 42px;
    height: calc(100% - 16px);
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    cursor: pointer;
}

.touch-card small {
    color: inherit;
    opacity: 0.75;
}

.touch-grid--groups .touch-card,
.touch-card--product {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.touch-grid--groups .touch-card {
    height: var(--tpv-group-card-height);
}

.touch-grid--groups .touch-card strong,
.touch-card--product strong {
    display: -webkit-box;
    max-width: 100%;
    overflow: hidden;
    line-height: 1.15;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tpv-ticket {
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    background: #fbfaf8;
    border-color: #e9e2d5;
}

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

.tpv-ticket__header select {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.ticket-lines {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
}

.ticket-line {
    display: grid;
    grid-template-columns: 40px 1fr auto 40px 40px;
    align-items: center;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.ticket-line--waiter {
    background: #fff;
}

.ticket-line--pending {
    border-color: #fed7aa;
    background: #fff7ed;
}

.ticket-line--prepared {
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.ticket-line--cancel {
    border-color: #fecaca;
    background: #fef2f2;
}

.ticket-line--alert {
    background: #fee2e2;
    outline: 2px solid rgba(239, 68, 68, 0.35);
    outline-offset: -2px;
}

.ticket-line__source {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 28px;
    border-radius: 8px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 800;
}

.ticket-line__state {
    display: grid;
    justify-items: end;
    gap: 4px;
    white-space: nowrap;
}

.tpv-ticket-actions {
    display: flex;
    gap: 6px;
}

.tpv-search {
    width: 100%;
    min-height: 44px;
    margin-bottom: 10px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.inline-form {
    display: inline-grid;
}

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

.tpv-totals,
.tpv-payment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
}

.payment-field {
    gap: 6px;
}

.payment-field__control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px 46px;
    gap: 12px;
    align-items: center;
}

.payment-field__control .icon-button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.payment-keypad {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafc;
}

.payment-keypad[hidden] {
    display: none;
}

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

.payment-keypad__header span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.payment-keypad__keys {
    display: grid;
    grid-template-columns: repeat(3, minmax(64px, 1fr));
    gap: 8px;
}

.payment-keypad__keys button {
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

.tpv-totals div,
.tpv-payment-summary div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: 8px;
    background: var(--surface-soft);
}

.tpv-totals div {
    justify-items: end;
    text-align: right;
}

.tpv-totals span,
.tpv-payment-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.tpv-totals strong {
    font-size: 28px;
}

.receipt__header {
    white-space: pre-line;
}

.tpv-closed {
    display: grid;
    justify-items: start;
    gap: 12px;
    max-width: 520px;
}

.receipt-print {
    display: none;
}

@media print {
    body * {
        visibility: hidden;
    }

    .receipt-print,
    .receipt-print * {
        visibility: visible;
    }

    .receipt-print {
        position: absolute;
        inset: 0 auto auto 0;
        display: block;
        width: 80mm;
        padding: 8mm;
        font-family: Arial, sans-serif;
        color: #000;
    }

    .receipt-line {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        margin: 6px 0;
    }

    .receipt-line--total {
        font-size: 18px;
        font-weight: 700;
    }
}

.checkbox-label {
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 8px !important;
}

.checkbox-label input {
    width: auto;
    min-height: auto;
}

.app-shell[data-sidebar-state="collapsed"] {
    grid-template-columns: 76px 1fr;
}

.app-shell[data-sidebar-state="collapsed"] .brand-text,
.app-shell[data-sidebar-state="collapsed"] .new-sale span,
.app-shell[data-sidebar-state="collapsed"] .nav-item span {
    display: none;
}

.app-shell[data-sidebar-state="collapsed"] .sidebar {
    padding-inline: 10px;
}

.app-shell[data-sidebar-state="collapsed"] .new-sale,
.app-shell[data-sidebar-state="collapsed"] .nav-item {
    justify-content: center;
    width: 44px;
    padding: 0;
}

svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

@media (max-width: 980px) {
    .metrics-grid,
    .work-grid {
        grid-template-columns: 1fr 1fr;
    }

    .panel--wide {
        grid-column: 1 / -1;
    }

    .topbar__actions .license-pill,
    .user-menu div {
        display: none;
    }
}

@media (max-width: 720px) {
    .app-shell,
    .app-shell[data-sidebar-state="collapsed"],
    .platform-shell {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .platform-sidebar {
        position: sticky;
        top: 0;
        z-index: 10;
        display: flex;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
    }

    .sidebar__brand {
        flex: 0 0 auto;
    }

    .new-sale {
        margin: 0;
    }

    .sidebar__nav {
        display: flex;
        gap: 4px;
    }

    .nav-item {
        flex: 0 0 auto;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
        padding: 12px;
    }

    .topbar__actions {
        margin-left: 0;
    }

    .content {
        margin-right: 0;
        padding: 18px;
        border-radius: 18px 18px 0 0;
    }

    .page-heading,
    .activity-row {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .page-heading {
        flex-direction: column;
    }

    .metrics-grid,
    .work-grid {
        grid-template-columns: 1fr;
    }

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

    .tpv-toolbar,
    .tpv-grid,
    .tpv-totals,
    .tpv-payment-summary {
        grid-template-columns: 1fr;
    }

    .activity-row time {
        text-align: left;
    }
}
