/* The owner dashboard. Same look as the marketing site: forest, cream and butter, Figtree.
   Tokens copied from apps/site/src/styles/tokens.css (keep them in step with the site). */
@font-face { font-family: "Figtree"; src: url("/app/assets/fonts/figtree-latin.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
:root {
  --forest: #173a2e; --cream: #f3ede0; --butter: #e9b949; --white: #fff;
  --muted: #55625a; --on-dark-muted: #c9cfc4; --rule: rgba(23,58,46,.16); --wash: #ece5d5;
  --error: #9b2c1f; --error-bg: #fbeae6; --success-bg: #e6eee4; --warn-bg: #fbf1d6;
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 10px; --r-md: 16px; --r-pill: 999px; --touch: 44px;
  --shadow: 0 1px 2px rgba(23,58,46,.06), 0 18px 40px -26px rgba(23,58,46,.35);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--cream); color: var(--forest); font: 400 1rem/1.5 var(--font); }
h1 { font-size: 1.9rem; line-height: 1.15; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin: 28px 0 10px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: var(--forest); }
.muted { color: var(--muted); } .small { font-size: .9rem; } .num { text-align: right; font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--butter); padding: 8px 12px; border-radius: 8px; z-index: 50; }
:focus-visible { outline: 3px solid var(--butter); outline-offset: 2px; }

/* ---- Layout: sidebar + content ---- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--forest); color: var(--cream); padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.logo { color: var(--cream); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; text-decoration: none; padding: 0 10px; }
.logo-sm { font-weight: 700; font-size: 1.2rem; }
.biz { color: var(--on-dark-muted); font-size: .9rem; padding: 0 10px 14px; margin: 0; border-bottom: 1px solid rgba(243,237,224,.22); }
nav { display: flex; flex-direction: column; gap: 2px; margin-top: 10px; }
nav a { color: var(--cream); text-decoration: none; padding: 10px 12px; border-radius: var(--r-sm); font-weight: 500; display: flex; gap: 10px; align-items: center; }
nav a[href="/app/settings"] { margin-top: 14px; border: 1.5px solid rgba(243,237,224,.4); }
nav a[href="/app/settings"]::before { content: "\2699"; font-size: 1.1rem; }
nav a:hover { background: rgba(243,237,224,.1); }
nav a[aria-current="page"] { background: var(--butter); color: var(--forest); font-weight: 700; }
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(243,237,224,.22); color: var(--on-dark-muted); font-size: .85rem; display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
.link { background: none; border: 0; color: var(--cream); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; text-align: left; }
.content { min-width: 0; }
.top { display: none; align-items: center; gap: 12px; padding: 12px 16px; background: var(--forest); color: var(--cream); }
.top .btn { border-color: var(--cream); color: var(--cream); }
main { padding: 28px clamp(16px, 3vw, 40px) 80px; max-width: 1280px; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  /* The slide-out menu. "100vh" on a phone is taller than the visible screen (the browser bars cover the bottom), so the
     menu sizes itself to the visible height (dvh) and scrolls inside, with room for the phone's bottom edge. */
  .side { position: fixed; top: 0; bottom: 0; left: 0; height: auto; max-height: 100vh; max-height: 100dvh; width: min(280px, 86vw); z-index: 40;
          overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding-bottom: calc(28px + env(safe-area-inset-bottom));
          transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .side nav a { min-height: 46px; }
  .top { display: flex; position: sticky; top: 0; z-index: 30; }
  .scrim { position: fixed; inset: 0; background: rgba(23,58,46,.5); z-index: 35; display: none; }
  body.menu-open .scrim { display: block; }
  body.menu-open { overflow: hidden; } /* the page behind does not scroll while the menu is open */
}
@media (min-width: 861px) { .scrim { display: none; } }
body.bare .shell { grid-template-columns: 1fr; } body.bare .side, body.bare .top { display: none; }
body.bare main { margin: 0 auto; max-width: 480px; padding-top: 8vh; }
body.wide main { max-width: 640px; padding-top: 4vh; padding-bottom: 6vh; }
.lock-banner { background: var(--butter); color: var(--forest); padding: 12px 20px; } .lock-banner p { margin: 0; display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; } .lock-banner[hidden] { display: none; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: .92rem; } .check input { margin-top: 4px; width: 18px; height: 18px; flex: none; }
.login-card h2 { font-size: 1.05rem; margin: 22px 0 10px; } .login-card h2:first-of-type { margin-top: 14px; }

