/*
 * The restaurant portal's own look.
 *
 * Every rule here sits under `.portal`, a class the dashboard shell carries
 * only for a tenant whose agent takes orders, and this file is only linked for
 * those tenants. A directory or a hotel never loads it, so nothing in here can
 * reach their dashboard.
 *
 * It is the design agreed on the canvas: warm paper, a serif for the things
 * you read first, one green. Light in every colour scheme, deliberately — the
 * design is a light one, and a half-translated dark version would be a second
 * design nobody drew.
 */
html:has(.portal), body:has(.portal) { background: #F6F2EA; }

.portal {
  color-scheme: light;
  --ground: #F6F2EA;
  --panel: #FFFDF8;
  --panel-2: #EDE7DB;
  --ink: #1E1B16;
  --ink-2: #3F3A32;
  --muted: #5E574C;
  --line: #DDD5C6;
  --line-strong: #BDB3A0;
  --brand: #1F6B4A;
  --brand-ink: #FFFFFF;
  --brand-soft: #E3EFE7;
  --good: #1F6B4A;
  --good-soft: #E3EFE7;
  --warn: #6B4A08;
  --warn-soft: #F2D9A0;
  --crit: #8A3B2A;
  --crit-soft: #F6E1DA;
  --focus: #1F6B4A;
  --shadow: none;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
  --alarm: #B3261E;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
}

/* ── the shell ─────────────────────────────────────────── */
.portal .sidebar { background: var(--panel-2); border-right: 0; padding: 32px 18px; gap: 14px; }
.portal .topbar { background: var(--panel-2); border-bottom: 0; }
.portal .brand { flex-direction: column; align-items: flex-start; gap: 2px; padding: 0 14px; }
.portal .brand b { font-family: var(--display); font-size: 24px; font-weight: 600; letter-spacing: 0; line-height: 1.15; }
.portal .brand span { font-family: var(--sans); font-size: 13px; letter-spacing: 0; }

.portal .nav { gap: 4px; }
.portal .nav a {
  display: flex; align-items: center; min-height: 44px; padding: 0 14px;
  border-radius: 10px; font-size: 16px; font-weight: 500; color: var(--ink);
}
.portal .nav a:hover { background: #E2DACB; }
.portal .nav a[aria-current="page"] { background: var(--brand); color: #FFFFFF; font-weight: 600; }
.portal .nav-group {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted); padding: 14px 14px 4px;
}
.portal .nav-group svg { display: none; }
.portal .who { border-top-color: #CFC6B5; }
.portal .who span { font-family: var(--sans); font-size: 13px; }

.portal .main h1 { font-family: var(--display); font-size: 40px; font-weight: 600; line-height: 1.1; letter-spacing: 0; margin: 0 0 6px; }
.portal .main header p { font-size: 16px; line-height: 1.5; color: var(--muted); }
/* The drawings belong to the other dashboards. The design has none. */
.portal .scene-head, .portal .horizon { display: none; }
.portal .panel { border-radius: 16px; box-shadow: none; }

@media (min-width: 900px) {
  .portal .sidebar { width: 248px; }
  .portal .main { padding: 36px 44px 60px; }
}
@media (max-width: 640px) {
  .portal .main h1 { font-size: 32px; }
}

/* ── shared pieces ─────────────────────────────────────── */
.portal .pl-label {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); margin: 0;
}
.portal .pl-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px;
  font-size: 14px; font-weight: 600; line-height: 1.3; border-radius: 6px; white-space: nowrap;
}
.portal .pl-pill svg { flex: none; }
.portal .pl-pill.good { background: var(--brand); color: #FFFFFF; }
.portal .pl-pill.warn { background: #F2D9A0; color: var(--ink); }
.portal .pl-pill.alarm { background: var(--alarm); color: #FFFFFF; }
.portal .pl-pill.crit { background: #8A3B2A; color: #FFFFFF; }
.portal .pl-pill.quiet { background: var(--panel-2); color: var(--ink); }

.portal .pl-btn {
  min-height: 44px; padding: 0 16px; font-size: 15px; font-weight: 600;
  color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: 10px; cursor: pointer;
}
.portal .pl-btn.primary { background: var(--brand); border-color: var(--brand); color: #FFFFFF; }
.portal .pl-btn.alarm { min-height: 48px; font-size: 16px; background: var(--alarm); border-color: var(--alarm); color: #FFFFFF; }
.portal .pl-btn.quiet { background: transparent; border-color: transparent; color: var(--crit); padding: 0 6px; }
.portal .pl-btn:disabled { opacity: 0.55; cursor: progress; }

.portal .pl-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  padding: 20px; display: flex; flex-direction: column; gap: 12px;
}
.portal .pl-card.sunk { background: var(--panel-2); border-color: transparent; }
.portal .pl-card.alert { border: 2px solid var(--alarm); }
.portal .pl-quiet { font-size: 15px; line-height: 1.45; color: var(--muted); margin: 0; }
.portal .pl-notice {
  padding: 12px 16px; margin-bottom: 16px; border-radius: 12px;
  background: #F2D9A0; color: var(--ink); font-size: 15px;
}

/* ── live ──────────────────────────────────────────────── */
.portal .pl-live { display: flex; gap: 20px; align-items: flex-start; }
.portal .pl-list { width: 320px; flex: none; display: flex; flex-direction: column; gap: 12px; }
.portal .pl-call {
  text-align: left; width: 100%; padding: 16px; background: var(--panel);
  border: 2px solid var(--line); border-radius: 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 8px; color: var(--ink); font-weight: 400;
}
.portal .pl-call[aria-pressed="true"] { border-color: var(--ink); }
.portal .pl-call-top {
  display: flex; justify-content: space-between; align-items: center; gap: 8px 10px;
  flex-wrap: wrap; font-size: 15px; font-weight: 600;
}
/* A phone number is longer than "Line 2". It stays whole, and the state drops
   beneath it when the two will not fit side by side. */
.portal .pl-call-top > span:first-child { white-space: nowrap; }
.portal .pl-call-say { font-size: 15px; line-height: 1.4; color: var(--muted); }
.portal .pl-done {
  padding: 14px 16px; background: var(--panel-2); border-radius: 14px;
  display: flex; flex-direction: column; gap: 4px; font-size: 15px;
}
.portal .pl-done { text-align: left; width: 100%; border: 2px solid transparent; cursor: pointer; color: var(--ink); font-weight: 400; }
.portal .pl-done[aria-pressed="true"] { border-color: var(--ink); }
.portal .pl-done b { font-weight: 600; }
.portal .pl-updated { color: var(--muted); }
.portal .pl-open-order { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.portal .pl-done span { color: var(--muted); line-height: 1.4; }
.portal .pl-done a { font-weight: 600; }

.portal .pl-detail { flex: 1; min-width: 0; display: flex; gap: 20px; align-items: flex-start; }
.portal .pl-talk { flex: 1; min-width: 0; }
.portal .pl-talk-head { display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap; }
.portal .pl-talk-head h2, .portal .pl-talk-head span { white-space: nowrap; }
.portal .pl-talk-head span { font-size: 14px; color: var(--muted); }
.portal .pl-side { width: 290px; flex: none; display: flex; flex-direction: column; gap: 16px; }

.portal .pl-turns { display: flex; flex-direction: column; gap: 10px; }
.portal .pl-turn {
  max-width: 86%; padding: 11px 15px; border-radius: 14px;
  display: flex; flex-direction: column; gap: 3px; font-size: 16px; line-height: 1.42;
}
.portal .pl-turn b { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.portal .pl-turn.agent { align-self: flex-start; background: var(--brand); color: #FFFFFF; }
.portal .pl-turn.agent b { color: #CFE5D8; }
.portal .pl-turn.caller { align-self: flex-end; background: var(--panel-2); color: var(--ink); }
.portal .pl-turn.caller b { color: var(--muted); }

.portal .pl-line { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.portal .pl-line b { font-size: 16px; font-weight: 600; }
.portal .pl-line small { display: block; font-size: 14px; color: var(--muted); }
.portal .pl-line > span { font-size: 16px; font-weight: 600; white-space: nowrap; }
.portal .pl-open { font-size: 14px; line-height: 1.4; font-weight: 600; color: #8A3B2A; }
.portal .pl-total {
  padding-top: 10px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 14px; color: var(--muted);
}
.portal .pl-total b { font-size: 24px; font-weight: 600; color: var(--ink); }
.portal .pl-asked { font-size: 16px; font-weight: 600; line-height: 1.35; }
.portal .pl-found { font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.portal .pl-alert-title { font-size: 20px; font-weight: 600; line-height: 1.3; }

@media (max-width: 1240px) {
  .portal .pl-detail { flex-direction: column; }
  .portal .pl-detail > * { width: 100%; box-sizing: border-box; }
}
@media (max-width: 980px) {
  .portal .pl-live { flex-direction: column; }
  .portal .pl-list { width: 100%; }
}

/* ── orders ────────────────────────────────────────────── */
.portal .po-chips { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.portal .po-chip {
  min-height: 44px; box-sizing: border-box; padding: 0 18px; display: inline-flex; align-items: center;
  font-size: 15px; font-weight: 500; color: var(--ink); background: var(--panel);
  border: 1px solid var(--line-strong); border-radius: 22px; text-decoration: none;
}
.portal .po-chip.on { background: var(--ink); border-color: var(--ink); color: #FFFFFF; font-weight: 600; }

.portal .po-table { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 24px 26px 8px; }
.portal .po-head, .portal .po-row { display: flex; gap: 20px; }
.portal .po-head {
  padding-bottom: 12px; font-size: 13px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--muted);
}
/* The headings share the columns' widths but not their type: a column sets
   its cells in 16 or 17px, and a heading row in three sizes reads as a bug. */
.portal .po-head > div { font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.portal .po-row { padding: 16px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.portal .po-who { width: 130px; flex: none; }
.portal .po-who b { display: block; font-size: 17px; font-weight: 600; }
.portal .po-who span { display: block; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.portal .po-who a { font-size: 13px; }
.portal .po-what { flex: 1; min-width: 0; font-size: 16px; line-height: 1.45; }
.portal .po-what small { font-size: 16px; color: var(--muted); }
.portal .po-note { margin-top: 6px; font-size: 14px; line-height: 1.4; color: var(--muted); }
.portal .po-when { width: 120px; flex: none; font-size: 16px; }
.portal .po-total { width: 96px; flex: none; font-size: 17px; font-weight: 600; white-space: nowrap; }
.portal .po-state { width: 176px; flex: none; }
.portal .po-ticket { margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--muted); }
.portal .po-act { width: 150px; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.portal .po-act input { font-size: 15px; }
.portal .po-foot { margin: 14px 0 0; font-size: 14px; color: var(--muted); }

@media (max-width: 1100px) {
  .portal .po-head { display: none; }
  .portal .po-row { flex-direction: column; gap: 8px; }
  .portal .po-who, .portal .po-when, .portal .po-total, .portal .po-state, .portal .po-act { width: auto; }
  .portal .po-act { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .portal .po-table { padding: 8px 18px; }
  .portal .po-head + .po-row { border-top: 0; }
}

/* ── the door ──────────────────────────────────────────── */
/* The sign-in screen. The form's markup is the shared one; only how it is
   dressed changes, and only under `.portal`. */
.portal.signin { gap: 56px; }
@media (min-width: 940px) {
  .portal.signin {
    grid-template-columns: minmax(0, 1fr) 420px;
    max-width: 1180px; padding: 48px 56px; gap: 72px;
  }
}
.portal.signin form { max-width: 420px; }
.portal.signin .panel { padding: 36px 32px 32px; text-align: left; border-radius: 16px; box-shadow: none; }
.portal.signin .signin-art { display: none; }
.portal.signin h1 {
  font-family: var(--display); font-size: 36px; font-weight: 600;
  line-height: 1.1; letter-spacing: 0; margin: 0 0 8px;
}
.portal.signin .sub { font-size: 16px; line-height: 1.5; color: var(--muted); margin: 0 0 28px; max-width: none; }
.portal.signin .field { gap: 8px; margin-bottom: 18px; }
.portal.signin .field label { font-size: 14px; font-weight: 600; }
.portal.signin .field input {
  height: 52px; box-sizing: border-box; padding: 0 16px; font-size: 17px;
  background: var(--panel); border: 2px solid var(--ink); border-radius: 12px;
}
.portal.signin button.primary {
  min-height: 52px; margin-top: 6px; font-size: 16px; font-weight: 600;
  background: var(--brand); border-color: var(--brand); color: #FFFFFF; border-radius: 10px;
}
.portal.signin .built-by { background: transparent; border-color: transparent; padding: 14px 4px 0; }
.portal.signin .built-by:hover { transform: none; box-shadow: none; border-color: transparent; }

.portal .ps { max-width: 560px; }
.portal .ps-eyebrow {
  font-size: 14px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 16px;
}
.portal .ps-title {
  font-family: var(--display); font-size: 52px; font-weight: 600;
  line-height: 1.05; letter-spacing: 0; margin: 0 0 28px;
}
.portal .ps-talk { margin-bottom: 32px; }
.portal .ps-beats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.portal .ps-beats b { display: block; font-size: 17px; font-weight: 600; }
.portal .ps-beats span { display: block; font-size: 15px; line-height: 1.45; color: var(--muted); }

/* ── today ─────────────────────────────────────────────── */
.portal .pt-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.portal .pt-tile {
  padding: 18px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.portal .pt-tile > span { font-size: 14px; font-weight: 600; color: var(--muted); }
/* The figures stay in the sans. A serif number reads as decoration. */
.portal .pt-tile b { font-size: 34px; font-weight: 600; line-height: 1.05; letter-spacing: 0; }
.portal .pt-tile.hero b { font-size: 52px; }
.portal .pt-tile small { font-size: 14px; line-height: 1.35; color: var(--muted); }
.portal .pt-row { display: flex; gap: 20px; align-items: stretch; }
.portal .pt-chart { flex: 1; min-width: 0; gap: 14px; }
.portal .pt-side { width: 380px; flex: none; display: flex; flex-direction: column; gap: 20px; }
.portal .pt-title { font-size: 18px; font-weight: 600; }
.portal .pt-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.portal .pt-plot { position: relative; height: 228px; margin-top: auto; }
.portal .pt-grid { position: absolute; left: 34px; right: 0; height: 1px; background: var(--line); }
.portal .pt-tick { position: absolute; left: 0; width: 26px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.portal .pt-cols { position: absolute; left: 34px; right: 0; bottom: 0; height: 228px; display: flex; justify-content: space-around; align-items: flex-end; }
.portal .pt-col { width: 40px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.portal .pt-col > i { font-style: normal; font-size: 13px; font-weight: 600; height: 16px; white-space: nowrap; }
.portal .pt-bar { width: 22px; background: #1B7F4F; border-radius: 4px 4px 0 0; }
.portal .pt-bar.now { background: #8FBFA5; }
.portal .pt-col > span { height: 24px; font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; align-items: flex-end; }
.portal .pt-outcome { display: flex; flex-direction: column; gap: 5px; }
.portal .pt-outcome > div:first-child { display: flex; justify-content: space-between; font-size: 15px; }
.portal .pt-outcome b { font-variant-numeric: tabular-nums; }
.portal .pt-fill { height: 10px; background: #1B7F4F; border-radius: 0 4px 4px 0; }
.portal .pt-wait a { min-height: 44px; display: flex; align-items: center; font-size: 16px; font-weight: 600; }
@media (max-width: 1100px) {
  .portal .pt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal .pt-row { flex-direction: column; }
  .portal .pt-side { width: auto; }
  .portal .pt-col { width: 28px; }
}
@media (max-width: 560px) {
  .portal .pt-tiles { grid-template-columns: minmax(0, 1fr); }
  .portal .pt-tile.hero b { font-size: 40px; }
}

/* ── menu ──────────────────────────────────────────────── */
.portal .pm-asked-wrap { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.portal .pm-asked { display: flex; gap: 14px; flex-wrap: wrap; }
.portal .pm-ask {
  flex: 1 1 200px; max-width: 320px; padding: 14px 16px; background: var(--panel-2); border-radius: 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.portal .pm-ask span { font-size: 14px; color: var(--muted); }
.portal .pm-ask b { font-size: 16px; font-weight: 600; line-height: 1.35; }
.portal .pm-actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.portal .pm-form { margin-bottom: 20px; gap: 16px; }
.portal .pm-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.portal .pm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.portal .pm-field.wide { grid-column: 1 / -1; }
.portal .pm-field label { font-size: 14px; font-weight: 600; }
.portal .pm-field input {
  height: 48px; box-sizing: border-box; padding: 0 14px; font-size: 16px;
  background: var(--panel); border: 2px solid var(--ink); border-radius: 12px;
}
.portal .pm-field small { font-size: 13px; line-height: 1.4; color: var(--muted); }
.portal .pm-field small.err { color: var(--crit); font-weight: 600; }
.portal .pm-form-actions { display: flex; gap: 10px; }
.portal .pm-table { padding-top: 18px; }
.portal .pm-dish { width: 250px; flex: none; }
.portal .pm-dish b { display: block; font-size: 17px; font-weight: 600; }
.portal .pm-dish span { display: block; font-size: 14px; line-height: 1.4; color: var(--muted); }
.portal .pm-price { width: 70px; flex: none; font-size: 16px; font-weight: 600; }
.portal .pm-aka { width: 170px; flex: none; font-size: 15px; line-height: 1.45; }
.portal .pm-like { flex: 1; min-width: 0; font-size: 15px; line-height: 1.45; }
.portal .pm-today { width: 80px; flex: none; }
.portal .pm-act { width: 150px; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
@media (max-width: 1100px) {
  .portal .pm-fields { grid-template-columns: minmax(0, 1fr); }
  .portal .pm-dish, .portal .pm-price, .portal .pm-aka, .portal .pm-like, .portal .pm-today, .portal .pm-act { width: auto; }
  .portal .pm-act { flex-direction: row; align-items: flex-start; }
}
