/* Owner panel — simple, large touch targets, works on phones. */
:root {
  --bg: #f4efe6; --surface: #fffdf9; --surface-2: #f1eadd; --ink: #1f2430; --muted: #646775; --line: #e2d8c6;
  --blue: #1d3a6e; --terra: #b0482a; --terra-h: #963b21; --ok: #1f7a4d; --ok-bg: #e6f4ec; --err: #a3271a; --err-bg: #fbe9e6; --warn-bg: #fff4d6;
  --radius: 12px; --font: "General Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --text-xs: 0.8125rem; --text-sm: 0.9375rem; --text-base: 1rem; --text-lg: 1.25rem; --text-xl: 1.6rem;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font: 400 var(--text-base)/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
h1 { font-size: var(--text-xl); line-height: 1.15; margin: 0 0 4px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: var(--text-lg); margin: 0 0 12px; font-weight: 600; }
p { margin: 0 0 12px; }
small, .small { font-size: var(--text-xs); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid #c99a3c; outline-offset: 2px; border-radius: 6px; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }

/* Layout */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.shell > * { min-width: 0; }
.side { background: var(--blue); color: #fff; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; }
.side-brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; font-weight: 600; padding: 4px 8px; }
.side-brand svg { width: 30px; height: 30px; flex: none; }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a { color: rgb(255 255 255 / 0.82); text-decoration: none; padding: 10px 12px; border-radius: 8px; font-weight: 500; font-size: var(--text-sm); }
.side-nav a:hover { background: rgb(255 255 255 / 0.08); color: #fff; }
.side-nav a[aria-current="page"] { background: #fff; color: var(--blue); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.side-foot .btn-ghost { color: #fff; background: transparent; border-color: rgb(255 255 255 / 0.4); }
.side-foot .btn-ghost:hover { background: rgb(255 255 255 / 0.1); border-color: #fff; }
.side-foot .btn-link { color: rgb(255 255 255 / 0.8); }
.main { padding: 28px clamp(16px, 4vw, 48px) 120px; max-width: 980px; width: 100%; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; top: 0; z-index: 20; height: auto; padding: 10px 12px; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
  .side-brand { padding: 4px; }
  .side-brand span { font-size: var(--text-sm); }
  .side-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .side-foot .btn-ghost { display: none; }
  .side-nav { order: 3; flex-direction: row; overflow-x: auto; width: 100%; gap: 6px; scrollbar-width: none; padding-bottom: 2px; }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-nav a { flex: none; padding: 8px 12px; background: rgb(255 255 255 / 0.08); border-radius: 999px; }
  .main { padding-top: 18px; }
}

/* Header */
.page-head { margin-bottom: 20px; }
.page-head p:first-child a { text-decoration: none; font-weight: 500; font-size: var(--text-sm); }
.head-row { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); margin-bottom: 16px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.card-head h2 { margin: 0; }
.card.empty { text-align: center; padding: 40px 20px; }
.card.danger { border-color: #f0c9c2; }
.pill { display: inline-block; font-size: var(--text-xs); font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); vertical-align: middle; }
.muted-pill { background: #e8e4dc; color: var(--muted); }

/* Forms */
label { display: block; font-weight: 600; font-size: var(--text-sm); margin-bottom: 14px; }
label small, .photo-field small { display: block; font-weight: 400; color: var(--muted); margin-top: 4px; }
.label { display: block; font-weight: 600; font-size: var(--text-sm); margin-bottom: 6px; }
input[type="text"], input:not([type]), input[type="email"], input[type="password"], input[type="tel"], input[type="time"], select, textarea {
  display: block; width: 100%; margin-top: 6px; min-height: 46px; padding: 10px 12px;
  font: 400 1rem/1.4 var(--font); color: var(--ink); background: #fff;
  border: 1px solid #cfc4b0; border-radius: 10px; transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgb(29 58 110 / 0.15); }
input[type="file"] { display: block; margin-top: 6px; font: inherit; font-size: var(--text-sm); max-width: 100%; }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px 6px; margin: 0 0 16px; }
legend { font-weight: 600; font-size: var(--text-sm); padding: 0 6px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.with-prefix { display: flex; align-items: center; margin-top: 6px; }
.with-prefix span { padding: 0 10px; min-height: 46px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid #cfc4b0; border-right: 0; border-radius: 10px 0 0 10px; font-weight: 600; }
.with-prefix input { margin-top: 0; border-radius: 0 10px 10px 0; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.inline-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-row input { margin-top: 0; }
form.inline { display: inline; margin: 0; }

/* Switch-style checkboxes */
.switch { display: flex; align-items: center; gap: 12px; font-weight: 500; cursor: pointer; margin: 6px 0 16px; }
.switch input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: #cfc4b0; position: relative; flex: none; cursor: pointer; transition: background 0.2s; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.2s; }
.switch input:checked { background: var(--ok); }
.switch input:checked::after { transform: translateX(18px); }
.switch.compact { margin: 0; min-width: 150px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; margin-top: 10px; }
.check input { width: 18px; height: 18px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 18px; border-radius: 999px; font: 600 var(--text-sm)/1 var(--font); text-decoration: none; border: 1.5px solid transparent; cursor: pointer; background: none; color: var(--ink); white-space: nowrap; }
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-h); }
.btn-ghost { border-color: #cfc4b0; background: #fff; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: var(--err); color: #fff; }
.btn-link { padding: 0 6px; min-height: 36px; text-decoration: underline; }
.btn-sm { min-height: 38px; padding: 0 14px; }
.btn-xs { min-height: 36px; min-width: 36px; padding: 0 10px; font-size: var(--text-xs); }
.btn-block { width: 100%; }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-weight: 500; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.err { background: var(--err-bg); color: var(--err); }
.alert.warn { background: var(--warn-bg); color: #6b4d00; }

/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px; transition: border-color 0.15s, transform 0.15s; }
.tile:hover { border-color: var(--blue); transform: translateY(-1px); }
.tile-kicker { font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--terra); }
.tile strong { font-size: var(--text-base); }
.tile-go { color: var(--blue); font-size: var(--text-sm); font-weight: 600; margin-top: auto; }
@media (max-width: 760px) { .tiles { grid-template-columns: 1fr; } }
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.checklist .tick { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #cfc4b0; display: grid; place-items: center; font-size: 14px; font-weight: 700; flex: none; }
.checklist li.done .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist li.done a { color: var(--muted); text-decoration: line-through; }
.tips { margin: 0; padding-left: 20px; }
.tips li { margin-bottom: 6px; }

/* Special preview */
.special-preview { background: var(--blue); color: #fff; padding: 14px 16px; border-radius: 10px; margin-top: 8px; font-size: var(--text-sm); }
.special-preview .sp-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; border: 1px solid rgb(255 255 255 / 0.5); padding: 2px 8px; border-radius: 4px; margin-right: 6px; }

/* Menu list */
.dish-list { list-style: none; margin: 0; padding: 0; }
.dish { display: grid; grid-template-columns: 1fr 120px auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.dish.is-hidden .dish-main { opacity: 0.55; }
.dish-main { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); min-width: 0; }
.dish-main img, .thumb-empty { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; flex: none; background: var(--surface-2); }
.thumb-empty { border: 1px dashed #cfc4b0; }
.dish-text { min-width: 0; }
.dish-text strong { display: block; }
.dish-text small { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dish-main:hover strong { text-decoration: underline; }
.star { color: var(--terra); }
.price-field { display: flex; align-items: center; margin: 0; }
.price-field .dollar { padding: 0 8px; min-height: 42px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid #cfc4b0; border-right: 0; border-radius: 10px 0 0 10px; }
.price-field input { margin: 0; min-height: 42px; border-radius: 0 10px 10px 0; font-variant-numeric: tabular-nums; }
.price-field input.changed { border-color: var(--terra); background: #fff7f3; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .dish { grid-template-columns: 1fr 104px; }
  .dish .row-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
.sticky-save { position: sticky; bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--ink); color: #fff; padding: 10px 10px 10px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.2); margin-top: 8px; }
.sticky-save[hidden] { display: none; }

/* Photos */
.photo-row { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.photo-current { width: 160px; height: 120px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.photo-none { display: grid; place-items: center; color: var(--muted); font-size: var(--text-sm); border: 1px dashed #cfc4b0; }
.photo-field { margin-bottom: 16px; }
.photo-wide { width: 100%; max-width: 420px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.photo-tall { width: 140px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; display: block; background: var(--surface-2); }
.photo-preview-new { outline: 3px solid var(--ok); }

/* Hours */
.hours-row { display: grid; grid-template-columns: 170px 1fr auto 1fr; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.hours-row .time { margin: 0; }
.hours-row .time input { margin: 0; }
.hours-row .to { color: var(--muted); font-size: var(--text-sm); }
.hours-row .closed-label { display: none; color: var(--muted); font-weight: 500; grid-column: 2 / -1; }
.hours-row.is-closed .time, .hours-row.is-closed .to { display: none; }
.hours-row.is-closed .closed-label { display: block; }
@media (max-width: 520px) { .hours-row { grid-template-columns: 1fr 1fr; } .hours-row .switch { grid-column: 1 / -1; } .hours-row .to { display: none; } }

/* Links */
.link-row { display: grid; grid-template-columns: 160px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.link-row label { margin: 0; }
.link-row input { margin: 0; }
@media (max-width: 640px) { .link-row { grid-template-columns: 1fr; } .link-row .row-actions { justify-content: flex-start; } }

/* Reviews & users */
.review-list, .user-list { list-style: none; margin: 0; padding: 0; }
.review-list li, .user-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.review-list li.is-hidden { opacity: 0.6; }
.review-main { display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; flex: 1 1 300px; }
.review-main small { color: var(--muted); }
.stars { color: #c99a3c; letter-spacing: 2px; }

/* Login / install */
.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--blue); }
.auth-card { background: var(--surface); border-radius: 16px; padding: clamp(24px, 5vw, 40px); width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgb(0 0 0 / 0.25); }
.auth-brand { color: var(--blue); padding: 0; margin-bottom: 20px; }
.auth-card form { margin: 20px 0 12px; }
.auth-card ol { padding-left: 20px; }

.reset summary { list-style: none; }
.reset summary::-webkit-details-marker { display: none; }
.reset[open] { flex-basis: 100%; }
.reset[open] form { margin-top: 8px; }

/* Website visibility card: highlighted while the coming soon page is showing */
.visibility-card.is-hidden-site { border-color: #c98a2b; box-shadow: inset 4px 0 0 #c98a2b; }
.visibility-card.is-hidden-site .pill { background: #f6e3c2; color: #6b4410; }
