:root {
  --ink: #1f252b;
  --muted: #697077;
  --paper: #fffdf9;
  --canvas: #f6f3ed;
  --line: #e4ded5;
  --brand: #c8442e;
  --brand-dark: #a92e1d;
  --brand-soft: #fff0eb;
  --navy: #17324d;
  --navy-soft: #eaf2f8;
  --green: #237a57;
  --green-soft: #e8f6ef;
  --amber: #a96205;
  --amber-soft: #fff5d9;
  --red: #b83b35;
  --red-soft: #fdecea;
  --shadow: 0 16px 45px rgba(38, 31, 24, .08);
  --radius: 18px;
  --font: "Noto Sans Thai", "Leelawadee UI", Tahoma, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-family: var(--font); line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 240px; z-index: -1; background: radial-gradient(circle at 15% 0%, rgba(200,68,46,.11), transparent 42%), radial-gradient(circle at 85% 0%, rgba(23,50,77,.08), transparent 40%); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, .button { touch-action: manipulation; }
button:disabled, .button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, a:focus-visible { outline: 3px solid #e1a527; outline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.15; letter-spacing: -.035em; }
h2 { line-height: 1.25; letter-spacing: -.02em; }
small { color: var(--muted); }
code { background: #f1ece5; border-radius: 6px; padding: .1rem .35rem; }

.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(18px, calc((100vw - 1180px) / 2)); background: rgba(255,253,249,.92); border-bottom: 1px solid rgba(228,222,213,.85); backdrop-filter: blur(16px); position: sticky; top: 0; z-index: 30; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .06em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px 12px 12px 4px; color: white; background: var(--brand); box-shadow: 0 8px 18px rgba(200,68,46,.28); }
.guest-nav, .button-row { display: flex; gap: 10px; align-items: center; }
.guest-nav > a:not(.button) { padding: 8px 12px; }
.account-chip { display: flex; min-width: 0; align-items: center; gap: 14px; }
.account-chip span { display: flex; min-width: 0; max-width: 340px; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.account-chip strong, .account-chip small { max-width: 100%; text-align: right; overflow-wrap: anywhere; }
.account-chip small { font-size: .72rem; }
.account-chip > a { color: var(--red); font-size: .86rem; }
.secure-chip { color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 6px 10px; font-size: .78rem; font-weight: 800; }

.section-nav { display: flex; gap: 4px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; padding: 10px max(14px, calc((100vw - 1180px) / 2)); background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 72px; z-index: 25; }
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 13px; border-radius: 999px; color: var(--muted); font-size: .88rem; font-weight: 700; }
.section-nav a:hover, .section-nav a.active { color: var(--brand-dark); background: var(--brand-soft); }

.page-container { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 36px 0 80px; }
.eyebrow { display: inline-block; margin-bottom: 8px; color: var(--brand-dark); font-size: .72rem; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 10px 18px; border: 0; border-radius: 12px; color: white; background: var(--brand); font-weight: 850; cursor: pointer; box-shadow: 0 8px 20px rgba(200,68,46,.18); }
.button:hover { background: var(--brand-dark); transform: translateY(-1px); }
.button.secondary { color: var(--navy); background: var(--navy-soft); box-shadow: none; }
.button.secondary:hover { background: #dbe9f3; }
.button.ghost { color: var(--ink); background: transparent; border: 1px solid var(--line); box-shadow: none; }
.button.small { min-height: 44px; padding: 7px 12px; border-radius: 10px; font-size: .86rem; }
.button.full { width: 100%; }
.button-row.tight { gap: 6px; }
.text-button { display: inline-flex; align-items: center; min-height: 44px; padding: 4px 2px; color: var(--navy); border: 0; background: none; cursor: pointer; font-size: .83rem; text-decoration: underline; }
.text-button.danger { color: var(--red); }
.text-link { color: var(--brand-dark); font-weight: 800; }

.landing-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 52px; align-items: center; min-height: 570px; padding: 44px 0; }
.landing-copy h1 { max-width: 760px; margin-bottom: 22px; font-size: clamp(2.4rem, 6vw, 4.7rem); }
.landing-copy > p { max-width: 680px; color: var(--muted); font-size: 1.12rem; }
.landing-copy .button-row { margin: 28px 0; }
.trust-row { display: flex; gap: 18px; flex-wrap: wrap; color: var(--green); font-size: .85rem; font-weight: 800; }
.workflow-card { border: 1px solid var(--line); border-radius: 28px; padding: 22px; background: var(--paper); box-shadow: var(--shadow); transform: rotate(1deg); }
.workflow-head { display: flex; align-items: center; gap: 10px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.workflow-head span:last-child { margin-left: auto; color: var(--muted); font-size: .75rem; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px var(--green-soft); }
.workflow-list { list-style: none; padding: 6px 0 0; margin: 0; }
.workflow-list li { display: flex; gap: 14px; padding: 16px 4px; border-bottom: 1px dashed var(--line); }
.workflow-list li:last-child { border: 0; }
.workflow-list li > span { color: var(--brand); font-weight: 900; }
.workflow-list li div { display: flex; flex-direction: column; }
.workflow-list small { margin-top: 2px; }
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature-strip article { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,253,249,.72); }
.feature-strip article > span { color: var(--brand); font-size: 1.7rem; font-weight: 900; }
.feature-strip h2 { margin: 12px 0 6px; font-size: 1.05rem; }
.feature-strip p { margin: 0; color: var(--muted); font-size: .88rem; }

.auth-card { width: min(480px, 100%); margin: 48px auto; padding: clamp(24px, 5vw, 42px); border: 1px solid var(--line); border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); }
.auth-card.wide { width: min(620px, 100%); }
.auth-card > p { color: var(--muted); }
.stack-form { display: grid; gap: 15px; }
label { color: var(--ink); font-size: .84rem; font-weight: 750; }
input, select, textarea { width: 100%; min-height: 44px; margin-top: 6px; padding: 9px 12px; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 10px; outline: none; font-size: 1rem; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.check-row { display: flex; align-items: center; gap: 9px; font-weight: 600; }
.check-row input { width: 20px; min-height: 20px; margin: 0; accent-color: var(--brand); }
.login-options { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 18px; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }
.auth-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand-dark); font-size: .84rem; font-weight: 800; }
.remember-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 10px; min-height: 44px; cursor: pointer; font-weight: 700; }
.remember-row input[type="checkbox"] { appearance: none; -webkit-appearance: none; display: grid; place-items: center; width: 22px; height: 22px; min-height: 22px; margin: 0; padding: 0; border: 2px solid #9ca2a7; border-radius: 6px; background: white; cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.remember-row input[type="checkbox"]::after { content: ""; width: 9px; height: 5px; margin-top: -2px; border-left: 2px solid white; border-bottom: 2px solid white; transform: rotate(-45deg) scale(0); transition: transform .12s ease-out; }
.remember-row input[type="checkbox"]:checked { border-color: var(--brand); background: var(--brand); }
.remember-row input[type="checkbox"]:checked::after { transform: rotate(-45deg) scale(1); }
.remember-row input[type="checkbox"]:hover { border-color: var(--brand); }
.remember-row input[type="checkbox"]:focus-visible { border-color: var(--brand); outline: 3px solid #e1a527; outline-offset: 3px; box-shadow: none; }
.remember-row span { display: flex; flex-direction: column; line-height: 1.25; }
.remember-row small { margin-top: 2px; font-size: .72rem; font-weight: 500; }
.danger-zone { color: var(--red); padding: 12px; background: var(--red-soft); border-radius: 10px; }
.demo-box { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--canvas); font-size: .85rem; }
.demo-box summary { cursor: pointer; font-weight: 850; }
.demo-box p { margin: 10px 0 0; }
.demo-credentials { margin-top: 24px; padding: 20px; border-radius: 16px; background: var(--green-soft); }
.demo-credentials p { margin-bottom: 8px; }
.success-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 16px; border-radius: 50%; color: white; background: var(--green); font-size: 1.8rem; font-weight: 900; }