/* ---- Buttons and forms ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--touch); padding: 0 20px; border-radius: var(--r-pill); border: 1.5px solid transparent; background: var(--forest); color: var(--cream); font: 600 .98rem/1 var(--font); cursor: pointer; text-decoration: none; }
.btn:hover { background: #0e271e; }
.btn-quiet { background: transparent; border-color: var(--forest); color: var(--forest); } .btn-quiet:hover { background: var(--forest); color: var(--cream); }
.btn-primary { background: var(--forest); color: var(--cream); }
.btn-butter { background: var(--butter); color: var(--forest); } .btn-butter:hover { background: #d9aa3a; }
.btn-danger { background: transparent; border-color: var(--error); color: var(--error); } .btn-danger:hover { background: var(--error); color: #fff; }
.btn.small, .btn-small { min-height: 36px; padding: 0 14px; font-size: .88rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.field { display: grid; gap: 4px; margin-bottom: 12px; font-weight: 600; font-size: .92rem; }
.field .hint { font-weight: 400; color: var(--muted); }
input, select, textarea { width: 100%; min-height: var(--touch); padding: 8px 12px; border: 1.5px solid var(--rule); border-radius: var(--r-sm); background: var(--white); color: var(--forest); font: 400 1rem var(--font); }
input:focus, select:focus, textarea:focus { border-color: var(--forest); outline: none; box-shadow: 0 0 0 3px rgba(233,185,73,.55); }
input[type=checkbox] { width: 20px; min-height: 20px; accent-color: var(--forest); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > * { flex: 1 1 140px; } .row .btn { flex: 0 0 auto; }
form.inline { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 14px; align-items: end; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }

/* ---- Cards, tables, pills, notices ---- */
.card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin: 14px 0; }
.stat .label { color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--rule); border-radius: var(--r-md); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td .btn { margin-right: 6px; }
.pill { display: inline-block; padding: 1px 9px; border-radius: 6px; font-size: .8rem; font-weight: 700; background: var(--wash); }
.pill.active, .pill.completed, .pill.free, .pill.booked_ok, .pill.ready { background: var(--success-bg); }
.pill.canceled, .pill.cancelled, .pill.occupied { background: var(--error-bg); color: var(--error); }
.pill.booked, .pill.preparing, .pill.confirmed, .pill.draft { background: var(--warn-bg); }
.notice { padding: 10px 14px; border-radius: var(--r-sm); margin: 0 0 14px; background: var(--wash); }
.notice.error { background: var(--error-bg); color: var(--error); } .notice.success { background: var(--success-bg); }
.state { padding: 28px; text-align: center; color: var(--muted); background: var(--white); border: 1px dashed var(--rule); border-radius: var(--r-md); }
.state.error { color: var(--error); }
.page-head { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 8px; } .page-head > :first-child { margin-right: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 14px; }
.tabs button { background: var(--wash); border: 0; border-radius: var(--r-pill); padding: 8px 16px; font: 600 .92rem var(--font); color: var(--forest); cursor: pointer; }
.tabs button[aria-pressed="true"] { background: var(--forest); color: var(--cream); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; } @media (max-width: 980px) { .two { grid-template-columns: 1fr; } }

/* ---- Floor plan ---- */
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.tbl { border: 2px solid var(--rule); border-radius: var(--r-md); background: var(--white); padding: 14px; text-align: left; cursor: pointer; font: inherit; color: inherit; min-height: 118px; display: grid; gap: 4px; align-content: start; }
.tbl strong { font-size: 1.3rem; } .tbl.free { border-color: #7fb08f; } .tbl.booked { border-color: var(--butter); background: var(--warn-bg); } .tbl.occupied { border-color: var(--error); background: var(--error-bg); }
.tbl[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--forest); }

