/* SeeOurMenu — owner panel + master console. */
:root {
  --bg: #f6f5f2; --surface: #fff; --text: #1c1b19; --muted: #6b6860; --line: #e4e1da;
  --brand: #c2410c; --on-brand: #fff; --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --info: #1d4ed8;
  --radius: 14px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .strong { font-weight: 650; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .01em; overflow-wrap: anywhere; }
.grow { flex: 1; } .center { text-align: center; } .text-bad { color: var(--bad); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* shell */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.top-in { display: flex; align-items: center; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 10px 16px; }
.top form { margin: 0; }
.brand { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; color: var(--text); text-decoration: none; white-space: nowrap; }
.brand span { color: var(--brand); }
.top-name { color: var(--muted); font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tabsnav { display: flex; gap: 4px; max-width: 1120px; margin: 0 auto; padding: 0 10px; overflow-x: auto; scrollbar-width: none; }
.tabsnav::-webkit-scrollbar { display: none; }
.tabsnav a { padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; white-space: nowrap; border-bottom: 3px solid transparent; }
.tabsnav a[aria-current] { color: var(--text); border-color: var(--brand); }
.imp-bar { background: #1c1b19; color: #fff; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; justify-content: center; padding: 8px 14px; font-size: .9rem; }
.imp-bar form { margin: 0; } .imp-bar .link-btn { color: #fdba74; }
.page { max-width: 880px; margin: 0 auto; padding: 22px 16px 80px; display: grid; gap: 18px; }
.page.wide { max-width: 1120px; }
.page > * { min-width: 0; }
.h1 { font-size: clamp(1.5rem, 5vw, 1.9rem); letter-spacing: -.02em; line-height: 1.2; }
.head-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.head-row .row { margin-top: 6px; }

/* building blocks */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 1.15rem; letter-spacing: -.01em; }
.card h3 { font-size: 1rem; }
.narrow-card { max-width: 620px; }
.stack { display: grid; gap: 14px; align-content: start; }
.stack > * { min-width: 0; }
.row { display: flex; align-items: center; } .row.gap, .gap { gap: 10px; } .row.wrap, .wrap { flex-wrap: wrap; } .row.end { align-items: flex-end; } .row.center { justify-content: center; }
.cols { display: grid; gap: 18px; }
.cols > * { min-width: 0; }
.grid2, .grid3 { display: grid; gap: 14px; }
.pad { padding: 0 4px; }
.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 .95rem var(--font); text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { border-color: #c9c5bb; }
.button.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.button.primary:hover { filter: brightness(1.06); }
.button.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.button.small { min-height: 36px; padding: 0 12px; font-size: .875rem; }
.button.big { min-height: 50px; padding: 0 24px; font-size: 1rem; }
.link-btn { background: none; border: 0; padding: 6px 2px; color: var(--muted); font: 600 .9rem var(--font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link-btn.danger { color: var(--bad); }
:focus-visible { outline: 2px solid var(--info); outline-offset: 2px; }

label, .label { display: grid; gap: 6px; font-size: .9rem; font-weight: 600; color: #3d3b37; }
.label { margin-bottom: 6px; }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #cfcbc2; border-radius: 10px; background: #fff; color: var(--text); font: 400 1rem var(--font); }
textarea { resize: vertical; min-height: 64px; }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; padding: 0; accent-color: var(--brand); flex: none; }
input[type="color"] { padding: 4px; height: 44px; }
input[type="file"] { padding: 8px; background: #faf9f7; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 0; border-color: var(--brand); }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; display: grid; gap: 10px; min-width: 0; }
legend { font-weight: 650; font-size: .9rem; padding: 0 6px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; min-height: 32px; }
.narrow { max-width: 220px; }
.affix { display: flex; align-items: stretch; }
.affix input { border-radius: 10px 0 0 10px; min-width: 0; }
.affix span { display: flex; align-items: center; padding: 0 12px; border: 1px solid #cfcbc2; border-left: 0; border-radius: 0 10px 10px 0; background: #f3f1ec; color: var(--muted); font-weight: 500; white-space: nowrap; }
.copyrow { display: flex; gap: 8px; } .copyrow input { min-width: 0; background: #faf9f7; font-size: .9rem; }
.tr-field { display: grid; gap: 8px; }
.tr-row { display: flex; align-items: flex-start; gap: 8px; }
.tr-lang { flex: none; width: 34px; margin-top: 11px; font-size: .72rem; font-weight: 700; color: var(--muted); text-align: center; background: #f0eee9; border-radius: 6px; padding: 3px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chipcheck { display: inline-flex; position: relative; }
.chipcheck input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.chipcheck span { padding: 8px 14px; border-radius: 999px; border: 1px solid #cfcbc2; font-weight: 600; font-size: .9rem; }
.chipcheck input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chipcheck input:focus-visible + span { outline: 2px solid var(--info); outline-offset: 2px; }
.price-box { display: inline-flex; align-items: center; flex-direction: row; gap: 0; border: 1px solid #cfcbc2; border-radius: 10px; background: #fff; padding-left: 10px; width: 104px; }
.price-box span { color: var(--muted); font-weight: 600; }
.price-box input { border: 0; min-height: 40px; padding: 6px 8px 6px 4px; background: transparent; font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.price-box input:focus { outline: 0; } .price-box:focus-within { border-color: var(--brand); outline: 2px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.price-box.big { width: 100%; max-width: 220px; }
.preview { border-radius: 12px; max-height: 200px; border: 1px solid var(--line); } .preview.small { max-height: 96px; background: #fff; }
.filter { max-width: 360px; }

.flash { padding: 12px 14px; border-radius: 12px; font-weight: 500; border: 1px solid; }
.flash-ok { background: #f0fdf4; border-color: #bbf7d0; color: #14532d; }
.flash-error { background: #fef2f2; border-color: #fecaca; color: #7f1d1d; }
.flash-warn { background: #fffbeb; border-color: #fde68a; color: #78350f; }
.flash-info { background: #eff6ff; border-color: #bfdbfe; color: #1e3a8a; }
.credentials { display: grid; gap: 8px; justify-items: start; } .credentials p { line-height: 1.8; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: #efede8; color: #55524b; white-space: nowrap; }
.badge-ok { background: #dcfce7; color: #14532d; } .badge-warn { background: #fef3c7; color: #78350f; } .badge-bad { background: #fee2e2; color: #7f1d1d; }
.badge-plan-essential { background: #e7e5e0; } .badge-plan-premium { background: #ffedd5; color: #7c2d12; } .badge-plan-ultra { background: #1c1b19; color: #fff; }
.empty-note { padding: 36px 18px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed #cfcbc2; border-radius: var(--radius); }
.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #1c1b19; color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; z-index: 99; transition: opacity .4s, transform .4s; box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); } .toast.out { opacity: 0; transform: translate(-50%, 10px); }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 2px; }
.stat b { font-size: 1.7rem; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .875rem; }
.stat.warn b { color: var(--warn); } .stat.bad b { color: var(--bad); }
.counter { font-size: 1.05rem; } .counter b { font-size: 1.8rem; } .counter.over b { color: var(--bad); }

.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); }
.table thead th { border-top: 0; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf9f7; white-space: nowrap; }
.table .num { text-align: right; }
.card:not(.flush) > .table th, .card:not(.flush) > .table td { padding-inline: 0 12px; }
.actions-cell { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; align-items: center; }
.actions-cell form { margin: 0; }
.bar-cell { width: 60%; } .bar { display: block; height: 10px; border-radius: 5px; background: var(--brand); min-width: 4px; }

/* QR */
.qr { width: 220px; max-width: 100%; margin: 4px auto; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: 14px; aspect-ratio: 1; }
.qr svg { display: block; width: 100%; height: 100%; }
.qr.small { width: 132px; border-radius: 10px; padding: 5px; }
.qr.tiny { width: 60px; padding: 2px; border-radius: 6px; margin: 6px 0 0; }
.card.center { display: grid; gap: 10px; justify-items: center; align-content: start; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.qr-card { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 14px 10px; border: 1px solid var(--line); border-radius: 12px; align-content: start; }
.qr-card .row { flex-wrap: wrap; margin-top: 6px; gap: 6px; }
.inline-edit { margin-top: 12px; padding: 14px; background: #faf9f7; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 10px; text-align: left; width: 100%; }
.inline-edit.left { min-width: 260px; }
.danger-zone { border-color: #fecaca; }

/* menu editor */
#cats { display: grid; gap: 18px; }
#cats:empty { display: none; }
.cat-card { padding: 0; overflow: hidden; }
.cat-card.is-hidden .cat-bar h2 { opacity: .55; }
.cat-bar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; flex-wrap: wrap; background: #faf9f7; border-bottom: 1px solid var(--line); }
.cat-bar h2 { font-size: 1.1rem; }
.count { font-size: .8rem; color: var(--muted); background: #ebe8e1; border-radius: 999px; padding: 1px 8px; font-weight: 650; }
.cat-card > .inline-edit { margin: 14px 16px; width: auto; }
.handle { cursor: grab; color: #aaa69c; font-size: 1.15rem; padding: 6px 4px; user-select: none; touch-action: none; }
.rows { list-style: none; margin: 0; padding: 0; min-height: 6px; }
.rowitem { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.rowitem:last-child { border-bottom: 0; }
.rowitem.sortable-ghost, .cat-card.sortable-ghost { opacity: .35; }
.ri-name { flex: 1; min-width: 0; font-weight: 550; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ri-name a { color: var(--text); text-decoration: none; } .ri-name a:hover { text-decoration: underline; }
.rowitem.is-sold .ri-name a, .rowitem.is-sold .ri-name > span:first-child { text-decoration: line-through; color: var(--muted); }
.rowitem.is-hidden .ri-name { opacity: .55; }
.mini { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }
.switch { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; cursor: pointer; position: relative; font-weight: 600; font-size: .8rem; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 44px; height: 26px; min-height: 0; margin: 0; cursor: pointer; }
.track { width: 44px; height: 26px; border-radius: 999px; background: #d6d2c8; position: relative; transition: background .15s; flex: none; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--bad); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--info); outline-offset: 2px; }
.switch-label { display: none; }
.hours-form { display: grid; gap: 10px; }
.hrow { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.hrow .times { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.hrow .times.second { opacity: .75; }

/* auth */
body.auth { min-height: 100svh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 24px; display: grid; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.06); }
.auth-card h1 { font-size: 1.5rem; letter-spacing: -.02em; } .auth-card h2 { font-size: 1.05rem; margin-top: 6px; }
.auth-langs { display: flex; gap: 14px; justify-content: center; font-size: .9rem; }
.auth-langs a { color: var(--muted); } .auth-langs a[aria-current] { color: var(--text); font-weight: 700; text-decoration: none; }

/* print sheet */
.print-page { background: #e9e7e1; }
.print-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; padding: 18px; max-width: 1100px; margin: 0 auto; }
.tent { background: #fff; border-radius: 14px; overflow: hidden; text-align: center; display: grid; gap: 8px; padding-bottom: 14px; break-inside: avoid; border: 1px solid #d8d4ca; }
.tent-top { background: var(--brand); color: var(--on-brand); font-weight: 800; font-size: 1.25rem; padding: 14px 10px; letter-spacing: -.01em; }
.tent-cta { font-weight: 700; font-size: 1.02rem; padding: 4px 10px 0; } .tent-cta span { display: block; font-weight: 500; font-size: .82rem; color: var(--muted); }
.tent .qr { width: 78%; border: 0; padding: 0; }
.tent-table { font-weight: 800; font-size: 1.3rem; }
.tent-url { font: 600 .82rem ui-monospace, Menlo, Consolas, monospace; color: var(--muted); }

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .grid2 { grid-template-columns: 1fr 1fr; } .grid3 { grid-template-columns: repeat(3, 1fr); } .span2 { grid-column: span 2; }
  .cols { grid-template-columns: 1fr 1fr; }
  .switch-label { display: inline; }
  .hrow { grid-template-columns: 110px auto 1fr 1fr; } .hrow .times { grid-column: auto; }
  .page { padding-top: 28px; }
}
@media (max-width: 760px) {
  .top-name { display: none; }
  .cards-on-mobile thead { display: none; }
  .cards-on-mobile tr { display: grid; gap: 4px; padding: 14px; border-top: 1px solid var(--line); }
  .cards-on-mobile tr:first-child { border-top: 0; }
  .cards-on-mobile td { display: flex; justify-content: space-between; gap: 12px; padding: 2px 0; border: 0; text-align: right; }
  .cards-on-mobile td::before { content: attr(data-label); color: var(--muted); font-size: .85rem; text-align: left; }
  .cards-on-mobile td:first-child { display: block; text-align: left; } .cards-on-mobile td:first-child::before { content: none; }
  .cards-on-mobile .actions-cell { justify-content: flex-start; padding-top: 8px; } .cards-on-mobile .actions-cell::before { content: none; }
}
@media print {
  .no-print { display: none !important; }
  .print-page { background: #fff; }
  .sheet { padding: 0; gap: 10px; grid-template-columns: repeat(3, 1fr); }
  .tent { border: 1px dashed #999; border-radius: 0; }
  .tent-top { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
