/* Shared tokens and components. Palette taken from the centre's flyers: coffee brown, caramel, sand. */
:root {
  --brown-900: #2b1a10;
  --brown-800: #3b2518;
  --brown-700: #523423;
  --brown-600: #6b4430;
  --caramel: #b9874b;
  --caramel-600: #9c6e36;
  --gold-100: #f4e6cf;
  --sand-50: #fbf8f3;
  --sand-100: #f5efe6;
  --sand-200: #ebe1d3;
  --sand-300: #dccdb9;
  --ink: #2a211b;
  --ink-2: #5d5148;
  --ink-3: #8a7d72;
  --white: #fff;
  --ok: #2f7d4f;    --ok-bg: #e3f3e8;
  --info: #2c6a8f;  --info-bg: #e2eff7;
  --warn: #a8640f;  --warn-bg: #fcefd9;
  --bad: #b03a2e;   --bad-bg: #fbe5e2;
  --violet: #6a4bb0; --violet-bg: #ece6f8;
  --grey: #6e6a66;  --grey-bg: #eeebe8;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(43, 26, 16, .06), 0 4px 16px rgba(43, 26, 16, .07);
  --shadow-lg: 0 10px 40px rgba(43, 26, 16, .22);
  --font: "Segoe UI", Tahoma, "Geeza Pro", "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--sand-50); font-size: 15px; line-height: 1.55; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0; }
a { color: var(--caramel-600); }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.nowrap { white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.sep { height: 1px; background: var(--sand-200); border: 0; margin: 4px 0; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--sand-300); background: var(--white); color: var(--ink);
  padding: 9px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px;
  text-decoration: none; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--caramel); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus-visible, .card-pick:focus-visible, .slot:focus-visible, .day:focus-visible { outline: 3px solid rgba(185, 135, 75, .45); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brown-800); border-color: var(--brown-800); color: var(--gold-100); }
.btn.primary:hover { background: var(--brown-700); }
.btn.gold { background: var(--caramel); border-color: var(--caramel); color: var(--white); }
.btn.gold:hover { background: var(--caramel-600); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--white); border-color: #e3b7b1; color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sand-100); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.wa { background: #1fa855; border-color: #1fa855; color: #fff; }
.icon-btn { border: 0; background: transparent; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; font-size: 16px; color: var(--ink-2); }
.icon-btn:hover { background: var(--sand-100); }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.field > span { color: var(--ink-2); }
.field .hint { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.input {
  width: 100%; border: 1px solid var(--sand-300); background: var(--white); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 15px; font-weight: 400; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(185, 135, 75, .18); outline: none; }
.input.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(176, 58, 46, .12); }
textarea.input { resize: vertical; min-height: 64px; }
select.input { appearance: auto; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brown-800); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.error-box { background: var(--bad-bg); color: var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; font-weight: 600; font-size: 14px; }
.note-box { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13px; }

/* cards & chips */
.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; background: var(--grey-bg); color: var(--grey); }
.st-pending { background: var(--warn-bg); color: var(--warn); }
.st-confirmed { background: var(--info-bg); color: var(--info); }
.st-arrived { background: var(--violet-bg); color: var(--violet); }
.st-paid { background: var(--ok-bg); color: var(--ok); }
.st-no_show { background: var(--bad-bg); color: var(--bad); }
.st-rejected, .st-cancelled { background: var(--grey-bg); color: var(--grey); }
.chip.soft { background: var(--sand-100); color: var(--ink-2); font-weight: 600; }
.chip.gold { background: var(--gold-100); color: var(--caramel-600); }
.chip.bad { background: var(--bad-bg); color: var(--bad); }

/* modal */
.modal-back { position: fixed; inset: 0; background: rgba(43, 26, 16, .45); display: flex; align-items: flex-start; justify-content: center; padding: 5vh 14px; z-index: 50; overflow-y: auto; animation: fade .15s; }
.modal { background: var(--white); border-radius: 18px; width: min(560px, 100%); box-shadow: var(--shadow-lg); animation: rise .18s ease-out; }
.modal-wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--sand-200); }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 18px 20px 20px; }
/* Keeps the main action of a long dialog visible while its content scrolls. */
.sticky-foot { position: sticky; bottom: 0; background: var(--white); padding: 10px 0 2px; z-index: 3; box-shadow: 0 -10px 12px -12px rgba(43, 26, 16, .35); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }

/* toasts */
.toasts { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 80; align-items: center; pointer-events: none; }
[dir="rtl"] .toasts { transform: translateX(50%); }
.toast { background: var(--brown-900); color: var(--gold-100); padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: 14px; transition: opacity .3s, transform .3s; animation: rise .2s; max-width: 90vw; }
.toast.clickable { pointer-events: auto; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.toast-error { background: var(--bad); color: #fff; }
.toast-ok { background: var(--ok); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* key/value list */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; }

.spinner { width: 22px; height: 22px; border: 3px solid var(--sand-200); border-top-color: var(--caramel); border-radius: 50%; animation: spin .8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
