/*
  Restaurant Digital Platform — design system
  RTL-native, Persian-first. Brand colors are CSS custom properties so every
  installation can be re-skinned from Settings without touching this file.
*/

:root {
  --brand: #d64545;
  --brand-dark: #b93636;
  --brand-light: #fbe9e7;
  --brand-2: #2f3b52;

  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-alt: #f2f3f5;
  --border: #e6e6ea;
  --text: #1c1d21;
  --text-muted: #6b6f7b;
  --text-faint: #9a9da6;

  --success: #1c8a5b;
  --success-bg: #e7f6ef;
  --warning: #b8790a;
  --warning-bg: #fdf1dc;
  --danger: #c53030;
  --danger-bg: #fbe8e8;
  --info: #2563a8;
  --info-bg: #e8f1fb;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(20, 20, 30, .06);
  --shadow: 0 6px 20px rgba(20, 20, 30, .08);
  --shadow-lg: 0 16px 40px rgba(20, 20, 30, .14);

  --header-h: 60px;
  --bottom-nav-h: 62px;
  --sidebar-w: 264px;

  --font: 'IRANYekanX', 'Vazirmatn', 'IRANSans', Tahoma, 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171b;
    --surface: #1e1f24;
    --surface-alt: #24252b;
    --border: #313239;
    --text: #f1f1f3;
    --text-muted: #a4a7b1;
    --text-faint: #71747d;
    --brand-light: #3a2323;
  }
}

* { box-sizing: border-box; }
/* Several components below (.alert, .overlay, etc.) set an unconditional `display`,
   which — per normal CSS specificity — outranks the UA stylesheet's [hidden]{display:none}.
   This keeps the native hidden attribute authoritative everywhere it's used with JS/PHP. */
