:root {
    color-scheme: light;
    --bg: #e4edef;
    --header: #d8e5e8;
    --panel: #f6fafa;
    --ink: #19323d;
    --muted: #4c6772;
    --line: #bdd1d6;
    --primary: #087b70;
    --accent: #176f9e;
    --ok: #176b50;
    --bad: #a4313b;
    --shadow: 0 10px 28px rgb(25 50 61 / 7%);
}

.owner-alerts { position: fixed; right: 1rem; top: 1rem; width: min(390px, calc(100vw - 2rem)); max-height: 80vh; overflow-y: auto; z-index: 1000; }
.owner-alert { background: #fff; color: #17252b; border: 3px solid #2563eb; border-radius: 12px; padding: 1rem; margin-bottom: .75rem; box-shadow: 0 8px 30px #0004; }
.owner-alert.warning { border-color: #b77900; }
.owner-alert.urgent { border-color: #b91c1c; }
.owner-alert h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.owner-alert p { white-space: pre-wrap; overflow-wrap: anywhere; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink); font-family: "Segoe UI", system-ui, sans-serif; line-height: 1.45; }
a { color: var(--accent); }
button, .button, select, input { font: inherit; min-height: 44px; border-radius: 10px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; max-width: 100%; padding: 10px 17px; border: 1px solid var(--primary); background: var(--primary); color: #fff; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer; }
button:hover, .button:hover { background: #07685f; }
button.ghost { background: var(--panel); color: var(--ink); border-color: var(--line); }
button.ghost:hover { background: #eaf3f4; }
input, select { width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid #9eb8bf; background: #fff; color: var(--ink); }
:focus-visible { outline: 3px solid #28a7c0; outline-offset: 2px; }
input[aria-invalid="true"], select[aria-invalid="true"] { border: 2px solid var(--bad); }
.sending { opacity: .65; cursor: progress; }
label { display: grid; gap: 6px; font-size: .95rem; font-weight: 600; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; }
h2 { margin-bottom: 12px; font-size: 1.1rem; line-height: 1.3; }
p:last-child { margin-bottom: 0; }
main:not(.login-card) { width: min(100%, 1480px); margin: 0 auto; padding: 28px clamp(16px, 3vw, 40px) 48px; display: grid; gap: 20px; }
.top { position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); background: rgb(216 229 232 / 96%); box-shadow: 0 2px 12px rgb(25 50 61 / 5%); backdrop-filter: blur(12px); }
.top-inner { width: min(100%, 1480px); margin: auto; padding: 10px clamp(16px, 3vw, 40px); display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: var(--ink); font-size: 1rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.brand img { width: 44px; height: 44px; border-radius: 11px; object-fit: cover; }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-actions form { margin: 0; }
.unit-switch { display: block; min-width: 180px; }
.unit-switch select { font-weight: 600; }
.top nav { width: min(100%, 1480px); margin: auto; padding: 0 clamp(16px, 3vw, 40px) 10px; display: flex; flex-wrap: wrap; gap: 7px; }
.top nav a { display: inline-flex; min-height: 38px; align-items: center; padding: 7px 13px; border: 1px solid transparent; border-radius: 9px; color: var(--ink); font-size: .9rem; font-weight: 600; text-decoration: none; }
.top nav a:hover, .top nav a[aria-current="page"] { border-color: #9fc8c9; background: #eaf6f4; color: #075d58; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.banner { padding: 12px 14px; margin: 0; border: 1px solid; border-radius: 10px; }
.banner.ok { color: #165b46; background: #e2f4e9; border-color: #b5dfc6; }
.banner.warn { color: #795006; background: #fff4d8; border-color: #ebd59f; }
.banner.bad { color: #913039; background: #fff0ef; border-color: #eac1c3; }
.banner p { margin: 0; }
.banner p + p { margin-top: 6px; }
.connection-status { color: var(--muted); font-size: .85rem; margin: 0; }
.connection-status.offline { color: var(--bad); border: 1px solid var(--bad); padding: 10px; border-radius: 10px; background: #fff0ef; }
.muted, .eyebrow { color: var(--muted); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.stats, .split, .table-grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stats article, .ticket, .stack, .line, .split > article, .dashboard-queue, .login-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: var(--shadow); }
.stats article { display: grid; align-content: space-between; gap: 10px; min-height: 110px; }
.stats span { color: var(--muted); font-size: .9rem; }
.stats strong { font-size: clamp(1.4rem, 2vw, 1.8rem); line-height: 1.2; overflow-wrap: anywhere; }
.total { font-size: 1.6rem; font-weight: 800; }
.split { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.split > article { min-height: 150px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-width: 0; }
.row > :first-child { min-width: 0; overflow-wrap: anywhere; }
.row > :last-child { flex-shrink: 0; }
.row > input, .row > select { width: auto; flex: 1 1 130px; }
.catalog-controls { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.catalog-product { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: grid; gap: 10px; background: var(--panel); }
.catalog-product .row > input[data-order-quantity] { flex: 0 0 90px; width: 90px; }
.pagination nav { display: flex; flex-wrap: wrap; gap: 8px; }
.table-grid { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.table-card { width: 100%; min-height: 116px; display: grid; place-items: center; gap: 4px; color: var(--ink); box-shadow: var(--shadow); }
.table-card strong { font-size: 1.8rem; }
.status-available { background: #e1f4e9; border-color: #97cbae; }
.status-occupied { background: #fff0e5; border-color: #dfb18d; }
.status-reserved { background: #e7f0fb; border-color: #a4bfd8; }
.status-closing { background: #fff5d9; border-color: #d9c483; }
.table-card:hover { color: var(--ink); filter: brightness(.97); }
.line { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.line small, .line span { display: block; color: var(--muted); }
.line.cancelled { opacity: .55; }
.product-add, .stack { display: grid; gap: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills a { padding: 9px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--ink); text-decoration: none; }
.pills a.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.dashboard-heading { display: grid; gap: 4px; }
.dashboard-heading p { margin: 0; color: var(--muted); }
.dashboard-queue { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.dashboard-queue > div { min-width: 0; }
.dashboard-queue > div + div { padding-left: 22px; border-left: 1px solid var(--line); }
.panel-calls, .panel-history { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.panel-calls form { margin: 0; }
.panel-history p:not(.muted) { margin: 0; padding: 7px 15px; border-radius: 9px; background: #e4f2f1; color: #075d58; font-size: 1.35rem; font-weight: 800; }
.login-body { display: grid; place-items: center; padding: 28px 16px; background: linear-gradient(145deg, #e4edef, #d5e6e7); }
.login-card { width: min(460px, 100%); display: grid; gap: 14px; padding: clamp(24px, 5vw, 36px); box-shadow: 0 18px 48px rgb(25 50 61 / 12%); }
.login-logo { display: block; width: min(100%, 320px); height: auto; margin: 0 auto 4px; border-radius: 12px; }
.login-card h1, .login-card > .eyebrow { text-align: center; }
.login-card > .muted { margin-bottom: 0; }
.login-card form { display: grid; gap: 14px; }
.login-card form.stack { border: 0; padding: 0; box-shadow: none; }
.login-card form .muted { margin: 0; text-align: right; }
.login-card form button { width: 100%; }
.panel { display: grid; justify-items: center; align-content: center; gap: 12px; padding: 24px; text-align: center; }
.panel section { width: min(100%, 800px); padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.panel-number { margin: 0; font-size: clamp(4rem, 12vw, 8rem); line-height: .9; font-weight: 800; }
.panel-label { color: var(--muted); text-transform: uppercase; letter-spacing: .3em; }
.check { display: flex; align-items: center; gap: 8px; }
.check input { width: auto; min-height: 0; }
.inline { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.inline label { flex: 1; min-width: 180px; }
.inline button { flex: 0 0 auto; }
.id-line { margin: 0; color: var(--muted); font: .85rem Consolas, ui-monospace, monospace; overflow-wrap: anywhere; }
.state-active { color: var(--ok); }
.state-grace { color: #8b6006; }
.state-locked { color: var(--bad); }
@media (max-width: 700px) {
    .catalog-controls { grid-template-columns: 1fr; }
    .row { flex-wrap: wrap; }
    form.row { display: grid; grid-template-columns: 1fr; }
    form.row > input, form.row > select { width: 100%; }
    .row > :last-child { flex-shrink: 1; }
    .row > strong { overflow-wrap: anywhere; }
    .brand { white-space: normal; }
    .top { position: static; }
    .top-inner { flex-wrap: wrap; }
    .header-actions { width: 100%; margin-left: 0; }
    .header-actions form:first-child { flex: 1; }
    .unit-switch { min-width: 0; }
    .top nav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; }
    .top nav a { flex-shrink: 0; }
    .dashboard-queue { grid-template-columns: 1fr; }
    .dashboard-queue > div + div { padding: 18px 0 0; border: 0; border-top: 1px solid var(--line); }
    .line { flex-wrap: wrap; }
}
