/* IDEONIX Food — shared styles for customer app, shop dashboard and admin.
   Palette: lemon (signature), deep navy ink, white paper, cool grey surface, olive-green for "open". */
:root {
  --lemon: #FFD23F;
  --lemon-deep: #F2BC00;
  --ink: #1B1E3C;
  --ink-2: #4A4E70;
  --ink-3: #8A8EAA;
  --paper: #FFFFFF;
  --surface: #F3F4F8;
  --line: #E2E4EE;
  --open: #1F8A5B;
  --danger: #C8323C;
  --info: #2E5BBA;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(27, 30, 60, .12);
  --font: 'Commissioner', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #F1F2F8; --ink-2: #C3C6DA; --ink-3: #8E92AE;
    --paper: #161830; --surface: #0F1124; --line: #2A2D4A;
    --shadow: 0 6px 24px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #F1F2F8; --ink-2: #C3C6DA; --ink-3: #8E92AE;
  --paper: #161830; --surface: #0F1124; --line: #2A2D4A;
  --shadow: 0 6px 24px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--surface); font-size: 16px; line-height: 1.45; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--info); outline-offset: 2px; }
.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; color: var(--ink-3); }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 12px; }
.price { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer;
  font-weight: 700; background: var(--lemon); color: #1B1E3C; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: background .15s;
}
.btn:hover { background: var(--lemon-deep); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px var(--danger); }
.btn.green { background: var(--open); color: #fff; }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 14px; font-size: .875rem; }
.icon-btn { appearance: none; border: 0; background: var(--paper); width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; font-size: 1.1rem; box-shadow: inset 0 0 0 1.5px var(--line); }

/* ---------- forms ---------- */
label.field { display: block; }
label.field > span { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--paper); outline: none; min-height: 46px;
}
.input:focus { border-color: var(--ink); }
textarea.input { min-height: 80px; resize: vertical; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--ink); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

