@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #1C1B19; --ink-soft: #6B6660; --paper: #FFFFFF; --surface: #F1F4EE; --surface-2: #E3E9DC;
  --line: #E1E6DA; --brand: #2F5233; --brand-dark: #1F3A23; --brand-tint: #E4EEE1;
  --amber: #C89B3C; --amber-tint: #FBF2DD; --chili: #C81E3A; --chili-tint: #FBE6E9;
  --radius-s: 8px; --radius-m: 14px; --radius-l: 22px;
  --shadow: 0 1px 2px rgba(28,27,25,.06), 0 8px 24px -12px rgba(28,27,25,.2);
  --font-display: 'Fraunces', Georgia, serif; --font-body: 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); background: var(--surface); color: var(--ink); padding-bottom: env(safe-area-inset-bottom,0); }
#app { max-width: 720px; margin: 0 auto; min-height: 100vh; background: var(--paper); padding-bottom: 70px; }
@media (min-width:900px){ #app{ max-width:960px; } }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

.topbar { position: sticky; top: 0; z-index: 10; background: var(--brand); color: #fff; padding: 16px 20px; padding-top: max(16px, env(safe-area-inset-top)); display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { font-family: var(--font-display); font-size: 19px; margin: 0; }
.open-toggle { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.switch { width: 38px; height: 22px; background: rgba(255,255,255,.3); border-radius: 999px; position: relative; cursor: pointer; border: none; }
.switch::after { content:''; width: 18px; height: 18px; background: #fff; border-radius: 50%; position: absolute; top: 2px; left: 2px; transition: .15s; }
.switch.on { background: var(--amber); }
.switch.on::after { left: 18px; }

.tabs { display: flex; border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 62px; z-index: 9; overflow-x: auto; }
.tabs a { padding: 13px 16px; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); white-space: nowrap; border-bottom: 2px solid transparent; }
.tabs a.active { color: var(--brand); border-color: var(--brand); }

.screen { padding: 18px 20px; }
.stat-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 20px; }
@media(min-width:600px){ .stat-grid{ grid-template-columns: repeat(4,1fr);} }
.stat-card { background: var(--brand-tint); border-radius: var(--radius-m); padding: 14px; }
.stat-card .num { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.stat-card .lbl { font-size: 12px; color: var(--ink-soft); }

.order-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 14px 16px; margin-bottom: 12px; }
.order-card .row1 { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.order-card h4 { margin: 0; font-size: 15.5px; }
.order-card .meta { font-size: 12.5px; color: var(--ink-soft); margin: 2px 0 10px; }
.status-tag { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface); color: var(--ink-soft); text-transform: capitalize; }
.status-tag.placed { background: var(--amber-tint); color: var(--amber); }
.status-tag.accepted, .status-tag.preparing { background: var(--brand-tint); color: var(--brand); }
.status-tag.ready_for_pickup { background: #E3ECFB; color: #2A4E8C; }
.status-tag.cancelled { background: var(--chili-tint); color: var(--chili); }
.item-line { display: flex; justify-content: space-between; font-size: 13.5px; padding: 4px 0; color: var(--ink-soft); }
.action-row { display: flex; gap: 8px; margin-top: 10px; }
.btn { border: none; border-radius: var(--radius-s); padding: 10px 16px; font-weight: 700; font-size: 13.5px; cursor: pointer; background: var(--brand); color: #fff; }
.btn.outline { background: transparent; border: 1.5px solid var(--line); color: var(--ink); }
.btn.danger { background: var(--chili); }
.btn.block { width: 100%; padding: 13px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.menu-row { display: flex; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); padding: 12px 0; }
.menu-row img { width: 56px; height: 56px; border-radius: var(--radius-s); object-fit: cover; background: var(--surface); }
.menu-row .mi { flex: 1; }
.menu-row .mi h4 { margin: 0 0 3px; font-size: 14.5px; }
.menu-row .mi p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.pill-toggle { font-size: 11px; font-weight: 700; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; }
.pill-toggle.active { background: var(--brand-tint); border-color: var(--brand); color: var(--brand); }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 13px; border-radius: var(--radius-s); border: 1.5px solid var(--line); }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(28,27,25,.4); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: #fff; border-radius: 18px 18px 0 0; padding: 22px 20px; width: 100%; max-width: 480px; max-height: 85vh; overflow-y: auto; }
@media(min-width:600px){ .modal-backdrop{ align-items:center; } .modal{ border-radius:18px; } }
.empty-state { text-align: center; padding: 50px 20px; color: var(--ink-soft); }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600; z-index: 60; }
.login-wrap { max-width: 380px; margin: 60px auto; padding: 0 20px; }
.login-wrap h2 { font-family: var(--font-display); }