/* ---- POS ---- */
.pos { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; align-items: start; } @media (max-width: 980px) { .pos { grid-template-columns: 1fr; } }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.item-btn { background: var(--white); border: 1.5px solid var(--rule); border-radius: var(--r-md); padding: 14px 12px; text-align: left; font: inherit; color: inherit; cursor: pointer; min-height: 84px; display: grid; gap: 2px; align-content: space-between; }
.item-btn:hover { border-color: var(--forest); } .item-btn[disabled] { opacity: .45; cursor: not-allowed; } .item-btn .price { color: var(--muted); font-weight: 600; }
.cart { position: sticky; top: 16px; } .cart ul { list-style: none; padding: 0; margin: 0 0 12px; } .cart li { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.cart li span:first-child { flex: 1; } .qty { display: inline-flex; align-items: center; gap: 6px; } .qty button { width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--forest); background: none; font-size: 1.1rem; cursor: pointer; color: var(--forest); }
.total { display: flex; justify-content: space-between; font-size: 1.3rem; font-weight: 700; margin: 12px 0; }
.till-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r-md); margin-bottom: 14px; background: var(--success-bg); } .till-bar.closed { background: var(--warn-bg); } .till-bar .btn { margin-left: auto; }

/* ---- Kitchen ---- */
.tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.ticket { background: var(--white); border: 2px solid var(--forest); border-radius: var(--r-md); padding: 14px; } .ticket.old { border-color: var(--error); } .ticket.bumped { opacity: .6; border-color: var(--rule); }
.ticket h3 { display: flex; justify-content: space-between; } .ticket ul { margin: 6px 0 12px; padding-left: 18px; }

/* ---- Drawer / dialog / login ---- */
dialog { border: 0; border-radius: var(--r-md); padding: 22px; max-width: min(92vw, 460px); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); background: var(--cream); color: var(--forest); }
dialog::backdrop { background: rgba(23,58,46,.55); }
.login-brand { font-weight: 700; font-size: 2rem; letter-spacing: -.02em; text-align: center; margin-bottom: 18px; }
.login-card { padding: 28px; } .secret { font: 600 1.05rem var(--font); letter-spacing: .08em; background: var(--wash); padding: 10px 12px; border-radius: var(--r-sm); overflow-wrap: anywhere; user-select: all; } .mono { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; overflow-wrap: anywhere; }
.login-card .btn { width: 100%; margin-top: 6px; }
@media print { .side, .top { display: none; } .shell { display: block; } }

/* The two-step setup QR code */
.qr { display: block; width: 220px; max-width: 70%; height: auto; margin: 12px auto; border-radius: 8px; border: 1px solid var(--rule); }

/* Small helpers (the page policy forbids inline style attributes, so spacing and such live here) */
.mt0 { margin-top: 0; } .mt-sm { margin-top: 12px; } .mt-md { margin-top: 14px; } .mt-lg { margin-top: 18px; } .mt-xl { margin-top: 20px; } .mb-lg { margin-bottom: 18px; }
.spacer { height: 12px; } .w90 { width: 90px; } .bold { font-weight: 700; } .wrap { flex-wrap: wrap; } .flex8 { display: flex; gap: 8px; }
.err-text { color: var(--error); } .link-forest { color: var(--forest); } .link-note { color: var(--forest); flex-basis: 100%; font-size: .85rem; }
.code-input { text-transform: uppercase; letter-spacing: .12em; } .big-code { font-size: 1.6rem; letter-spacing: .14em; }
.center-note { margin-top: 14px; text-align: center; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 6px; margin-bottom: 14px; }
.inline-check { display: flex; gap: 8px; align-items: center; } .choice { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.plain-set { border: 0; padding: 0; margin: 0 0 12px; } .dialog-wide { max-width: min(94vw, 640px); }
.transcript { white-space: pre-wrap; font: inherit; margin: 8px 0 0; }
.receipt { font: 13px/1.35 ui-monospace, Menlo, monospace; overflow: auto; margin: 0 0 12px; }
