/* Hadwa — brand stylesheet
   Burnt Sienna #964222 · Deep Brown #65311F · Dune Sand #EEE7D5
   Sand #DBCFAF · Gold #B59858 · Saffron #E8B747 · Twilight #A18280 */

:root {
  --cream: #EEE7D5;
  --card: #F7F2E6;
  --sand: #DBCFAF;
  --sienna: #964222;
  --brown: #65311F;
  --gold: #B59858;
  --saffron: #E8B747;
  --twilight: #A18280;
  --ok: #5C7A4E;
  --admin-bg: #4A2317;
  --admin-card: #5A2C1C;
  --admin-line: #6b3a28;
}

* { box-sizing: border-box; margin: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--cream); color: var(--brown);
  font-family: 'Inter', system-ui, sans-serif; font-size: 15px;
  display: flex; justify-content: center;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
input, select, textarea { font-family: inherit; }
[hidden] { display: none !important; }

.shell { width: 100%; max-width: 480px; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; position: relative; background: var(--cream); }
.wordmark { font-family: 'Aref Ruqaa', serif; color: var(--sienna); line-height: 1; display: inline-block; }
.boot-splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }

.scroll { flex: 1; overflow-y: auto; padding: 18px 18px 0; -webkit-overflow-scrolling: touch; }

.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px; background: var(--cream); border-bottom: 1px solid var(--sand); }

.section-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--sienna); margin: 6px 2px 14px; }

/* ---------- auth ---------- */
.authwrap { width: 100%; max-width: 440px; margin: 0 auto; padding: 0 20px 40px; display: flex; flex-direction: column; }
.auth-hero { text-align: center; padding: 60px 0 26px; }
.auth-tag { font-family: 'Aref Ruqaa', serif; color: var(--gold); font-size: 18px; margin-top: 10px; }
.auth-sub { opacity: .75; margin-top: 8px; font-size: 14px; }
.auth-card { background: var(--card); border: 1px solid var(--sand); border-radius: 20px; padding: 22px; }
.lbl { display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sienna); margin: 12px 0 6px; }
.inp { width: 100%; padding: 13px 14px; border: 1.5px solid var(--sand); border-radius: 12px; background: var(--cream);
  font-size: 16px; color: var(--brown); outline: none; }
.inp:focus { border-color: var(--sienna); }
.phone-row { display: flex; gap: 8px; }
.cc { display: flex; align-items: center; padding: 0 12px; background: var(--sand); border-radius: 12px; font-weight: 700; }
.otp-inp { text-align: center; letter-spacing: .4em; font-size: 24px; font-weight: 700; margin-top: 14px; }
.err { color: var(--sienna); font-size: 13px; margin-top: 10px; font-weight: 600; }
.fine { font-size: 12.5px; opacity: .72; line-height: 1.45; margin-top: 10px; }
.demo-sms { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--sand); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.demo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.linkbtn { display: block; margin: 14px auto 0; color: var(--sienna); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.h2 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.h3 { font-size: 16px; font-weight: 700; }

/* ---------- buttons ---------- */
.btn { border-radius: 14px; padding: 15px 20px; font-weight: 700; font-size: 15.5px; transition: transform .06s, opacity .15s; text-align: center; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--brown); color: var(--cream); }
.btn-light { background: var(--cream); color: var(--brown); }
.btn-ghost { background: transparent; color: var(--sienna); border: 1.5px solid var(--sienna); }
.btn-ghost-dark { background: transparent; color: var(--sand); border: 1.5px solid var(--sand); }
.btn-sm { padding: 9px 14px; font-size: 13.5px; border-radius: 11px; }
.w100 { width: 100%; }

