:root {
  --brand: #e4572e;       /* סלסה */
  --brand-dark: #b23a16;  /* צ'יפוטלה */
  --brand-soft: #ffe9dc;
  --mustard: #ffc93c;
  --mustard-soft: #fff3cf;
  --ink: #2b1a12;
  --bg: #fff7ec;
  --surface: #ffffff;
  --text: #2b1a12;
  --muted: #74615a;
  --line: #f1dccb;
  --font-body: 'Rubik', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  --font-display: 'Fredoka', 'Rubik', system-ui, sans-serif;
  --ok: #15803d;
  --ok-soft: #e8f6ed;
  --warn: #b45309;
  --warn-soft: #fff4dc;
  --danger: #b91c1c;
  --danger-soft: #fdecec;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(60 30 10 / 6%), 0 6px 20px rgb(60 30 10 / 7%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--brand-dark); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.nowrap { white-space: nowrap; }
.ltr { direction: ltr; unicode-bidi: isolate; }

/* ---------- כפתורים ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 20px;
  border: 0; border-radius: 12px;
  background: var(--brand); color: #fff;
  font-weight: 700; font-size: 17px;
  cursor: pointer; text-decoration: none;
  transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(.98); }
.btn:disabled { background: #d8c9bf; cursor: not-allowed; transform: none; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--brand-dark); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.ok { background: var(--ok); }
.btn.ok:hover { background: #116632; }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid #f3c9c9; }
.btn.danger:hover { background: var(--danger-soft); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: 15px; }
.linkbtn { background: none; border: 0; color: var(--brand-dark); font-weight: 600; cursor: pointer; padding: 6px 0; text-decoration: underline; }

/* ---------- טפסים ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 15px; }
.field small { display: block; margin-top: 4px; font-size: 13px; }
.field select {
  width: 100%; min-height: 48px; padding: 10px 14px; font-size: 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
}
.field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(194 65 12 / 15%); }
.field input, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: #fff;
  font-size: 16px;
}
.field textarea { min-height: 72px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgb(194 65 12 / 15%); }
.row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-weight: 500; }

/* ---------- כרטיסים ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.chip.open { background: var(--ok-soft); color: var(--ok); }
.chip.closed { background: #eee8e4; color: #5d524b; }
.chip.busy { background: var(--warn-soft); color: var(--warn); }
.badge { display: inline-block; padding: 2px 10px; border-radius: 8px; font-size: 14px; font-weight: 700; }
.badge.paid { background: var(--ok-soft); color: var(--ok); }
.badge.cash { background: var(--warn-soft); color: var(--warn); }
.badge.test { background: #eef1ff; color: #3b4cc0; }
.order-coupon { margin: -2px 0 10px; padding: 6px 12px; border-radius: 10px; background: var(--mustard-soft); color: #7a5300; font-size: 14px; font-weight: 500; }

/* ---------- סרגל עליון ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: rgb(255 250 246 / 92%);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 25px; font-weight: 700; color: var(--brand); line-height: 1.1; }
.brand small { display: block; font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--muted); }
.logo-mark {
  display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px;
  background: var(--mustard); font-size: 23px; transform: rotate(-8deg); box-shadow: inset 0 -3px 0 rgb(0 0 0 / 10%);
}
h1, h2, h3, .order-num, .order-total, .pay-total, .order-big { font-family: var(--font-display); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; inset-inline: 16px; top: max(14px, env(safe-area-inset-top)); z-index: 100; margin: 0 auto; max-width: 420px;
  background: #2a211c; color: #fff; padding: 12px 16px; border-radius: 12px; text-align: center;
  font-weight: 500; opacity: 0; transform: translateY(-10px); pointer-events: none; transition: .2s;
  box-shadow: 0 8px 24px rgb(0 0 0 / 20%);
}
#toast.show { opacity: 1; transform: none; }

/* ---------- מסך התחברות (בעל עסק / שליח) ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 380px; padding: 28px 24px; }
.login .brand { justify-content: center; font-size: 34px; margin-bottom: 4px; }
.login h1 { text-align: center; font-size: 18px; font-weight: 600; color: var(--muted); margin: 0 0 22px; }

/* ---------- כרטיס הזמנה (בעל עסק + שליח) ---------- */
.orders { display: grid; gap: 14px; }
.order { padding: 16px 18px; }
.order.fresh { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(194 65 12 / 18%), var(--shadow); animation: pulse 1.2s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgb(194 65 12 / 10%), var(--shadow); } }
.order-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.order-num { font-size: 22px; font-weight: 900; }
.order-time { color: var(--muted); font-size: 14px; }
.order-info { display: grid; gap: 4px; margin-bottom: 10px; }
.order-info .who { font-weight: 700; font-size: 17px; }
.order-items { list-style: none; margin: 0 0 10px; padding: 10px 12px; background: #fdf7f2; border-radius: 12px; }
.order-items li { padding: 4px 0; }
.order-items li + li { border-top: 1px dashed var(--line); }
.order-items .opt { color: var(--muted); font-size: 14px; }
.order-items .note { color: var(--brand-dark); font-size: 14px; }
.order-notes { background: var(--warn-soft); color: #7a3e06; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px; font-size: 15px; }
.order-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.order-total { font-weight: 800; font-size: 18px; }
.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .big { font-size: 40px; display: block; margin-bottom: 6px; }

/* ---------- לשוניות ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px; background: #f6ebe3; border-radius: 14px; }
.tabs button {
  flex: 1 0 auto; min-height: 44px; padding: 8px 16px; border: 0; border-radius: 10px; background: transparent;
  font-weight: 700; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.tabs button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.count { display: inline-block; min-width: 24px; padding: 0 7px; margin-inline-start: 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 13px; line-height: 22px; }
.chip.unavailable { background: var(--danger-soft); color: var(--danger); }