.segmented { display: inline-flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 4px; box-shadow: inset 0 0 0 1.5px var(--line); }
.segmented button { border: 0; background: transparent; padding: 9px 18px; border-radius: 999px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

/* ---------- surfaces ---------- */
.panel { background: var(--paper); border-radius: var(--radius); padding: 18px; }
.panel h2, .panel h3 { margin: 0 0 12px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--surface); color: var(--ink-2); white-space: nowrap; }
.badge.open { background: rgba(31, 138, 91, .12); color: var(--open); }
.badge.closed { background: rgba(200, 50, 60, .1); color: var(--danger); }
.badge.lemon { background: var(--lemon); color: #1B1E3C; }
.badge.info { background: rgba(46, 91, 186, .12); color: var(--info); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- toast & sheet ---------- */
#toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 100;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); color: #fff; }

.sheet-backdrop { position: fixed; inset: 0; background: rgba(15, 17, 36, .5); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: 22px; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } #toast { transition: none; } }

.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.empty strong { display: block; color: var(--ink); font-size: 1.15rem; margin-bottom: 6px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================================================================ customer app */
.topbar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 10px; height: 60px; }
.logo { font-weight: 900; font-size: 1.15rem; letter-spacing: -.02em; text-decoration: none; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo i { flex: none; }
@media (max-width: 420px) { .topbar .logo { font-size: 1rem; } .loc-pill { max-width: 34vw; } }
.logo i { width: 26px; height: 26px; border-radius: 8px; background: var(--lemon); display: inline-block; position: relative; }
.logo i::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #1B1E3C; }
.loc-pill { border: 0; background: var(--surface); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang { border: 0; background: none; font-weight: 800; cursor: pointer; padding: 8px; color: var(--ink-2); }

.hero { background: var(--lemon); color: #1B1E3C; }
.hero .wrap { padding-top: 28px; padding-bottom: 28px; }
.hero h1 { font-size: clamp(2.1rem, 7vw, 3.6rem); line-height: .98; letter-spacing: -.035em; font-weight: 900; margin: 0 0 18px; max-width: 13ch; }
.hero .search { display: flex; gap: 8px; background: #fff; border-radius: 999px; padding: 6px 6px 6px 18px; max-width: 560px; }
.hero .search input { flex: 1; border: 0; outline: none; background: transparent; min-width: 0; color: #1B1E3C; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 0; padding: 9px 16px; border-radius: 999px; background: var(--paper); font-weight: 700; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; }

.section-title { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin: 22px 0 10px; }
.shop-list { display: grid; grid-template-columns: 1fr; gap: 10px; padding-bottom: 40px; }
@media (min-width: 760px) { .shop-list { grid-template-columns: 1fr 1fr; } }
.shop-row { display: flex; gap: 14px; background: var(--paper); border-radius: var(--radius); padding: 10px; text-decoration: none; align-items: stretch; }
.shop-row:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.shop-row.closed { opacity: .62; }
.shop-thumb { width: 104px; flex: none; border-radius: var(--radius-sm); background: var(--surface) center/cover no-repeat; display: grid; place-items: center; font-weight: 900; font-size: 2rem; color: var(--ink-3); aspect-ratio: 1; }
.shop-row h3 { margin: 2px 0 4px; font-size: 1.05rem; letter-spacing: -.01em; }
.shop-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; color: var(--ink-2); margin-top: 6px; }

.shop-hero { background: var(--ink) center/cover no-repeat; height: 190px; position: relative; }
.shop-hero.plain { height: 72px; background: var(--lemon); }
.shop-hero .back { position: absolute; top: 14px; left: 14px; }
.shop-head { background: var(--paper); padding: 18px 0 12px; }
.shop-head h1 { margin: 0 0 6px; font-size: clamp(1.7rem, 5vw, 2.4rem); letter-spacing: -.03em; line-height: 1.05; }
.shop-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fact { background: var(--surface); border-radius: 10px; padding: 7px 12px; font-size: .85rem; }
.fact b { display: block; font-size: .95rem; }
.cat-tabs { position: sticky; top: 60px; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.cat-tabs .chips { padding: 10px 16px; }
.menu-cat { scroll-margin-top: 130px; }
.menu-cat h2 { font-size: 1.25rem; margin: 26px 0 10px; letter-spacing: -.02em; }
.product { display: flex; gap: 14px; background: var(--paper); padding: 14px; border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; border: 0; width: 100%; text-align: left; }
.product:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.product.off { opacity: .5; cursor: default; }
.product h3 { margin: 0 0 4px; font-size: 1rem; }
.product p { margin: 0 0 8px; font-size: .88rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-img { width: 96px; height: 96px; flex: none; border-radius: var(--radius-sm); background: var(--surface) center/cover no-repeat; position: relative; }
.add-dot { position: absolute; right: -6px; bottom: -6px; width: 34px; height: 34px; border-radius: 50%; background: var(--lemon); color: #1B1E3C; font-weight: 900; display: grid; place-items: center; font-size: 1.3rem; box-shadow: 0 0 0 3px var(--paper); }
.in-cart { display: inline-block; background: var(--ink); color: var(--paper); border-radius: 6px; padding: 0 7px; font-size: .78rem; font-weight: 800; margin-right: 6px; }

.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--surface) 70%, transparent); }
.cart-bar .btn { width: 100%; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; padding: 15px 20px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); }
.cart-bar .count { background: var(--lemon); color: #1B1E3C; border-radius: 8px; padding: 0 9px; }

.qty { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border-radius: 999px; padding: 3px; }
.qty button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--paper); font-weight: 900; font-size: 1.1rem; cursor: pointer; }
.qty span { min-width: 28px; text-align: center; font-weight: 800; }

.line { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:last-child { border-bottom: 0; }
.sum { display: flex; justify-content: space-between; padding: 4px 0; }
.sum.total { font-size: 1.2rem; font-weight: 800; padding-top: 10px; }

.page { padding-top: 18px; padding-bottom: 110px; }
.page h1 { font-size: 1.8rem; letter-spacing: -.03em; margin: 6px 0 16px; }

/* order tracking */
.track-status { background: var(--ink); color: var(--paper); border-radius: var(--radius); padding: 22px; }
.track-status h1 { color: inherit; margin: 0 0 6px; font-size: 1.7rem; }
.track-status .eta { font-size: 3rem; font-weight: 900; letter-spacing: -.04em; line-height: 1; color: var(--lemon); }
.steps { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.steps li { font-size: .75rem; color: rgba(255,255,255,.55); border-top: 4px solid rgba(255,255,255,.18); padding-top: 8px; }
.steps li.done { color: #fff; border-top-color: var(--lemon); }
.stars { display: flex; gap: 6px; }
.stars button { font-size: 2rem; border: 0; background: none; cursor: pointer; color: var(--line); padding: 0; line-height: 1; }
.stars button.on { color: var(--lemon-deep); }

/* ================================================================ dashboards (partner + admin) */
.dash { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.side { background: var(--ink); color: #fff; padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
:root[data-theme="dark"] .side, .side { --side-ink: #fff; }
.side .logo { color: #fff; margin: 0 8px 18px; }
.side .shopname { margin: 0 8px 16px; font-size: .9rem; color: rgba(255,255,255,.7); }
.nav-btn { border: 0; background: transparent; color: rgba(255,255,255,.75); text-align: left; padding: 11px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.nav-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-btn[aria-current="page"] { background: var(--lemon); color: #1B1E3C; }
.nav-btn .n { background: var(--danger); color: #fff; border-radius: 999px; padding: 0 8px; font-size: .78rem; }
.side .spacer { flex: 1; }
.main { padding: 22px 24px 60px; min-width: 0; }
.main h1 { margin: 0 0 18px; font-size: 1.7rem; letter-spacing: -.03em; }
@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .side { align-self: start; }
  .lbl { display: none; }
  .menu-admin .prod .btn.sm { padding: 7px 11px; }
  .side { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; }
  .side .logo, .side .shopname, .side .spacer { display: none; }
  .nav-btn { flex: none; padding: 9px 12px; }
  .main { padding: 16px 14px 60px; }
}

.status-strip { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--paper); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--paper); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 1.7rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--ink-2); font-size: .85rem; }

.order-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.ticket { background: var(--paper); border-radius: var(--radius); padding: 16px; border-top: 6px solid var(--line); }
.ticket.s-new { border-top-color: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
.ticket.s-accepted { border-top-color: var(--lemon-deep); }
.ticket.s-ready, .ticket.s-on_the_way { border-top-color: var(--open); }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(200, 50, 60, .25); } }
@media (prefers-reduced-motion: reduce) { .ticket.s-new { animation: none; } }
.ticket h3 { margin: 0; font-size: 1.15rem; }
.ticket .items { margin: 10px 0; padding: 10px 0; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); }
.ticket .items div { display: flex; justify-content: space-between; gap: 10px; padding: 2px 0; }
.ticket .note { background: var(--lemon); color: #1B1E3C; border-radius: 8px; padding: 6px 10px; font-size: .9rem; margin-top: 8px; }
.ticket .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.eta-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.eta-pick button { border: 0; background: var(--surface); border-radius: 10px; padding: 10px 12px; font-weight: 800; cursor: pointer; }
.eta-pick button:hover { background: var(--lemon); color: #1B1E3C; }

table.tbl { width: 100%; border-collapse: collapse; background: var(--paper); border-radius: var(--radius); overflow: hidden; font-size: .92rem; }
.tbl th, .tbl td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .8rem; color: var(--ink-2); font-weight: 700; background: var(--surface); }
.tbl-wrap { overflow-x: auto; border-radius: var(--radius); }

.menu-admin .prod { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.menu-admin .prod:last-child { border-bottom: 0; }
.menu-admin .thumb { width: 54px; height: 54px; border-radius: 10px; background: var(--surface) center/cover; flex: none; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--open); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 3px solid var(--info); outline-offset: 2px; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.auth-card { background: var(--paper); border-radius: 22px; padding: 28px 24px; width: 100%; max-width: 440px; }
.auth-card .logo { margin-bottom: 18px; }
.auth-card h1 { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -.03em; }

.hours-row { display: grid; grid-template-columns: 90px 1fr 1fr auto; gap: 8px; align-items: center; padding: 4px 0; }
.photo-pick { display: flex; gap: 12px; align-items: center; }
.photo-pick .preview { width: 72px; height: 72px; border-radius: 12px; background: var(--surface) center/cover; flex: none; box-shadow: inset 0 0 0 1.5px var(--line); }
.banner { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-weight: 600; }
.banner.warn { background: var(--lemon); color: #1B1E3C; }
.banner.err { background: rgba(200, 50, 60, .12); color: var(--danger); }

.partner-cta { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  background: var(--paper); border-radius: var(--radius); padding: 16px 18px; margin: 8px 0 120px; text-decoration: none;
  box-shadow: inset 0 0 0 2px var(--lemon); }
.partner-cta:hover { box-shadow: inset 0 0 0 2px var(--lemon-deep); }