/* ---------- plate chip ---------- */
.plate { display: inline-flex; align-items: center; background: #fff; color: #1f1610; border: 2px solid var(--brown);
  border-radius: 8px; padding: 3px 10px; font-weight: 800; letter-spacing: .08em; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.plate-big { font-size: 26px; padding: 8px 18px; border-width: 3px; border-radius: 12px; }
.plate-em { font-size: .58em; font-weight: 800; letter-spacing: .1em; opacity: .55; margin-right: 7px; align-self: center; }

/* ---------- plate picker / horizontal chip rows ---------- */
.codes-row { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: thin; }
.codes-row .opt { flex: none; }

/* ---------- options editor (dashboard) ---------- */
.og { border: 1px solid var(--admin-line); border-radius: 14px; padding: 12px; margin-top: 10px; }
.og-opt { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.og-opt .inp { padding: 9px 10px; }
.og-opt input[type="radio"] { width: 18px; height: 18px; flex: none; accent-color: #E8B747; }

/* ---------- menu ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { position: relative; text-align: left; background: var(--card); border: 1px solid var(--sand); border-radius: 18px;
  padding: 14px; display: flex; flex-direction: column; gap: 4px; transition: transform .08s; }
.card:active { transform: scale(.98); }
.card.sold { opacity: .55; }
.card-art { align-self: center; padding: 4px 0 2px; }
.card-img { width: 100%; height: 155px; object-fit: contain; background: #fff; border-radius: 12px; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--saffron); color: var(--brown); font-size: 10px;
  font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; z-index: 2; }
.tag-sold { background: var(--twilight); color: var(--cream); }
.card-ar { font-family: 'Aref Ruqaa', serif; color: var(--sienna); font-size: 20px; line-height: 1.15; }
.card-en { font-weight: 700; font-size: 15px; }
.card-desc { font-size: 12px; opacity: .7; line-height: 1.4; flex: 1; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.price { font-weight: 800; }
.add { color: var(--sienna); font-weight: 800; font-size: 13px; }

/* ---------- cart bar ---------- */
.cartbar { position: fixed; bottom: calc(78px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%);
  width: min(92%, 440px); display: flex; align-items: center; gap: 12px; background: var(--sienna); color: var(--cream);
  padding: 15px 18px; border-radius: 16px; font-weight: 700; font-size: 15.5px;
  box-shadow: 0 10px 26px rgba(101,49,31,.35); z-index: 30; }
.cart-count { background: var(--cream); color: var(--sienna); width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 800; }
.cart-total { margin-left: auto; font-weight: 700; }

/* ---------- bottom nav ---------- */
.nav { position: sticky; bottom: 0; z-index: 25; display: flex; background: var(--card); border-top: 1px solid var(--sand);
  padding: 6px 8px calc(10px + env(safe-area-inset-bottom)); }
.nav-btn { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 4px;
  color: var(--twilight); font-size: 11px; font-weight: 600; }
.nav-btn.on { color: var(--sienna); }
.nav-btn.on span { font-weight: 800; }
.nav-btn.on::after { content: ""; width: 18px; height: 3px; border-radius: 99px; background: var(--sienna); margin-top: 2px; }

/* ---------- sheets ---------- */
.sheet-wrap { position: fixed; inset: 0; background: rgba(50,24,14,.45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; background: var(--cream);
  border-radius: 24px 24px 0 0; padding: 10px 20px calc(26px + env(safe-area-inset-bottom)); animation: up .22s ease; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-grip { width: 44px; height: 4px; border-radius: 99px; background: var(--sand); margin: 4px auto 14px; }
.ps-head { display: flex; gap: 14px; align-items: flex-start; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { border: 1.5px solid var(--sand); background: var(--card); border-radius: 99px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; }
.opt.on { background: var(--brown); border-color: var(--brown); color: var(--cream); }
.opt-p { opacity: .75; font-weight: 500; }
.ps-foot { display: flex; gap: 12px; align-items: center; margin-top: 20px; }
.qty { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1.5px solid var(--sand); border-radius: 14px; padding: 4px; }
.qty button { width: 40px; height: 40px; font-size: 20px; font-weight: 800; color: var(--sienna); }
.qty span { min-width: 26px; text-align: center; font-weight: 800; font-size: 16px; }

/* ---------- checkout ---------- */
.co-line { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--sand); }
.co-line.total { border: none; font-weight: 800; font-size: 17px; padding-top: 14px; }
.x { width: 26px; height: 26px; border-radius: 50%; background: var(--sand); color: var(--brown); font-weight: 800; flex: none; }
.co-meta { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 6px; }
.co-meta > div { display: flex; flex-direction: column; gap: 4px; }
.pay-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay { text-align: left; border: 1.5px solid var(--sand); background: var(--card); border-radius: 14px; padding: 12px; }
.pay.on { border-color: var(--sienna); outline: 2px solid var(--sienna); outline-offset: -2px; }
.pay.dis { opacity: .6; }

/* ---------- confirmation ---------- */
.confirm { position: fixed; inset: 0; z-index: 60; background: var(--brown); display: flex; align-items: center; justify-content: center; }
.confirm-inner { text-align: center; color: var(--cream); display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px; }
.confirm-no { font-size: 26px; font-weight: 800; margin-top: 6px; }
.confirm-eta { margin: 10px 0 16px; font-size: 15px; color: var(--sand); }
.status { color: #fff; font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 99px; white-space: nowrap; }

/* ---------- orders / panels ---------- */
.order-card, .panel { background: var(--card); border: 1px solid var(--sand); border-radius: 18px; padding: 16px; margin-bottom: 12px; }
.order-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; gap: 10px; }
.order-no { font-weight: 800; font-size: 16px; }
.order-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; gap: 10px; }
.order-line.total { font-weight: 800; border-top: 1px dashed var(--sand); margin-top: 6px; padding-top: 10px; }
.order-meta { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.empty { text-align: center; padding: 48px 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; opacity: .85; }

/* ---------- wallet ---------- */
.wallet-hero { background: var(--brown); color: var(--cream); border-radius: 20px; padding: 22px; margin-bottom: 18px; }
.balance { font-size: 38px; font-weight: 800; letter-spacing: -.02em; margin: 6px 0 2px; }
.topup-row { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--sand); color: var(--cream); border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; }
.wallet-hero .chip { background: rgba(238,231,213,.08); }
.txn { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--sand); }
.txn-type { font-weight: 700; font-size: 14px; }
.txn-amt { font-weight: 800; white-space: nowrap; }
.txn-amt.pos { color: var(--ok); }
.txn.pending { opacity: .55; }
.pending-row { display: flex; align-items: center; gap: 10px; padding: 18px 0; font-weight: 600; }
.spinner { width: 18px; height: 18px; border: 3px solid var(--sand); border-top-color: var(--sienna); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.done-msg { padding: 14px 0 2px; font-weight: 700; color: var(--ok); font-size: 16px; }

/* ---------- profile ---------- */
.plate-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; gap: 10px; flex-wrap: wrap; }
.addplate { display: flex; gap: 8px; margin-top: 10px; }
.addplate .inp { flex: 1; }

/* ---------- toast ---------- */
.toast { position: fixed; top: calc(16px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--brown); color: var(--cream); padding: 10px 18px; border-radius: 99px; font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.25); max-width: 90%; text-align: center; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-shell { max-width: 1000px; background: var(--admin-bg); color: var(--cream); }
.admin-bar { background: var(--admin-bg); border-color: var(--admin-line); }
.admin-title { font-weight: 800; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; color: var(--sand); }
.admin-tabs { display: flex; gap: 8px; padding: 12px 18px 0; flex-wrap: wrap; }
.atab { padding: 9px 16px; border-radius: 99px; font-weight: 700; font-size: 13.5px; color: var(--sand); border: 1.5px solid var(--admin-line); }
.atab.on { background: var(--cream); color: var(--brown); border-color: var(--cream); }
.admin-scroll { padding: 16px 18px 40px; }
.a-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; align-items: center; }
.a-filters .inp { width: auto; flex: 1; min-width: 150px; background: var(--admin-card); border-color: var(--admin-line); color: var(--cream); font-size: 14px; padding: 10px 12px; }
.a-order { background: var(--admin-card); border: 1px solid var(--admin-line); border-radius: 18px; padding: 16px; margin-bottom: 14px; }
.a-order.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { outline: 3px solid var(--saffron); } 100% { outline: 3px solid transparent; } }
.a-plate-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.a-meta { font-size: 12.5px; color: var(--sand); margin: 10px 0 8px; line-height: 1.5; }
.a-item { padding: 4px 0; font-size: 14.5px; }
.a-item .fine { color: var(--sand); display: inline; margin: 0; }
.a-note { margin-top: 6px; padding: 8px 10px; background: rgba(232,183,71,.12); border-radius: 10px; color: var(--saffron); font-size: 13.5px; }
.a-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.a-total { margin-left: auto; font-weight: 800; font-size: 16px; }
.a-row { display: flex; align-items: center; gap: 14px; background: var(--admin-card); border: 1px solid var(--admin-line);
  border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; flex-wrap: wrap; }
.chip-dark { border: 1.5px solid var(--admin-line); color: var(--sand); border-radius: 99px; padding: 8px 14px; font-weight: 700; font-size: 13.5px; }
.chip-dark.on { background: var(--cream); color: var(--brown); border-color: var(--cream); }
.chip-dark.alarm-on { background: var(--saffron); color: var(--brown); border-color: var(--saffron);
  animation: alarmpulse .9s ease-in-out infinite; }
@keyframes alarmpulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(232,183,71,.55); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 9px rgba(232,183,71,0); }
}
@media (prefers-reduced-motion: reduce) { .chip-dark.alarm-on { animation: none; } }
.a-form { background: var(--admin-card); border: 1px solid var(--admin-line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.a-form .inp, .a-form textarea, .a-form select { background: var(--admin-bg); border: 1.5px solid var(--admin-line); color: var(--cream); border-radius: 10px; padding: 10px 12px; width: 100%; font-size: 14px; }
.a-form textarea { min-height: 70px; resize: vertical; }
.a-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.a-lbl { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); margin: 10px 0 5px; }
.a-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.a-table th, .a-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--admin-line); vertical-align: top; }
.a-table th { color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.login-card { background: var(--admin-card); border: 1px solid var(--admin-line); border-radius: 20px; padding: 24px; max-width: 380px; margin: 10vh auto 0; width: 100%; }
.login-card .inp { background: var(--admin-bg); border-color: var(--admin-line); color: var(--cream); }

@media (min-width: 600px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .a-grid2 { grid-template-columns: 1fr; } }
