* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --accent: #B8562F;
  --accent-soft: #F7E8E1;
  --bg: #FAF7F2;
  --card: #FFFFFF;
  --text: #2B2825;
  --text2: #6E675F;
  --text3: #9A938A;
  --border: #E8E2DA;
  --green: #1D7A4F;
  --green-soft: #E4F2EA;
  --warn: #A3610B;
  --warn-soft: #FBEEDB;
  --danger: #B23434;
  --radius: 12px;
}
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, "Heebo", Arial, sans-serif;
  background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5;
}
#app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font: inherit; }
.hidden { display: none !important; }

/* ---- login ---- */
.login-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 28px 80px; }
.logo { width: 72px; height: 72px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 600; margin: 0 auto 14px; }
.login-title { text-align: center; font-size: 22px; font-weight: 600; }
.login-sub { text-align: center; color: var(--text2); font-size: 14px; margin-bottom: 28px; }
.field { width: 100%; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin-bottom: 10px; font-size: 16px; }
.field:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.btn { display: block; width: 100%; padding: 13px; border-radius: var(--radius); font-size: 16px; font-weight: 600; text-align: center; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { opacity: .85; }
.btn-outline { border: 1px solid var(--border); background: var(--card); }
.btn-outline:active { background: var(--bg); }
.login-err { color: var(--danger); text-align: center; font-size: 14px; min-height: 22px; margin-top: 10px; }

/* ---- header / nav ---- */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 10px; }
.topbar h1 { font-size: 19px; font-weight: 700; }
.topbar .sub { font-size: 12.5px; color: var(--text3); }
.pill { font-size: 13px; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--card); color: var(--text2); font-weight: 600; }
.main { flex: 1; padding: 4px 16px 90px; }
.nav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--border); display: flex; justify-content: space-around; padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; }
.nav button { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; color: var(--text3); padding: 4px 10px; border-radius: 10px; min-width: 62px; }
.nav button.on { color: var(--accent); font-weight: 700; }
.nav svg { width: 23px; height: 23px; }
.nav .badge { position: absolute; transform: translate(12px, -2px); background: var(--accent); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; }

/* ---- cards & lists ---- */
.section-title { font-size: 15px; font-weight: 700; margin: 16px 2px 8px; }
.section-note { font-size: 12.5px; color: var(--text3); margin: -6px 2px 8px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.t-main { font-size: 15px; font-weight: 600; }
.t-sub { font-size: 12.5px; color: var(--text3); }
.chev { color: var(--text3); font-size: 18px; flex-shrink: 0; }
.tap { cursor: pointer; }
.tap:active { background: var(--bg); }

/* ---- tasks ---- */
.task { display: flex; align-items: center; gap: 12px; }
.task .box { width: 26px; height: 26px; border: 2px solid var(--border); border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; }
.task.done { background: var(--green-soft); border-color: transparent; }
.task.done .box { background: var(--green); border-color: var(--green); }
.task.done .t-main { color: var(--green); }
.task.done .t-sub { color: var(--green); opacity: .75; }

/* ---- count ---- */
.seg { display: flex; background: #EFEAE3; border-radius: 10px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 8px 0; border-radius: 8px; font-size: 14px; color: var(--text2); font-weight: 600; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.progress { height: 6px; background: #EFEAE3; border-radius: 3px; overflow: hidden; margin: 6px 0 4px; }
.progress > div { height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }
.item-row { display: flex; align-items: center; gap: 8px; padding: 9px 12px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper button { width: 38px; height: 38px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); font-size: 20px; font-weight: 600; color: var(--text2); flex-shrink: 0; }
.stepper button:active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.stepper .qty { min-width: 34px; text-align: center; font-size: 17px; font-weight: 700; }
.stepper .qty.empty { color: var(--text3); font-weight: 400; }
.status-ico { width: 20px; text-align: center; flex-shrink: 0; font-size: 15px; }
.below { color: var(--warn); }
.ok { color: var(--green); }
.sticky-bottom { position: fixed; bottom: 74px; left: 0; right: 0; max-width: 560px; margin: 0 auto; padding: 10px 16px; }
.sticky-bottom .btn { box-shadow: 0 4px 14px rgba(0,0,0,.12); }

/* ---- orders ---- */
.orderline { display: flex; align-items: center; gap: 8px; padding: 9px 12px; }
.orderline input { width: 64px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; text-align: center; font-size: 16px; }
.badge-soft { font-size: 12px; padding: 2px 10px; border-radius: 12px; font-weight: 600; }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-gray { background: #EFEAE3; color: var(--text2); }
.wa-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }

/* ---- admin ---- */
.form-grid { display: grid; gap: 8px; }
.inline-btns { display: flex; gap: 8px; }
.inline-btns .btn { flex: 1; }
.link-btn { color: var(--accent); font-size: 13.5px; font-weight: 600; padding: 6px; }
.danger { color: var(--danger); }

.toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 20px; border-radius: 22px; font-size: 14px; opacity: 0; transition: opacity .25s; pointer-events: none; z-index: 50; white-space: nowrap; }
.toast.show { opacity: .95; }
.back-btn { color: var(--accent); font-weight: 700; font-size: 14.5px; padding: 6px 2px; }
.center-muted { text-align: center; color: var(--text3); font-size: 14px; padding: 30px 10px; }