.alert { margin: 0 0 18px; padding: 13px 16px; border-radius: 12px; border: 1px solid transparent; font-size: .9rem; }
.alert.success { color: var(--green); background: var(--green-soft); border-color: #c5e9d8; }
.alert.warning { color: var(--amber); background: var(--amber-soft); border-color: #f0dfa9; }
.alert.danger { color: var(--red); background: var(--red-soft); border-color: #f1cbc8; }
.alert.info { color: var(--navy); background: var(--navy-soft); }
.muted { color: var(--muted); }

.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.section-heading h1, .section-heading h2 { margin-bottom: 4px; }
.section-heading p { margin: 0; color: var(--muted); }
.dashboard-title { margin-bottom: 24px; }
.date-chip { min-width: 110px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--muted); text-align: right; font-size: .8rem; }
.date-chip strong { display: block; color: var(--ink); font-size: 1.25rem; }
.metric-mini { display: flex; flex-direction: column; align-items: flex-end; }
.metric-mini strong { font-size: 2rem; line-height: 1; }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.metric-grid.with-waitlist { grid-template-columns: repeat(5, 1fr); }
.metric-grid a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 6px 18px rgba(38,31,24,.04); }
.metric-grid a:hover { border-color: #d6c9bb; transform: translateY(-2px); }
.metric-grid span { color: var(--muted); font-size: .82rem; }
.metric-grid strong { grid-row: span 2; font-size: 2rem; line-height: 1; }
.metric-grid .money-metric { font-size: 1.55rem; }
.content-section { scroll-margin-top: 135px; margin-top: 34px; }

.status-badge { display: inline-flex; align-items: center; width: max-content; padding: 5px 9px; border: 0; border-radius: 999px; font-size: .72rem; font-weight: 850; white-space: nowrap; }
.status-badge-row { display: flex; flex-wrap: wrap; gap: 6px; }
button.status-badge { min-height: 44px; cursor: pointer; }
.status-badge.success, .status-dot.success { color: var(--green); background: var(--green-soft); }
.status-badge.warning, .status-dot.warning { color: var(--amber); background: var(--amber-soft); }
.status-badge.danger, .status-dot.danger { color: var(--red); background: var(--red-soft); }
.status-badge.info, .status-dot.info { color: var(--navy); background: var(--navy-soft); }
.queue-number { color: var(--brand-dark); font-weight: 900; }

.table-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.compact-grid { grid-template-columns: repeat(3, 1fr); }
.table-card { position: relative; overflow: hidden; min-height: 190px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.table-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--line); }
.table-card.status-ready::before { background: var(--green); }
.table-card.status-reserved::before, .table-card.status-occupied::before, .table-card.status-cleaning::before { background: var(--navy); }
.table-card.status-bill_requested::before, .table-card.status-needs_cleaning::before { background: #e1a527; }
.table-card.status-disabled::before { background: var(--red); }
.table-card header { display: flex; align-items: center; gap: 8px; }
.table-card header > span:first-child { color: var(--muted); font-size: .8rem; }
.table-card header strong { font-size: 2rem; }
.table-card header .status-badge { margin-left: auto; }
.table-details { display: flex; flex-wrap: wrap; gap: 5px 12px; min-height: 44px; margin: 9px 0 15px; color: var(--muted); font-size: .8rem; }
.table-type-chip { display: inline-flex; width: max-content; margin-top: 5px; padding: 3px 8px; color: var(--navy); background: var(--navy-soft); border-radius: 999px; font-size: .72rem; font-weight: 800; }
.reserved-queue-note { display: grid; gap: 2px; margin: 8px 0 12px; padding: 10px 12px; color: var(--navy); background: var(--navy-soft); border-radius: 11px; }
.reserved-queue-note strong { font-size: 1rem; }
.reserved-queue-note span { color: var(--muted); font-size: .78rem; }
.reserved-queue-note .text-link { margin-top: 4px; font-size: .78rem; }
.card-detail-link { display: inline-block; margin-top: 8px; font-size: .8rem; }
.table-card-links { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.table-heading-actions { flex-wrap: wrap; }
.open-table-form { display: grid; grid-template-columns: 86px 1fr; align-items: end; gap: 8px; }
.open-table-form input { min-height: 40px; }
.table-recovery-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.qr-session-actions { flex-wrap: wrap; }
.qr-session-actions form { margin: 0; }
.qr-result-card { display: grid; grid-template-columns: 1fr 220px; gap: 28px; align-items: center; margin-bottom: 24px; padding: 24px; color: white; background: var(--navy); border-radius: 22px; box-shadow: var(--shadow); }
.qr-result-card .eyebrow { color: #ffc4b9; }
.qr-result-card p { color: #c9d8e5; }
.qr-result-card label { color: #dbe8f2; }
.qr-result-card .button.ghost { color: white; border-color: rgba(255,255,255,.55); }
.qr-result-card .button.ghost:hover { background: rgba(255,255,255,.12); }
.qr-image { width: 220px; padding: 12px; background: white; border-radius: 14px; }
.copy-field { display: grid; grid-template-columns: 1fr auto; }
.copy-field input { border-radius: 10px 0 0 10px; color: var(--ink); }
.copy-field button { min-height: 44px; margin-top: 6px; padding: 0 12px; border: 0; border-radius: 0 10px 10px 0; color: white; background: var(--brand); font-weight: 800; cursor: pointer; }
.share-qr-button { margin-top: 12px; }

.waitlist-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.waitlist-summary article { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 15px; background: var(--paper); }
.waitlist-summary span { color: var(--muted); font-size: .82rem; }
.waitlist-summary strong { grid-row: span 2; font-size: 2rem; line-height: 1; }
.waitlist-summary small { align-self: end; }
.waitlist-filters { margin-bottom: 14px; }
.waitlist-stack { display: grid; gap: 13px; margin: 0; padding: 0; list-style: none; }
.waitlist-stack > li[hidden] { display: none; }
.waitlist-card { padding: 18px; border: 1px solid var(--line); border-left: 4px solid #e1a527; border-radius: var(--radius); background: var(--paper); box-shadow: 0 7px 20px rgba(38,31,24,.035); }
.waitlist-card.status-called { border-left-color: var(--navy); box-shadow: 0 8px 24px rgba(23,50,77,.08); }
.waitlist-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.waitlist-card > header > div { min-width: 0; }
.waitlist-card h2 { margin: 4px 0 0; font-size: 1.25rem; }
.waitlist-facts { display: flex; flex-wrap: wrap; gap: 7px 14px; margin: 13px 0; color: var(--muted); font-size: .82rem; }
.waitlist-facts span { display: inline-flex; align-items: baseline; gap: 4px; }
.waitlist-facts strong { color: var(--ink); font-size: 1.35rem; }
.waitlist-contact { margin: 0 0 10px; color: var(--muted); font-size: .84rem; }
.waitlist-match-form { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, .6fr); align-items: end; gap: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.waitlist-secondary-action { display: flex; justify-content: flex-end; }
.called-table-panel { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 13px 0; padding: 12px 14px; color: var(--navy); background: var(--navy-soft); border-radius: 12px; }
.called-table-panel > strong { grid-row: span 2; font-size: 1.35rem; }
.called-table-panel small { color: var(--muted); }
.waitlist-action-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 12px; margin-top: 8px; }
.waitlist-action-row form { display: flex; }

.security-settings-form { display: grid; gap: 14px; }
.security-card { display: grid; gap: 14px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.security-card h2 { margin-bottom: 4px; }
.security-card > div:first-child > p { margin: 0; color: var(--muted); }
.security-field-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; }
.login-policy-grid { grid-template-columns: repeat(4, 1fr); }
.input-with-unit { display: grid; grid-template-columns: minmax(80px, 1fr) auto; align-items: stretch; margin-top: 6px; }
.input-with-unit input { min-width: 0; margin: 0; border-radius: 10px 0 0 10px; }
.input-with-unit > span { display: flex; align-items: center; padding: 0 11px; color: var(--muted); background: var(--canvas); border: 1px solid var(--line); border-left: 0; border-radius: 0 10px 10px 0; font-size: .76rem; white-space: nowrap; }
.password-policy-summary, .password-rules { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 18px; margin: 0; padding: 12px 14px 12px 34px; color: var(--muted); background: var(--green-soft); border-radius: 12px; font-size: .82rem; }
.password-policy-summary li::marker, .password-rules li::marker { color: var(--green); }
.security-save-button { justify-self: start; min-width: 250px; }
.outbox-list { display: grid; gap: 9px; margin-top: 14px; }
.outbox-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.outbox-card h3 { margin: 7px 0 2px; font-size: 1rem; }
.outbox-card p { margin: 0; color: var(--muted); font-size: .8rem; }
.outbox-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; max-width: 270px; text-align: right; overflow-wrap: anywhere; }
.danger-text { color: var(--red); }

.password-field { position: relative; display: block; }
.password-field input { margin-top: 0; padding-inline-end: 60px; }
.password-toggle, .password-field [data-password-toggle] { position: absolute; top: 50%; right: 2px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; color: var(--navy); border: 0; border-radius: 8px; background: transparent; box-shadow: none; cursor: pointer; font-size: 1rem; line-height: 1; transform: translateY(-50%); }
.password-toggle:hover, .password-field [data-password-toggle]:hover { color: var(--brand-dark); background: var(--brand-soft); }
.password-toggle:focus-visible, .password-field [data-password-toggle]:focus-visible { outline: 3px solid #e1a527; outline-offset: -2px; }
.password-toggle[aria-pressed="true"], .password-field [data-password-toggle][aria-pressed="true"] { color: white; background: var(--navy); }

.app-dialog.wide-dialog { width: min(720px, calc(100% - 24px)); }
.dialog-panel { position: relative; padding: 26px; }
.app-dialog .dialog-panel form { position: static; padding: 0; }
.type-add-form { margin: 18px 0; padding: 16px !important; background: var(--canvas); border-radius: 14px; }
.type-management-list { display: grid; gap: 8px; }
.type-management-list article { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; }
.type-management-list article > div { display: grid; justify-items: start; gap: 3px; }
.type-management-list p { margin: 0; color: var(--muted); font-size: .8rem; }
.type-management-list .status-badge { margin-bottom: 3px; }

.reserved-detail-card { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 16px; margin-top: 14px; padding: 17px 18px; color: var(--navy); background: var(--navy-soft); border: 1px solid #cadeeb; border-radius: var(--radius); }
.reserved-detail-card h2, .reserved-detail-card p { margin-bottom: 3px; }
.reserved-detail-card .button-row { justify-content: flex-end; flex-wrap: wrap; }

.task-grid, .bill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.task-card, .bill-card { display: flex; flex-direction: column; min-height: 210px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 7px 20px rgba(38,31,24,.035); }
.task-card.priority-queued_prep, .task-card.priority-queued_kitchen, .task-card.priority-cooked { border-top: 4px solid #e3a324; }
.task-card.priority-prepping, .task-card.priority-cooking, .task-card.priority-serving { border-top: 4px solid var(--navy); }
.task-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .76rem; }
.task-card h2 { margin: 14px 0 6px; font-size: 1.2rem; }
.task-card h2 small { font-weight: 700; }
.task-note { padding: 8px 10px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 8px; font-size: .85rem; }
.task-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 14px; border-top: 1px dashed var(--line); }
.task-footer > div:first-child { display: flex; flex-direction: column; gap: 5px; }
.scan-hint { max-width: 120px; text-align: right; }
.bill-card header { display: flex; justify-content: space-between; align-items: flex-start; }
.bill-card header div { display: flex; flex-direction: column; }
.bill-card header strong { font-size: 2rem; }
.bill-amount { margin: 18px 0; padding: 14px; background: var(--green-soft); border-radius: 12px; }
.bill-amount strong { display: block; color: var(--green); font-size: 1.55rem; }
.payment-form { display: grid; gap: 9px; margin-top: 10px; }

.platform-grid { display: grid; gap: 14px; }
.platform-card { padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.platform-card > header { display: flex; justify-content: space-between; gap: 20px; }
.platform-card h2 { margin: 8px 0 2px; }
.platform-card p { margin: 0; color: var(--muted); }
.platform-stats { display: flex; gap: 10px; }
.platform-stats span { min-width: 74px; padding: 10px; text-align: center; background: var(--canvas); border-radius: 10px; font-size: .78rem; }
.platform-stats strong { display: block; font-size: 1.3rem; }
.inline-settings-form { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: 10px; align-items: end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.platform-feature-fieldset { grid-column: 1 / -1; margin: 4px 0 0; padding: 14px; background: var(--canvas); }
.platform-feature-fieldset legend { color: var(--brand-dark); font-size: .86rem; }
.platform-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.platform-feature-grid .permission-option { min-height: 76px; background: var(--paper); }

.menu-admin-list, .staff-list { display: grid; gap: 9px; }
.menu-admin-list > article { display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.menu-admin-list h3 { margin: 5px 0 2px; }
.menu-admin-list p { margin: 0; color: var(--muted); font-size: .84rem; }
.menu-admin-list > article > div:last-child { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 8px; }
.menu-admin-rich-list > .menu-admin-card { display: block; padding: 0; overflow: hidden; }
.menu-admin-summary { display: grid; grid-template-columns: 132px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 16px 18px; }
.menu-admin-media { align-items: stretch !important; }
.menu-admin-media img, .menu-image-placeholder { width: 132px; height: 108px; object-fit: cover; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.menu-image-placeholder { display: grid; place-items: center; color: var(--muted); font-size: .75rem; font-weight: 800; }
.menu-admin-copy small { color: var(--muted); }
.menu-admin-price { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.menu-admin-tools { display: flex !important; flex-flow: row wrap !important; align-items: end !important; justify-content: flex-start !important; gap: 10px !important; padding: 12px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #faf7f2; }
.inline-upload-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-upload-form label { color: var(--muted); font-size: .72rem; }
.inline-upload-form input[type="file"] { min-height: 42px; max-width: 330px; padding: 8px; background: var(--paper); }
.menu-option-admin { padding: 16px 18px 18px; }
.menu-option-heading, .menu-option-group > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-option-heading > div, .menu-option-group > header > div { display: flex; flex-direction: column; }
.menu-option-heading small, .menu-option-group small { color: var(--muted); }
.menu-option-group { margin-top: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.menu-option-group.is-inactive { opacity: .68; }
.menu-option-values { display: flex !important; flex-flow: row wrap !important; align-items: stretch !important; justify-content: flex-start !important; gap: 7px !important; margin-top: 10px; }
.menu-option-value button { display: flex; flex-direction: column; min-height: 44px; padding: 7px 11px; color: var(--ink); border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; text-align: left; }
.menu-option-value.is-inactive button { text-decoration: line-through; opacity: .6; }
.menu-option-add-value { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(120px, .6fr) 100px auto; gap: 8px; align-items: end; margin-top: 10px; }
.menu-option-add-value label, .menu-option-add-group label { color: var(--muted); font-size: .72rem; }
.menu-option-add-value input, .menu-option-add-group input { min-height: 42px; margin-top: 3px; }
.menu-option-add-group { display: grid; grid-template-columns: minmax(180px, 1fr) 110px auto auto; gap: 9px; align-items: end; margin-top: 13px; padding: 13px; border: 1px dashed var(--brand); border-radius: 12px; }
.compact-check { min-height: 42px; align-items: center; }
.category-label { color: var(--brand-dark); font-size: .7rem; font-weight: 850; letter-spacing: .04em; }
.staff-list article { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.avatar { display: grid; place-items: center; width: 42px; height: 42px; color: white; background: var(--navy); border-radius: 13px; font-weight: 900; }
.staff-list h3, .staff-list p { margin: 0; }
.staff-list p { color: var(--muted); font-size: .8rem; }
.staff-list article > div:last-child { display: flex; flex-direction: column; align-items: flex-end; }
.staff-main { min-width: 0; }
.staff-main h3, .staff-main p { overflow-wrap: anywhere; }
.staff-role-list { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.role-badge { white-space: normal; text-align: left; }
.staff-categories { display: block; margin-top: 7px; overflow-wrap: anywhere; }
.staff-actions { gap: 1px; text-align: right; }
.staff-actions form { margin: 0; }
.staff-actions .text-button { justify-content: flex-end; text-align: right; }
.staff-permissions-dialog h2 { margin: 0 54px 4px 0; }
.role-fieldset, .chef-category-fieldset { padding: 15px; border-radius: 14px; }
.fieldset-help { margin: 0 0 11px; color: var(--muted); font-size: .78rem; }
.permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.permission-option { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 10px; min-height: 82px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; cursor: pointer; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.permission-option:hover { border-color: #c7a69e; }
.permission-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.permission-option input { width: 22px; height: 22px; min-height: 22px; margin: 2px 0 0; accent-color: var(--brand); }
.permission-option input:focus-visible { outline: 3px solid #e1a527; outline-offset: 3px; box-shadow: none; }
.permission-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.35; }
.permission-copy strong { font-size: .88rem; }
.permission-copy small { margin-top: 3px; font-size: .74rem; font-weight: 500; overflow-wrap: anywhere; }
.chef-category-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chef-category-grid .check-row { min-height: 44px; padding: 8px 10px; border-radius: 10px; background: var(--canvas); cursor: pointer; }
.chef-category-grid .check-row span { overflow-wrap: anywhere; }
.compact-alert { margin: 10px 0 0; }

.settings-card { display: grid; gap: 12px; max-width: 780px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.toggle-row.is-disabled { cursor: not-allowed; opacity: .62; }
.receipt-section-heading { align-items: center; margin-bottom: 16px; }
.receipt-section-heading .status-badge-row { justify-content: flex-end; }
.receipt-settings-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 340px); align-items: start; gap: 18px; }
.receipt-settings-form-column { display: grid; gap: 14px; min-width: 0; }
.receipt-settings-card { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.receipt-settings-card h3 { margin: 0 0 3px; }
.receipt-settings-card > div:first-child > p { margin: 0; color: var(--muted); font-size: .84rem; }
.receipt-branch-fieldset, .receipt-buyer-tax-fields { padding: 14px; background: var(--canvas); }
.receipt-choice-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.receipt-choice-row .check-row { min-height: 44px; }
.receipt-choice-row input { flex: 0 0 auto; }
.receipt-branch-fields { display: grid; grid-template-columns: minmax(150px, .7fr) minmax(180px, 1.3fr); gap: 10px; margin-top: 10px; }
.receipt-logo-dropzone { display: grid; place-items: center; min-height: 190px; padding: 16px; overflow: hidden; color: var(--muted); border: 2px dashed #c9bfb3; border-radius: 16px; background: var(--canvas); cursor: copy; transition: border-color .15s, background-color .15s, box-shadow .15s; }
.receipt-logo-dropzone:hover, .receipt-logo-dropzone.is-dragging { border-color: var(--brand); background: var(--brand-soft); }
.receipt-logo-dropzone:focus-visible { outline: 3px solid #e1a527; outline-offset: 3px; }
.receipt-logo-dropzone img { width: min(180px, 100%); height: 160px; object-fit: contain; }
.receipt-logo-placeholder { display: grid; justify-items: center; gap: 5px; text-align: center; }
.receipt-logo-placeholder strong { color: var(--ink); font-size: 1rem; }
.receipt-logo-placeholder span { max-width: 330px; font-size: .78rem; }
.receipt-logo-actions { flex-wrap: wrap; }
.receipt-logo-actions label.button { font-size: .82rem; }
#receipt-logo-file:focus-visible ~ .receipt-logo-actions label[for="receipt-logo-file"],
#receipt-logo-camera:focus-visible ~ .receipt-logo-actions label[for="receipt-logo-camera"] { outline: 3px solid #e1a527; outline-offset: 3px; }
.receipt-logo-remove { min-height: 44px; margin-left: auto; color: var(--red); cursor: pointer; }
.receipt-logo-status { min-height: 1.2em; color: var(--navy); font-size: .78rem; font-weight: 750; }
.receipt-logo-status.is-error { color: var(--red); }
.receipt-vat-fields { display: grid; grid-template-columns: minmax(150px, .42fr) minmax(260px, 1fr); align-items: end; gap: 12px; }
.receipt-vat-confirmation { min-height: 52px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); cursor: pointer; }
.receipt-vat-confirmation span { line-height: 1.4; }
.receipt-entitlement-note { margin: 0; }
.receipt-settings-save { justify-self: start; min-width: 240px; }
.receipt-profile-preview { position: sticky; top: 136px; min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 9px 26px rgba(38,31,24,.06); }
.receipt-profile-preview h3 { margin-bottom: 14px; }
.receipt-preview-paper { display: grid; justify-items: center; width: 80mm; max-width: 100%; min-height: 360px; margin: 0 auto; padding: 7mm 5mm; color: #111; overflow-wrap: anywhere; border: 1px solid #cfc8bf; background: white; text-align: center; font-size: .76rem; }
.receipt-preview-paper img { width: 96px; height: 80px; margin-bottom: 8px; object-fit: contain; }
.receipt-preview-paper > strong { font-size: 1rem; }
.receipt-preview-paper > span { white-space: pre-line; }
.receipt-preview-paper hr { width: 100%; margin: 13px 0; border: 0; border-top: 1px dashed #555; }
.receipt-preview-paper > b { font-size: 1rem; }
.receipt-preview-paper > small { margin-top: 8px; color: #555; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.receipt-payment-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.receipt-payment-card { display: flex; min-width: 0; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-top: 4px solid #e1a527; border-radius: var(--radius); background: var(--paper); box-shadow: 0 7px 20px rgba(38,31,24,.035); }
.receipt-payment-card.is-issued { border-top-color: var(--green); }
.receipt-payment-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.receipt-payment-card > header > div { min-width: 0; }
.receipt-payment-card h2 { margin: 3px 0 1px; font-size: 1.45rem; font-variant-numeric: tabular-nums; }
.receipt-payment-card header small { overflow-wrap: anywhere; }
.receipt-payment-context { color: var(--muted); font-size: .78rem; font-weight: 800; }
.receipt-issued-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 13px; border-radius: 11px; background: var(--green-soft); }
.receipt-issued-summary span { color: var(--muted); font-size: .78rem; }
.receipt-issued-summary strong { color: var(--green); overflow-wrap: anywhere; text-align: right; }
.receipt-create-options { display: grid; gap: 9px; margin-top: auto; padding-top: 13px; border-top: 1px dashed var(--line); }
.receipt-create-options > form { display: grid; }
.receipt-full-tax-details { overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); }
.receipt-full-tax-details > summary { display: flex; align-items: center; min-height: 46px; padding: 11px 13px; color: var(--navy); cursor: pointer; font-size: .84rem; font-weight: 850; }
.receipt-full-tax-details > summary:focus-visible { outline: 3px solid #e1a527; outline-offset: -3px; }
.receipt-full-tax-details[open] > summary { border-bottom: 1px solid var(--line); }
.receipt-buyer-form { display: grid; gap: 12px; padding: 14px; }
.receipt-buyer-vat-toggle { min-height: 44px; cursor: pointer; }
.receipt-buyer-tax-fields { display: grid; gap: 10px; }
.receipt-option-note { margin: 0; padding: 10px 12px; color: var(--muted); border-radius: 10px; background: var(--canvas); font-size: .78rem; }
.back-link { display: inline-block; margin-bottom: 16px; }
.table-detail-hero { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 20px; padding: 22px; color: white; background: var(--navy); border-radius: 22px; }
.table-detail-hero h1 { margin-bottom: 2px; }
.table-detail-hero p { margin: 0; color: #cbd8e4; }
.table-detail-hero .eyebrow { color: #ffc4b9; }
.detail-total { padding: 11px 14px; color: var(--ink); background: white; border-radius: 12px; text-align: right; }
.detail-total small, .detail-total strong { display: block; }
.detail-total strong { color: var(--green); }
.detail-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 12px; }
.detail-facts span { display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); }
.timeline-list { display: grid; gap: 8px; margin-top: 14px; }
.timeline-list article { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 13px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.timeline-list h3, .timeline-list p { margin: 4px 0 0; }
.timeline-list p { color: var(--muted); font-size: .8rem; }
.timeline-status { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.detail-bottom-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-bottom-grid > div { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.simple-list > div { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.simple-list > div:last-child { border: 0; }
.payment-summary { display: flex; align-items: center; gap: 13px; }
.payment-summary .success-icon { width: 44px; height: 44px; margin: 0; font-size: 1.2rem; }
.payment-summary strong { color: var(--green); font-size: 1.3rem; }
.payment-summary p { margin: 0; }
.toggle-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 16px; background: var(--canvas); border-radius: 14px; cursor: pointer; }
.toggle-row span { display: flex; flex-direction: column; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; width: 50px; height: 28px; border-radius: 999px; background: #c8c9c7; transition: .2s; }
.toggle-row i::after { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: .2s; }
.toggle-row input:checked + i { background: var(--green); }
.toggle-row input:checked + i::after { transform: translateX(22px); }
.toggle-row input:focus-visible + i { outline: 3px solid #e1a527; outline-offset: 3px; }
.quota-card { display: grid; grid-template-columns: 1fr auto auto; gap: 28px; align-items: center; max-width: 780px; margin-top: 16px; padding: 20px 22px; border-radius: var(--radius); color: white; background: var(--navy); }
.quota-card h2 { margin: 0; }
.quota-card > div:not(:first-child) { display: flex; flex-direction: column; align-items: center; }
.quota-card > div:not(:first-child) strong { font-size: 1.8rem; }
.quota-card span { color: #cbd8e4; font-size: .76rem; }

.app-dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); padding: 0; overflow-y: auto; overscroll-behavior: contain; color: var(--ink); border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 24px 80px rgba(0,0,0,.25); }
.app-dialog::backdrop { background: rgba(20,25,29,.55); backdrop-filter: blur(3px); }
.app-dialog form { position: relative; padding: 26px; }
.dialog-close { position: absolute; top: 12px; right: 14px; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--canvas); cursor: pointer; font-size: 1.3rem; }
fieldset { padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
legend { padding: 0 5px; font-size: .8rem; font-weight: 800; }

.customer-shell { background: #f7f4ef; }
.customer-shell .page-container { width: min(860px, calc(100% - 22px)); padding-top: 20px; }
.customer-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; color: white; background: linear-gradient(125deg, var(--navy), #244d70); border-radius: 22px; box-shadow: var(--shadow); }
.customer-hero h1 { margin-bottom: 3px; font-size: 2.2rem; }
.customer-hero p { margin: 0; color: #c9d9e6; }
.customer-hero .eyebrow { color: #ffc5bb; }
.bill-total { min-width: 140px; padding: 12px 14px; color: var(--ink); background: #fff; border-radius: 14px; text-align: right; }
.bill-total small, .bill-total strong { display: block; }
.bill-total strong { color: var(--green); font-size: 1.2rem; }
.customer-tabs { display: flex; gap: 5px; margin: 16px 0; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 13px; position: sticky; top: 82px; z-index: 15; box-shadow: 0 8px 25px rgba(38,31,24,.05); }
.customer-tabs a { display: inline-flex; flex: 1; align-items: center; justify-content: center; min-height: 44px; padding: 9px 12px; border-radius: 9px; text-align: center; font-size: .85rem; font-weight: 850; }
.customer-tabs a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.count-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; color: white; background: var(--brand); border-radius: 999px; font-size: .7rem; }
.category-pills { display: flex; gap: 7px; margin: 16px 0; overflow-x: auto; scrollbar-width: none; }
.category-pills button { flex: 0 0 auto; min-height: 44px; padding: 8px 13px; color: var(--muted); background: var(--paper); border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 750; }
.category-pills button.active { color: white; background: var(--brand); border-color: var(--brand); }
.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.menu-card { display: flex; flex-direction: column; min-height: 230px; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); transition: .18s; }
.menu-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.menu-card-image { width: calc(100% + 34px); height: 190px; margin: -17px -17px 15px; object-fit: cover; border-radius: 17px 17px 0 0; background: var(--canvas); }
.menu-card-top { display: flex; justify-content: space-between; gap: 10px; }
.menu-card h3 { margin: 11px 0 4px; font-size: 1.08rem; }
.menu-card > p { flex: 1; color: var(--muted); font-size: .82rem; }
.customer-menu-options { display: grid; gap: 8px; margin: 10px 0; padding: 10px; border-radius: 11px; background: var(--canvas); }
.customer-menu-options label { color: var(--muted); font-size: .74rem; font-weight: 800; }
.customer-menu-options select { min-height: 44px; margin-top: 3px; background: var(--paper); }
.quantity-row { display: grid; grid-template-columns: 44px 48px 44px; justify-content: flex-end; align-items: center; }
.quantity-row input { min-height: 44px; margin: 0; padding: 5px; border: 0; background: transparent; text-align: center; font-weight: 900; }
.quantity-button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 11px; background: var(--canvas); cursor: pointer; font-size: 1.25rem; font-weight: 900; }
.quantity-button.add { color: white; background: var(--brand); border-color: var(--brand); }
.item-note { margin-top: 10px; color: var(--muted); font-size: .72rem; }
.item-note input { min-height: 44px; font-size: 1rem; }
.order-note { display: block; margin-top: 12px; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; }
.cart-bar { position: sticky; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 16px auto 0; padding: 11px 12px 11px 18px; color: white; background: rgba(23,50,77,.96); border-radius: 15px; box-shadow: 0 16px 45px rgba(23,50,77,.28); backdrop-filter: blur(12px); }
.cart-bar[hidden] { display: none; }
.cart-bar div { display: flex; flex-direction: column; }
.cart-bar small { color: #cbd8e4; }
.order-stack { display: grid; gap: 13px; }
.order-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.order-card > header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: #faf7f2; border-bottom: 1px solid var(--line); }
.order-card > header div { display: flex; align-items: center; gap: 10px; }
.order-items { padding: 4px 16px; }
.customer-order-item { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.customer-order-item:last-child { border: 0; }
.item-status-line { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 11px; }
.status-dot { display: block; width: 9px; height: 9px; border-radius: 50%; }
.item-status-line div { display: flex; flex-direction: column; }
.item-note-text { margin: 6px 0 0 21px; color: var(--muted); font-size: .78rem; }
.order-item-options, .task-options { display: grid; gap: 2px; margin: 7px 0 5px 21px; padding: 0; color: var(--brand-dark); font-size: .78rem; list-style: none; }
.task-options { margin-left: 0; padding: 8px 10px; background: var(--brand-soft); border-radius: 8px; }
.service-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: center; margin-top: 34px; padding: 24px; color: white; background: var(--navy); border-radius: 22px; }
.service-panel p { color: #cbd8e4; }
.service-actions { display: grid; gap: 10px; }
.service-actions form { display: grid; gap: 7px; }
.service-actions input { margin: 0; }
.service-actions small { color: #cbd8e4; }
.closed-session, .approval-state, .empty-state { padding: 48px 24px; border: 1px solid var(--line); border-radius: 22px; background: var(--paper); text-align: center; }
.closed-session { margin-top: 18px; }
.closed-session .success-icon, .empty-state .success-icon { margin-inline: auto; }
.closed-session > strong { color: var(--green); font-size: 1.35rem; }
.empty-state { grid-column: 1 / -1; }
.empty-state > span { display: block; color: var(--green); font-size: 2rem; font-weight: 900; }
.empty-state.compact { padding: 24px; }
.empty-state h2, .empty-state h3 { margin-bottom: 4px; }
.empty-state p { margin: 0; color: var(--muted); }

.analytics-title { align-items: center; }
.platform-analytics-count { display: flex; flex-direction: column; align-items: flex-end; min-width: 150px; }
.platform-analytics-count strong { font-size: 2.35rem; line-height: 1; }
.analytics-filter { display: grid; grid-template-columns: minmax(180px, .8fr) repeat(2, minmax(170px, 1fr)) auto; align-items: end; gap: 12px; margin-bottom: 18px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 6px 18px rgba(38,31,24,.04); }
.analytics-filter input, .analytics-filter select { margin-bottom: 0; }
.analytics-filter .button { min-width: 140px; }
.analytics-metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.analytics-metric-grid article { min-width: 0; padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: 0 6px 18px rgba(38,31,24,.04); }
.analytics-metric-grid article.primary { color: white; border-color: var(--navy); background: var(--navy); }
.analytics-metric-grid span, .analytics-metric-grid small { display: block; }
.analytics-metric-grid span { color: var(--muted); font-size: .82rem; font-weight: 750; }
.analytics-metric-grid strong { display: block; margin: 8px 0 5px; overflow-wrap: anywhere; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.1; }
.analytics-metric-grid article.primary span, .analytics-metric-grid article.primary small { color: #d9e5ee; }
.analytics-section > .section-heading { margin-bottom: 14px; }
.analytics-chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.analytics-chart-card { min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 7px 22px rgba(38,31,24,.04); }
.analytics-chart-card figcaption { display: flex; flex-direction: column; padding: 17px 18px 10px; }
.analytics-chart-card figcaption strong { font-size: 1.04rem; }
.analytics-chart-card figcaption span { color: var(--muted); font-size: .78rem; }
.analytics-chart-scroll { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.analytics-chart-scroll:focus-visible { outline: 3px solid #e1a527; outline-offset: -3px; }
.analytics-chart { display: block; width: 100%; min-width: 720px; height: auto; padding: 0 8px 8px; }
.chart-grid-line { stroke: #e9e3da; stroke-width: 1; }
.chart-axis-label, .chart-bucket-label { fill: var(--muted); font-family: var(--font); font-size: 10px; }
.analytics-chart .chart-bar { fill: var(--brand); }
.analytics-chart.customers .chart-bar { fill: var(--navy); }
.analytics-data-details { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.analytics-data-details > summary { min-height: 46px; padding: 12px 15px; cursor: pointer; color: var(--navy); font-weight: 800; }
.analytics-table-wrap { max-width: 100%; overflow-x: auto; border-top: 1px solid var(--line); }
.analytics-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: .84rem; }
.analytics-table th, .analytics-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.analytics-table th:first-child, .analytics-table td:first-child { text-align: left; }
.analytics-table thead th { color: var(--muted); background: #faf7f2; font-size: .75rem; }
.analytics-ranking-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.analytics-ranking-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 7px 22px rgba(38,31,24,.04); }
.analytics-ranking-card > .section-heading { align-items: center; margin-bottom: 12px; }
.analytics-ranking-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.analytics-ranking-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 0; border-bottom: 1px dashed var(--line); }
.analytics-ranking-list li:last-child { border-bottom: 0; }
.ranking-number { display: grid; place-items: center; width: 30px; height: 30px; color: var(--brand-dark); background: var(--brand-soft); border-radius: 10px; font-size: .78rem; font-weight: 900; }
.ranking-main { display: flex; min-width: 0; flex-direction: column; }
.ranking-main > strong, .ranking-title-row strong { overflow-wrap: anywhere; }
.ranking-main progress { width: 100%; height: 7px; margin: 7px 0 5px; overflow: hidden; appearance: none; border: 0; border-radius: 999px; background: var(--canvas); }
.ranking-main progress::-webkit-progress-bar { background: var(--canvas); border-radius: 999px; }
.ranking-main progress::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
.ranking-main progress::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.ranking-main small { font-size: .72rem; }
.ranking-sales { color: var(--navy); text-align: right; white-space: nowrap; }
.ranking-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.platform-ranking .analytics-ranking-list li { grid-template-columns: 38px minmax(0, 1fr) minmax(110px, auto); }
.analytics-adoption-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: -12px; padding: 12px 16px; color: var(--navy); border: 1px solid #d6e3ee; border-radius: 13px; background: var(--navy-soft); }
.analytics-adoption-summary strong { font-size: 1.15rem; }
.analytics-definition-note { margin-top: 20px; padding: 16px 18px; color: var(--muted); border-left: 4px solid var(--brand); border-radius: 0 13px 13px 0; background: var(--paper); font-size: .82rem; }
.analytics-definition-note strong { color: var(--ink); }
.analytics-definition-note p { margin: 4px 0 0; }

.takeaway-heading > form { flex: 0 0 auto; }
.takeaway-policy-banner { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; padding: 16px 18px; border: 1px solid #d6e3ee; border-left: 5px solid var(--navy); border-radius: 14px; background: var(--navy-soft); }
.takeaway-policy-banner.is-prepay { border-color: #efd8aa; border-left-color: #d38b18; background: #fff8e8; }
.takeaway-policy-banner > div { display: flex; min-width: 0; flex-direction: column; gap: 3px; }
.takeaway-policy-banner span { color: var(--muted); font-size: .82rem; }
.takeaway-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.takeaway-card { display: flex; min-width: 0; flex-direction: column; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow-soft); }
.takeaway-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.takeaway-card h2 { margin: 2px 0 0; overflow-wrap: anywhere; }
.takeaway-card p { margin: 0; color: var(--muted); }
.takeaway-facts { display: flex; flex-wrap: wrap; gap: 8px; }
.takeaway-facts span { display: flex; flex-direction: column; min-width: 105px; padding: 9px 11px; border-radius: 11px; background: var(--canvas); color: var(--muted); font-size: .72rem; }
.takeaway-facts strong { color: var(--ink); font-size: 1rem; }
.takeaway-actions { align-items: flex-end; }
.takeaway-actions .payment-form { display: grid; grid-template-columns: minmax(125px, 1fr) auto; align-items: end; gap: 8px; flex: 1 1 280px; }
.takeaway-actions .payment-form label { margin: 0; }
.takeaway-policy-settings { margin: 8px 0 18px; padding: 17px; border: 1px solid var(--line); border-radius: 14px; }
.takeaway-policy-settings legend { padding: 0 7px; color: var(--ink); font-weight: 900; }
.takeaway-policy-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 12px; }
.takeaway-policy-options > label { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; min-height: 100px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); cursor: pointer; }
.takeaway-policy-options input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); }
.takeaway-policy-options span { display: flex; flex-direction: column; gap: 4px; }
.takeaway-policy-options small { color: var(--muted); line-height: 1.45; }

.toast-region { position: fixed; right: 16px; bottom: 16px; z-index: 90; display: grid; gap: 8px; width: min(360px, calc(100% - 32px)); }
.toast { display: flex; flex-direction: column; padding: 13px 15px; color: white; background: var(--navy); border-left: 4px solid var(--brand); border-radius: 12px; box-shadow: 0 16px 44px rgba(0,0,0,.25); animation: toast-in .25s ease-out; }
.toast small { color: #d2dee8; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

.print-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: white; }
.food-label { width: 76mm; min-height: 58mm; padding: 5mm; color: #000; border: 2px solid #000; background: white; }
.label-brand { display: block; border-bottom: 1px solid #000; padding-bottom: 2mm; text-align: center; font-weight: 900; }
.label-table { display: flex; justify-content: space-between; align-items: baseline; margin: 3mm 0; }
.label-table strong { font-size: 18mm; line-height: 1; }
.food-label h1 { margin-bottom: 2mm; font-size: 6mm; }
.label-note { padding: 2mm; margin-bottom: 3mm; border: 1px dashed #000; font-weight: 800; }
.print-button { margin-top: 14px; }

@media (max-width: 900px) {
  .landing-grid { grid-template-columns: 1fr; gap: 20px; min-height: 0; }
  .workflow-card { transform: none; }
  .metric-grid, .table-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid.with-waitlist { grid-template-columns: repeat(3, 1fr); }
  .compact-grid, .task-grid, .bill-grid { grid-template-columns: repeat(2, 1fr); }
  .security-field-grid { grid-template-columns: repeat(2, 1fr); }
  .inline-settings-form { grid-template-columns: repeat(3, 1fr); }
  .inline-settings-form .button { grid-column: 1 / -1; }
  .analytics-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-filter .button { grid-column: 1 / -1; }
  .analytics-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .analytics-chart-grid, .analytics-ranking-grid { grid-template-columns: 1fr; }
  .takeaway-grid { grid-template-columns: 1fr; }
  .receipt-settings-layout { grid-template-columns: 1fr; }
  .receipt-profile-preview { position: static; }
}

@media (max-width: 620px) {
  .topbar { height: 62px; padding: 0 13px; }
  .brand { font-size: .9rem; }
  .brand-mark { width: 32px; height: 32px; }
  .account-chip { gap: 8px; }
  .account-chip span { max-width: 145px; line-height: 1.12; }
  .account-chip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .account-chip small { display: -webkit-box; overflow: hidden; font-size: .62rem; line-height: 1.15; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .account-chip > a { flex: 0 0 auto; }
  .section-nav { top: 62px; padding-inline: 10px; }
  .page-container { width: min(100% - 20px, 1180px); padding-top: 22px; }
  .landing-grid { padding-top: 24px; }
  .landing-copy h1 { font-size: 2.45rem; }
  .landing-copy .button-row { align-items: stretch; flex-direction: column; }
  .login-options { grid-template-columns: 1fr; gap: 2px; }
  .auth-links { justify-content: flex-start; }
  .feature-strip, .metric-grid, .table-grid, .compact-grid, .task-grid, .bill-grid, .menu-grid { grid-template-columns: 1fr; }
  .feature-strip { gap: 8px; }
  .section-heading { align-items: flex-start; }
  .dashboard-title { flex-direction: column; }
  .dashboard-title > .button, .dashboard-title > .table-heading-actions { width: 100%; }
  .table-heading-actions .button { flex: 1; }
  .date-chip, .metric-mini { align-items: flex-start; text-align: left; }
  .platform-analytics-count { align-items: flex-start; }
  .analytics-filter { grid-template-columns: 1fr; padding: 15px; }
  .analytics-filter .button { grid-column: auto; width: 100%; }
  .analytics-metric-grid { grid-template-columns: 1fr; }
  .analytics-chart-card figcaption { padding-inline: 15px; }
  .analytics-ranking-card { padding: 16px; }
  .analytics-ranking-list li, .platform-ranking .analytics-ranking-list li { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }
  .ranking-sales { grid-column: 2; text-align: left; }
  .ranking-title-row { align-items: flex-start; flex-direction: column; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .metric-grid.with-waitlist { grid-template-columns: repeat(2, 1fr); }
  .metric-grid a { padding: 14px; }
  .metric-grid strong { font-size: 1.6rem; }
  .table-card { min-height: 170px; }
  .waitlist-summary { grid-template-columns: 1fr; }
  .waitlist-match-form { grid-template-columns: 1fr; }
  .waitlist-card > header { align-items: flex-start; }
  .waitlist-action-row { align-items: stretch; flex-direction: column; }
  .waitlist-action-row form, .waitlist-action-row button { width: 100%; }
  .called-table-panel { grid-template-columns: 1fr; }
  .called-table-panel > strong { grid-row: auto; }
  .security-field-grid, .password-policy-summary, .password-rules { grid-template-columns: 1fr; }
  .security-card { padding: 17px; }
  .security-save-button { width: 100%; min-width: 0; }
  .outbox-card { grid-template-columns: 1fr; }
  .outbox-actions { align-items: stretch; max-width: none; text-align: left; }
  .outbox-actions .button { width: 100%; }
  .type-management-list article { grid-template-columns: 1fr; }
  .type-management-list article form, .type-management-list article .button { width: 100%; }
  .dialog-panel { padding: 22px 18px; }
  .reserved-detail-card { grid-template-columns: 1fr; }
  .reserved-detail-card .button-row { align-items: stretch; flex-direction: column; }
  .qr-result-card { grid-template-columns: 1fr; text-align: center; }
  .qr-image { justify-self: center; order: -1; }
  .platform-card > header { flex-direction: column; }
  .platform-stats { align-self: stretch; }
  .platform-stats span { flex: 1; }
  .inline-settings-form { grid-template-columns: 1fr 1fr; }
  .inline-settings-form label:first-of-type { grid-column: 1 / -1; }
  .platform-feature-grid, .receipt-payment-list, .receipt-branch-fields, .receipt-vat-fields { grid-template-columns: 1fr; }
  .receipt-section-heading { align-items: flex-start; flex-direction: column; }
  .receipt-section-heading .status-badge-row { justify-content: flex-start; }
  .receipt-settings-card { padding: 16px; }
  .receipt-logo-actions { align-items: stretch; flex-direction: column; }
  .receipt-logo-actions .button, .receipt-logo-remove, .receipt-settings-save { width: 100%; margin-left: 0; }
  .receipt-profile-preview { padding: 16px; }
  .receipt-preview-paper { min-height: 320px; padding: 6mm 4mm; }
  .receipt-payment-card > header { gap: 8px; }
  .staff-list article { grid-template-columns: 42px 1fr; }
  .staff-list article > div:last-child { grid-column: 2; align-items: flex-start; }
  .staff-actions { width: 100%; text-align: left; }
  .staff-actions .text-button { justify-content: flex-start; text-align: left; }
  .permission-grid, .chef-category-grid { grid-template-columns: 1fr; }
  .permission-option { min-height: 0; }
  .table-recovery-actions { align-items: stretch; flex-direction: column; }
  .qr-session-actions, .qr-session-actions .button, .qr-session-actions form, .qr-session-actions form .button { width: 100%; }
  .quota-card { grid-template-columns: 1fr 1fr; }
  .quota-card > div:first-child { grid-column: 1 / -1; }
  .table-detail-hero { grid-template-columns: 1fr auto; }
  .table-detail-hero .detail-total { grid-column: 1 / -1; text-align: left; }
  .detail-facts { grid-template-columns: repeat(2, 1fr); }
  .timeline-list article { grid-template-columns: 10px 1fr; }
  .timeline-status { grid-column: 2; align-items: flex-start; }
  .detail-bottom-grid { grid-template-columns: 1fr; }
  .customer-shell .page-container { width: calc(100% - 14px); padding-top: 8px; }
  .customer-hero { padding: 17px; border-radius: 17px; }
  .customer-hero h1 { font-size: 1.65rem; }
  .customer-hero p { font-size: .75rem; }
  .bill-total { min-width: 118px; padding: 9px; }
  .customer-tabs { top: 69px; }
  .menu-card { min-height: 0; }
  .menu-admin-summary { grid-template-columns: 88px minmax(0, 1fr); align-items: start; }
  .menu-admin-media img, .menu-image-placeholder { width: 88px; height: 78px; }
  .menu-admin-price { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
  .menu-admin-tools, .inline-upload-form { align-items: stretch !important; flex-direction: column !important; }
  .inline-upload-form input[type="file"], .inline-upload-form .button, .menu-admin-tools form, .menu-admin-tools .text-button { width: 100%; max-width: none; }
  .menu-option-add-value, .menu-option-add-group { grid-template-columns: 1fr; }
  .menu-option-add-value .button, .menu-option-add-group .button { width: 100%; }
  .menu-card-image { height: 210px; }
  .service-panel { grid-template-columns: 1fr; gap: 12px; }
  .takeaway-heading > form, .takeaway-heading > form .button { width: 100%; }
  .takeaway-policy-banner { align-items: stretch; flex-direction: column; }
  .takeaway-policy-banner .button { width: 100%; }
  .takeaway-policy-options { grid-template-columns: 1fr; }
  .takeaway-card .button-row, .takeaway-actions { align-items: stretch; flex-direction: column; }
  .takeaway-card .button-row > *, .takeaway-card .button-row form, .takeaway-card .button-row .button { width: 100%; }
  .takeaway-actions .payment-form { grid-template-columns: 1fr; }
  .cart-bar { bottom: max(6px, env(safe-area-inset-bottom)); }
}

.promotion-menu-card { border-color: #dbb77a; background: linear-gradient(150deg, #fffbf1 0%, #fff 65%); }
.promotion-saving { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 12px; }
.promotion-saving s { color: #777; font-size: .85rem; }
.promotion-saving span { color: #8d4c12; font-size: .85rem; font-weight: 700; }
.promotion-components { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.promotion-components li { padding-left: 12px; border-left: 2px solid #dab785; }
.promotion-components strong { font-size: .9rem; }
.promotion-components small { display: block; color: #606060; }
.promotion-order-hint { display: block; color: #666; font-size: .75rem; line-height: 1.6; margin-bottom: 12px; }
.promotion-item-label { border-radius: 7px; background: #fff3df; color: #7b4b16; padding: 5px 8px; font-size: .78rem; margin-bottom: 8px; overflow-wrap: anywhere; }
.promotion-item-label span { font-weight: 700; }
.promotion-allocated-price { display: block; font-size: .65rem; color: #777; }

@media print {
  body.print-page { min-height: 0; padding: 0; }
  .food-label { border: 1px solid #000; }
  .print-button { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .remember-row input[type="checkbox"] { appearance: auto; -webkit-appearance: checkbox; }
  .remember-row input[type="checkbox"]::after { display: none; }
}