[hidden] { display: none !important; }
html, body { padding: 0; margin: 0; }
html { direction: rtl; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p { margin: 0; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--text); }
::selection { background: var(--brand); color: #fff; }

/* ---------- layout helpers ---------- */
.container { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 16px; }
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.gap-1 { gap: 6px; } .gap-2 { gap: 10px; } .gap-3 { gap: 16px; } .gap-4 { gap: 24px; }
.grow { flex: 1; }
.text-muted { color: var(--text-muted); }
.text-faint { color: var(--text-faint); }
.text-sm { font-size: 13px; }
.text-lg { font-size: 18px; }
.font-bold { font-weight: 700; }
.hidden { display: none !important; }

/* ---------- icons ---------- */
.icon { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon--sm { width: 16px; height: 16px; }
.icon--lg { width: 32px; height: 32px; }
.icon--fill { fill: currentColor; stroke: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 10px 18px; font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: transform .08s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  background: var(--surface-alt); color: var(--text);
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); }
.btn--secondary { background: var(--brand-2); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-alt); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--outline-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn--sm { padding: 6px 12px; font-size: 13px; }
.btn--lg { padding: 13px 26px; font-size: 16px; border-radius: var(--radius); }
.btn--block { width: 100%; }
.btn--icon { padding: 9px; }
.btn-group { display: inline-flex; gap: 8px; flex-wrap: wrap; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
.field input[type=text], .field input[type=tel], .field input[type=number],
.field input[type=password], .field input[type=email], .field input[type=date],
.field select, .field textarea {
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; background: var(--surface); color: var(--text);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light);
}
.field textarea { resize: vertical; min-height: 90px; }
.field small.hint { color: var(--text-faint); font-size: 12.5px; }
.field-error { color: var(--danger); font-size: 12.5px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field--2col { grid-column: span 2; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: background .15s ease; cursor: pointer; }
.switch__track::before { content: ''; position: absolute; width: 18px; height: 18px; right: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .15s ease; box-shadow: var(--shadow-sm); }
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::before { transform: translateX(-18px); }

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .field--2col { grid-column: span 1; }
}

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card--flat { box-shadow: none; }
.card-title { font-size: 16px; font-weight: 700; margin-bottom: 4px; }

/* ---------- badges / status ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }
.badge--success { background: var(--success-bg); color: var(--success); }
.badge--warning { background: var(--warning-bg); color: var(--warning); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--muted { background: var(--surface-alt); color: var(--text-muted); }
.badge--brand { background: var(--brand-light); color: var(--brand-dark); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot--success { background: var(--success); }
.status-dot--warning { background: var(--warning); }
.status-dot--danger { background: var(--danger); }
.status-dot--muted { background: var(--text-faint); }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-block: 12px; }
.alert--error { background: var(--danger-bg); color: var(--danger); }
.alert--success { background: var(--success-bg); color: var(--success); }
.alert--info { background: var(--info-bg); color: var(--info); }
.alert--warning { background: var(--warning-bg); color: var(--warning); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
table.data-table th { text-align: right; padding: 12px 16px; background: var(--surface-alt); color: var(--text-muted); font-weight: 600; font-size: 13px; white-space: nowrap; }
table.data-table td { padding: 12px 16px; border-top: 1px solid var(--border); vertical-align: middle; }
table.data-table tbody tr:hover { background: var(--surface-alt); }

/* ---------- empty states ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 20px; color: var(--text-muted); gap: 10px; }
.empty-state .icon { width: 56px; height: 56px; color: var(--text-faint); stroke-width: 1.2; }
.empty-state__title { font-weight: 700; color: var(--text); font-size: 16px; }

/* ---------- modals & bottom sheets ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 16, 20, .5); display: flex; align-items: center; justify-content: center; z-index: 80; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.overlay.is-open { opacity: 1; pointer-events: auto; }
.modal { background: var(--surface); border-radius: var(--radius-lg); max-width: 480px; width: calc(100% - 32px); max-height: 85vh; overflow-y: auto; box-shadow: var(--shadow-lg); transform: translateY(10px) scale(.98); transition: transform .18s ease; }
.overlay.is-open .modal { transform: translateY(0) scale(1); }
.modal__header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal__title { font-weight: 700; font-size: 16px; }
.modal__body { padding: 20px; }
.modal__footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: var(--surface); }
.modal__close { background: var(--surface-alt); border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; border: none; }

@media (max-width: 720px) {
  .overlay { align-items: flex-end; }
  .modal { max-width: 100%; width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; max-height: 92vh; transform: translateY(100%); }
  .overlay.is-open .modal { transform: translateY(0); }
  .modal--sheet::before { content: ''; display: block; width: 44px; height: 5px; background: var(--border); border-radius: 999px; margin: 10px auto 0; }
}

/* ---------- toasts ---------- */
.toast-stack { position: fixed; bottom: calc(var(--bottom-nav-h) + 16px); right: 16px; left: 16px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 720px) { .toast-stack { right: 24px; left: auto; align-items: flex-end; bottom: 24px; } }
.toast { pointer-events: auto; background: var(--text); color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px; animation: toast-in .2s ease; max-width: 92vw; }
.toast--success { background: var(--success); }
.toast--error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ---------- price / rating ---------- */
.price { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.price--old { color: var(--text-faint); text-decoration: line-through; font-weight: 500; font-size: 13px; }
.price--final { color: var(--brand); }
.rating { display: inline-flex; align-items: center; gap: 3px; color: var(--warning); font-weight: 700; font-size: 13.5px; }
.rating .icon { width: 15px; height: 15px; }

/* ---------- avatar ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--brand-light); color: var(--brand-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; overflow: hidden; flex-shrink: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--sm { width: 30px; height: 30px; font-size: 12px; }
.avatar--lg { width: 64px; height: 64px; font-size: 20px; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs__item { padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text-muted); border-bottom: 2px solid transparent; white-space: nowrap; cursor: pointer; }
.tabs__item.is-active { color: var(--brand); border-color: var(--brand); }
.chip-scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px; background: var(--surface-alt); font-size: 13.5px; font-weight: 600; white-space: nowrap; cursor: pointer; border: 1.5px solid transparent; }
.chip.is-active { background: var(--brand); color: #fff; }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 6px; align-items: center; justify-content: center; }
.pagination a, .pagination span { min-width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; }
.pagination a { background: var(--surface-alt); }
.pagination .is-active { background: var(--brand); color: #fff; }

/* =====================================================================
   Customer storefront
   ===================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 40; background: var(--surface);
  border-bottom: 1px solid var(--border); height: var(--header-h);
  display: flex; align-items: center;
}
.site-header__inner { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }
.brand-mark { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; }
.brand-mark__logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; background: var(--brand-light); }
.branch-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-alt); padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; }

.bottom-nav {
  position: fixed; bottom: 0; inset-inline: 0; height: var(--bottom-nav-h); background: var(--surface);
  border-top: 1px solid var(--border); display: flex; z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav__item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--text-muted); font-weight: 600; position: relative; }
.bottom-nav__item.is-active { color: var(--brand); }
.bottom-nav__badge { position: absolute; top: 2px; inset-inline-end: 22%; background: var(--danger); color: #fff; font-size: 9px; min-width: 15px; height: 15px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px; }

.page-with-bottom-nav { padding-bottom: calc(var(--bottom-nav-h) + 18px); }
@media (min-width: 900px) { .bottom-nav { display: none; } .page-with-bottom-nav { padding-bottom: 32px; } }

.hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: linear-gradient(135deg, var(--brand-2), #1a2131); color: #fff; padding: 28px 22px; margin-block: 16px; }
.hero__title { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.hero__subtitle { opacity: .85; font-size: 13.5px; }
.hero__art { position: absolute; inset-inline-end: -10px; bottom: -10px; width: 130px; opacity: .9; }

.category-scroller { display: flex; gap: 10px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.category-scroller::-webkit-scrollbar { display: none; }
.category-pill { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 68px; cursor: pointer; }
.category-pill__icon { width: 56px; height: 56px; border-radius: 18px; background: var(--surface-alt); display: flex; align-items: center; justify-content: center; transition: background .15s ease, color .15s ease; }
.category-pill.is-active .category-pill__icon { background: var(--brand); color: #fff; }
.category-pill__label { font-size: 12px; font-weight: 600; white-space: nowrap; }

.section-heading { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 0 12px; }
.section-heading h2 { font-size: 16.5px; font-weight: 800; }
.section-heading a { font-size: 13px; color: var(--brand); font-weight: 600; }

.menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 980px) { .menu-grid { grid-template-columns: repeat(4, 1fr); } }

.item-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; transition: box-shadow .15s ease, transform .1s ease; position: relative; }
.item-card:hover { box-shadow: var(--shadow); }
.item-card__image { aspect-ratio: 4/3; background: var(--surface-alt); position: relative; overflow: hidden; }
.item-card__image img { width: 100%; height: 100%; object-fit: cover; }
.item-card__discount { position: absolute; top: 8px; inset-inline-start: 8px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.item-card__unavailable { position: absolute; inset: 0; background: rgba(20,20,24,.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.item-card__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item-card__title { font-size: 13.5px; font-weight: 700; line-height: 1.5; }
.item-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.item-card__add { width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; flex-shrink: 0; }

.list-row { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.list-row__thumb { width: 60px; height: 60px; border-radius: var(--radius-sm); background: var(--surface-alt); overflow: hidden; flex-shrink: 0; }
.list-row__thumb img { width: 100%; height: 100%; object-fit: cover; }

.branch-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.branch-card__image { aspect-ratio: 16/9; background: var(--surface-alt); }
.branch-card__image img { width: 100%; height: 100%; object-fit: cover; }
.branch-card__body { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.branch-card__title { font-weight: 800; font-size: 15.5px; }

.sticky-cart-bar { position: fixed; bottom: calc(var(--bottom-nav-h) + 10px); inset-inline: 12px; z-index: 45; }
@media (min-width: 900px) { .sticky-cart-bar { bottom: 20px; } }
.sticky-cart-bar__inner { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); cursor: pointer; }

.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: 999px; }
.qty-stepper button { width: 30px; height: 30px; border: none; background: none; font-size: 16px; cursor: pointer; color: var(--text); }
.qty-stepper span { min-width: 24px; text-align: center; font-weight: 700; }

.stepper-list__row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); }
.stepper-list__row:last-child { border-bottom: none; }

/* prize wheel */
.prize-wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 0 20px; }
.prize-wheel { position: relative; width: 280px; height: 280px; }
.prize-wheel svg { width: 100%; height: 100%; transition: transform 4s cubic-bezier(.17,.67,.2,1); }
.prize-wheel__pointer { position: absolute; top: -6px; inset-inline-start: 50%; transform: translateX(50%); width: 0; height: 0; border-inline-start: 12px solid transparent; border-inline-end: 12px solid transparent; border-top: 20px solid var(--brand-2); z-index: 5; }

/* =====================================================================
   Admin panel
   ===================================================================== */
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface-2, #191a20); color: #e7e8ec;
  background: #191a20; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; font-weight: 800; color: #fff; }
.admin-nav-group { margin-bottom: 14px; }
.admin-nav-group__label { font-size: 11px; color: #82858f; font-weight: 700; padding: 0 12px 6px; text-transform: uppercase; letter-spacing: .04em; }
.admin-nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; color: #c6c8d0; }
.admin-nav-link:hover { background: rgba(255,255,255,.06); }
.admin-nav-link.is-active { background: var(--brand); color: #fff; }
.admin-nav-link .icon { width: 19px; height: 19px; }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { height: var(--header-h); border-bottom: 1px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: space-between; padding-inline: 20px; position: sticky; top: 0; z-index: 30; }
.admin-content { padding: 22px; flex: 1; }
.admin-page-title { font-size: 19px; font-weight: 800; margin-bottom: 4px; }

.admin-mobile-nav { display: none; }
@media (max-width: 980px) {
  .admin-sidebar { display: none; }
  .admin-mobile-nav {
    display: flex; position: fixed; bottom: 0; inset-inline: 0; height: var(--bottom-nav-h);
    background: var(--surface); border-top: 1px solid var(--border); z-index: 50;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .admin-content { padding-bottom: calc(var(--bottom-nav-h) + 16px); }
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.stat-tile__label { font-size: 12.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.stat-tile__value { font-size: 22px; font-weight: 800; }
.stat-tile__delta { font-size: 12px; font-weight: 700; margin-top: 6px; }
.stat-tile__delta--up { color: var(--success); }
.stat-tile__delta--down { color: var(--danger); }

.branch-switcher { position: relative; }
.branch-switcher__trigger { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 13.5px; font-weight: 600; cursor: pointer; background: var(--surface); }
.branch-switcher__menu { position: absolute; top: calc(100% + 6px); inset-inline-start: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 220px; z-index: 60; padding: 6px; display: none; }
.branch-switcher.is-open .branch-switcher__menu { display: block; }
.branch-switcher__item { padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer; display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.branch-switcher__item:hover { background: var(--surface-alt); }

.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban__col { background: var(--surface-alt); border-radius: var(--radius); padding: 10px; }
.kanban__col-title { font-weight: 700; font-size: 13.5px; padding: 6px 8px 10px; display: flex; justify-content: space-between; }
.kanban__card { background: var(--surface); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 8px; border: 1px solid var(--border); font-size: 13px; }

/* map builder */
.map-canvas-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: auto; background: repeating-linear-gradient(0deg, var(--surface-alt), var(--surface-alt) 1px, var(--surface) 1px, var(--surface) 24px), repeating-linear-gradient(90deg, var(--surface-alt), var(--surface-alt) 1px, transparent 1px, transparent 24px); touch-action: none; }
.map-object { position: absolute; border: 2px solid var(--brand-2); border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; cursor: grab; user-select: none; }
.map-object.is-selected { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.map-object--round { border-radius: 50%; }
.map-object--wall { background: var(--text); border-color: var(--text); }
.map-object--available { border-color: var(--success); }
.map-object--reserved { border-color: var(--danger); background: var(--danger-bg); }
.map-object--selected-table { border-color: var(--brand); background: var(--brand-light); }

/* installer */
.installer-body { background: var(--surface-alt); min-height: 100vh; }
.installer { max-width: 640px; margin: 0 auto; padding: 32px 16px 60px; }
.installer__brand { display: flex; align-items: center; gap: 10px; font-weight: 800; justify-content: center; margin-bottom: 22px; }
.installer__steps { display: flex; justify-content: space-between; margin-bottom: 20px; overflow-x: auto; gap: 4px; }
.installer__step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; min-width: 64px; }
.installer__step-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.installer__step.is-active .installer__step-dot { border-color: var(--brand); color: var(--brand); }
.installer__step.is-done .installer__step-dot { background: var(--brand); border-color: var(--brand); color: #fff; }
.installer__step-label { font-size: 10.5px; color: var(--text-muted); text-align: center; }
.installer__card { background: var(--surface); border-radius: var(--radius-lg); padding: 26px 24px; box-shadow: var(--shadow); }
.installer__title { font-size: 19px; font-weight: 800; margin-bottom: 8px; }
.installer__lead { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.installer__checklist { display: flex; flex-direction: column; gap: 8px; margin-bottom: 22px; }
.installer__checklist li { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-muted); }
.installer__actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.installer__actions--full { grid-column: 1 / -1; }

.req-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.req-list__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-alt); }
.req-list__item.is-fail { background: var(--danger-bg); }
.req-list__item.is-ok .req-list__icon { color: var(--success); }
.req-list__item.is-fail .req-list__icon { color: var(--danger); }
.req-list__text { display: flex; flex-direction: column; }
.req-list__text small { color: var(--text-muted); }

.choice-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 6px; cursor: pointer; }
.choice-card.is-selected { border-color: var(--brand); background: var(--brand-light); }
.choice-card input { position: absolute; opacity: 0; }
.choice-card__title { font-weight: 700; display: flex; align-items: center; gap: 6px; font-size: 14px; }
.choice-card__desc { font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 520px) { .choice-cards { grid-template-columns: 1fr; } }

.review-list { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 18px; }
.review-list__row { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.review-list__row:last-child { border-bottom: none; }
.review-list__row span { color: var(--text-muted); }

.install-progress__list { display: flex; flex-direction: column; gap: 10px; margin: 18px 0; }
.install-progress__list li { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-alt); font-size: 13.5px; color: var(--text-muted); position: relative; padding-inline-start: 36px; }
.install-progress__list li::before { content: ''; position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); }
.install-progress__list li.is-active { color: var(--text); font-weight: 700; background: var(--brand-light); }
.install-progress__list li.is-active::before { border-color: var(--brand); }
.install-progress__list li.is-done::before { border-color: var(--success); background: var(--success); }

/* error page */
.error-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.error-page__code { font-size: 56px; font-weight: 800; color: var(--brand); }
.error-page__title { font-size: 16px; color: var(--text-muted); max-width: 340px; }

/* auth pages */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--surface-alt); }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border-radius: var(--radius-lg); padding: 28px 24px; box-shadow: var(--shadow); }
.auth-card__title { font-size: 18px; font-weight: 800; margin-bottom: 6px; text-align: center; }
.auth-card__lead { text-align: center; color: var(--text-muted); font-size: 13.5px; margin-bottom: 20px; }
.otp-input-row { display: flex; gap: 8px; justify-content: center; direction: ltr; }
.otp-input-row input { width: 42px; height: 50px; text-align: center; font-size: 20px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .admin-shell, .admin-content { background: #fff; }
  .card, .qr-card { background: #fff; border: 1px solid #ccc; color: #000; break-inside: avoid; page-break-inside: avoid; }
  .qr-card { margin-bottom: 16px; }
}
