:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #261e22;
  background: #faf8f9;
  font-synthesis: none;
  --surface: #fff;
  --canvas: #faf8f9;
  --ink: #261e22;
  --muted: #675e63;
  --line: #eee5e9;
  --pink: #bd2854;
  --pink-strong: #a31843;
  --wash: #f8eaf0;
  --radius: 16px;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled, select:disabled { cursor: wait; opacity: .66; }
a { color: inherit; text-decoration: none; }
a, button, input, select, textarea { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--pink); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); font-weight: 680; letter-spacing: -.045em; line-height: 1.1; overflow-wrap: anywhere; }
h2 { font-size: 19px; font-weight: 660; letter-spacing: -.018em; }
[hidden] { display: none !important; }

.wordmark { display: block; width: 100px; height: auto; }
.login-panel .wordmark { width: 113px; }
.muted { color: var(--muted); }
.boot { padding: 36px; }
.shell { min-height: 100dvh; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 78px;
  max-width: 1520px; margin: auto; padding: 0 36px;
}
.brand { display: flex; align-items: center; gap: 17px; min-width: max-content; }
.brand-subtitle { font-size: 14px; color: var(--muted); padding-left: 17px; border-left: 1px solid var(--line); }
.account { display: flex; align-items: center; gap: 16px; min-width: 0; font-size: 14px; }
.account span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.workspace {
  display: grid; grid-template-columns: minmax(164px, 210px) minmax(0, 1fr); gap: clamp(22px, 4vw, 64px);
  max-width: 1520px; margin: 0 auto; padding: 36px 36px 68px;
}
.sidebar { align-self: start; position: sticky; top: 24px; }
.nav { display: grid; gap: 5px; }
.nav a {
  min-height: 46px; padding: 11px 14px; display: flex; align-items: center; gap: 10px;
  border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 560;
}
.nav a:hover { background: #f3eef1; color: var(--ink); }
.nav a[aria-current="page"] { background: var(--wash); color: #922542; font-weight: 650; }
.sidebar-scope { margin-top: 28px; padding: 19px 14px 0; border-top: 1px solid var(--line); }
.sidebar-scope label { font-size: 13px; }
.sidebar-scope select { margin-top: 7px; width: 100%; }
.scope-name { display: block; margin-top: 5px; font-weight: 630; overflow-wrap: anywhere; }

.main { min-width: 0; }
.page-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin: 1px 0 25px; }
.page-head p { margin-top: 9px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .state { padding: 26px; }
.table-wrap { overflow: auto; border-radius: inherit; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
thead { color: var(--muted); background: #fdfbfc; }
th, td { padding: 17px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-weight: 590; font-size: 12px; letter-spacing: .01em; }
tr:last-child td { border-bottom: 0; }
.order-list td:first-child { font-weight: 640; }
.order-mobile-meta { display: none; }
.number-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-link { color: var(--pink-strong); }
.table-link:hover, .back-link:hover { text-decoration: underline; }
.pill {
  display: inline-flex; align-items: center; border-radius: 99px; padding: 4px 9px;
  background: #f1eef0; color: #585157; font-size: 12px; font-weight: 620; white-space: nowrap;
}
.pill.good { background: #e9f3ed; color: #285641; }
.pill.ongoing { background: #f8efe1; color: #755121; }
.pill.new { background: var(--wash); color: #922542; }
.back-link { display: inline-block; margin: 0 0 19px; color: var(--pink-strong); font-weight: 580; }
.order-summary { padding: 23px 23px 0; }
.order-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 22px; font-size: 14px; }
.order-total { display: flex; justify-content: space-between; gap: 15px; padding: 18px 20px; border-top: 1px solid var(--line); font-weight: 660; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(245px, 100%), 1fr)); gap: 15px; }
.restaurant-card { padding: 21px; }
.restaurant-card p { color: var(--muted); margin: 6px 0 19px; }
.rows { list-style: none; margin: 0; padding: 0; }
.item-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 13px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: 0; }
.item-row strong { display: block; overflow-wrap: anywhere; }
.item-row p { margin-top: 4px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.price { white-space: nowrap; font-weight: 640; font-variant-numeric: tabular-nums; }

.restaurant-portal .main { container-type: inline-size; }
.restaurant-portal .portal-application { width: min(100%, 530px); }
.restaurant-portal .portal-review-actions { margin-top: 18px; }

@container (max-width: 640px) {
  .restaurant-portal .item-row { grid-template-columns: minmax(0, 1fr) auto; }
  .restaurant-portal .row-actions { grid-column: 1 / -1; }
}

.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  min-height: 43px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-weight: 620; font-size: 14px;
}
.button:hover { border-color: #dbc8d0; background: #fdf9fb; }
.button.primary { background: var(--pink); border-color: var(--pink); color: white; }
.button.primary:hover { background: var(--pink-strong); border-color: var(--pink-strong); }
.button.quiet { background: transparent; border-color: transparent; color: var(--muted); }
.button.quiet:hover { background: var(--wash); color: var(--ink); }
.button.small { min-height: 36px; padding: 0 10px; font-size: 13px; }

.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 28px 18px; }
.login-panel { width: min(100%, 440px); padding: clamp(24px, 5vw, 38px); }
.login-panel h1 { margin-top: 25px; font-size: clamp(26px, 4vw, 33px); }
.login-panel form { margin-top: 24px; }
.login-panel .primary { width: 100%; margin-top: 3px; }
.demo { padding-top: 20px; margin-top: 23px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.demo summary { cursor: pointer; }
.demo .demo-buttons { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.demo-buttons button { text-align: left; }
.field { display: grid; gap: 6px; margin-bottom: 15px; min-width: 0; }
.field span, .field-label { font-size: 13px; font-weight: 650; }
input:not([type="checkbox"]), select, textarea {
  width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #ddcfd6; border-radius: 9px;
  background: var(--surface); color: var(--ink); font-size: 16px;
}
textarea { resize: vertical; min-height: 82px; }
input[type="checkbox"] { accent-color: var(--pink); width: 18px; height: 18px; margin: 0; }
.check { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; font-size: 14px; cursor: pointer; }
.form-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.error { color: #912343; font-size: 14px; margin: 0 0 11px; }
.error:empty { display: none; }
.state { color: var(--muted); line-height: 1.55; }
.state .button { margin-top: 11px; }

dialog {
  width: min(510px, calc(100% - 30px)); max-height: calc(100dvh - 32px); padding: 24px;
  border: 1px solid var(--line); border-radius: 18px; color: var(--ink); background: var(--surface);
}
dialog::backdrop { background: #23142066; }
dialog h2 { margin-bottom: 19px; font-size: 22px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 13px; }
.notice {
  position: fixed; right: 22px; bottom: 22px; z-index: 3; max-width: min(390px, calc(100% - 44px)); padding: 13px 15px;
  border-radius: 11px; box-shadow: 0 4px 18px #2c102324; color: white; background: #362831; font-size: 14px;
}
.notice:empty { display: none; }

@media (max-width: 800px) {
  .topbar-inner { padding: 0 18px; min-height: 68px; }
  .workspace { display: block; padding: 18px 18px 44px; }
  .sidebar { position: static; margin-bottom: 22px; }
  .nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav a { min-height: 40px; padding: 8px 12px; font-size: 14px; }
  .sidebar-scope { margin-top: 11px; padding: 11px 0 0; }
  .sidebar-scope select { width: auto; max-width: 100%; display: block; }
  .page-head { margin-bottom: 16px; }
  th, td { padding: 12px 13px; }
}
@media (max-width: 460px) {
  .brand { gap: 7px; }
  .brand .wordmark { width: 83px; }
  .brand-subtitle { display: none; }
  .account { gap: 5px; }
  .restaurant-account .account-name { display: none; }
  .item-row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px; }
  .row-actions { grid-column: 1 / -1; }
  .form-columns { grid-template-columns: 1fr; gap: 0; }
  .order-meta { gap: 7px 10px; }
  .order-list .order-desktop-meta { display: none; }
  .order-mobile-meta { display: block; margin-top: 4px; font-size: 11px; font-weight: 450; color: var(--muted); }
  .order-list td, .order-list th { padding: 12px 9px; }
}

.workflow-section { display: grid; gap: 15px; margin-top: 14px; }
.workflow-panel { padding: 20px; min-width: 0; }
.workflow-panel h2 { margin-bottom: 14px; }
.workflow-panel .table-wrap { margin: 0 -20px -20px; }
.workflow-panel .item-row { padding-inline: 0; }
.workflow-panel .item-row:first-child { padding-top: 4px; }
.workflow-panel .item-row:last-child { padding-bottom: 0; }
.workflow-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.workflow-panel > p + .workflow-actions { margin-top: 13px; }
.history, .courier-list { list-style: none; margin: 0; padding: 0; }
.history li, .courier-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.history li:first-child, .courier-list li:first-child { padding-top: 0; }
.history li:last-child, .courier-list li:last-child { padding-bottom: 0; border-bottom: 0; }
.history-head, .courier-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.history-head { font-size: 13px; }
.history li p { margin-top: 5px; font-size: 14px; overflow-wrap: anywhere; }
.courier-list li { justify-content: space-between; }
.dispatch-row > .pill { justify-self: start; }
.order-customer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 17px; font-size: 14px; }
.order-costs { display: grid; gap: 8px; margin: 0; padding: 16px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.order-costs div { display: flex; justify-content: space-between; gap: 9px; }
.order-costs dd { margin: 0; white-space: nowrap; }
.dialog-context { margin: -5px 0 16px; font-size: 14px; line-height: 1.5; }

@media (max-width: 460px) {
  .workflow-panel { padding: 15px; }
  .workflow-panel .table-wrap { margin: 0 -15px -15px; }
}

.profile-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(225px, 100%), 1fr)); gap: 16px; margin: 0; }
.profile-fields dt { color: var(--muted); font-size: 13px; margin-bottom: 5px; }
.profile-fields dd { margin: 0; overflow-wrap: anywhere; }
.panel-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-heading h2 { margin: 0; }
.staff-list .muted { overflow-wrap: anywhere; }
.mail-item { border-bottom: 1px solid var(--line); }
.mail-item:last-child { border-bottom: 0; }
.mail-item summary { padding: 17px 20px; cursor: pointer; }
.mail-summary { display: inline-flex; flex-direction: column; gap: 4px; vertical-align: middle; padding-left: 5px; overflow-wrap: anywhere; }
.mail-details { padding: 0 20px 20px; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 14px; line-height: 1.55; }

.category-fields { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px 4px; }
.category-fields legend { font-size: 13px; font-weight: 650; padding: 0 4px; }
.category-fields .check { margin-bottom: 9px; overflow-wrap: anywhere; }
.category-fields input { flex: 0 0 18px; }
.category-row > .muted { font-size: 13px; }
.staff-name p { margin-top: 4px; font-size: 13px; }
.staff-name { min-width: 0; overflow-wrap: anywhere; }
.refund-help { margin-bottom: 14px; font-size: 14px; }
.ledger-note { display: block; color: var(--muted); margin-top: 4px; }

.menu-item-heading { display: flex; gap: 11px; align-items: center; min-width: 0; }
.menu-item-heading > div { min-width: 0; }
.menu-thumbnail { width: 54px; height: 54px; flex: 0 0 54px; border-radius: 8px; object-fit: cover; background: var(--canvas); }
.menu-photo-preview {
  display: block; width: 100%; max-height: 220px; margin-bottom: 16px; border-radius: 10px;
  object-fit: contain; background: var(--canvas);
}
.photo-input::file-selector-button {
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; margin-right: 8px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.photo-delete { color: var(--pink-strong); margin-bottom: 6px; }

@media (max-width: 460px) {
  .menu-thumbnail { width: 45px; height: 45px; flex-basis: 45px; }
}
