:root {
  /* ── Brand colours ───────────────────────────── */
  --blue:        #5A32FF;
  --blue-dark:   #4020E0;
  --blue-dim:    #EDE8FF;
  --blue-text:   #2B12B8;

  --yellow:      #FCD008;
  --yellow-dark: #C9A600;
  --yellow-dim:  #FFFACC;
  --yellow-text: #0c1a3a;   /* dark navy — readable on yellow */

  /* ── Neutrals ────────────────────────────────── */
  --bg:          #f4f7ff;
  --surface:     #ffffff;
  --text:        #0c1a3a;
  --muted:       #5a6a85;
  --border:      #d9e3f0;

  /* ── Semantic ────────────────────────────────── */
  --danger:      #ef4444;
  --success:     #10b981;

  /* ── Tokens ──────────────────────────────────── */
  --radius:    16px;
  --radius-sm: 10px;
  --sh-sm:  0 1px 4px rgba(12,26,58,.08);
  --sh:     0 4px 20px rgba(90,50,255,.12);
  --sh-lg:  0 20px 52px rgba(90,50,255,.18);

  /* ── Backward-compat aliases ─────────────────── */
  --c-primary:       var(--blue);
  --c-primary-dark:  var(--blue-dark);
  --c-primary-light: var(--blue-dim);
  --c-muted:         var(--muted);
  --c-danger:        var(--danger);
  --c-bg:            var(--bg);
  --c-surface:       var(--surface);
  --c-text:          var(--text);
  --c-border:        var(--border);
  --c-success:       var(--success);
  --c-warning:       var(--yellow);
}

/* ─── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Vazir', Vazirmatn, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
button { font-family: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* ─── Layout ──────────────────────────────────────── */
.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
main.container { padding-top: 32px; padding-bottom: 64px; }

/* ─── Topbar ──────────────────────────────────────── */
.topbar {
  background: var(--surface);
  border-bottom: 2px solid var(--yellow);
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 12px rgba(90,50,255,.08);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; color: var(--text); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 10px;
  object-fit: contain;
}
.brand-name { font-size: 19px; letter-spacing: -.3px; color: var(--blue-text); }

.topnav { display: flex; align-items: center; gap: 4px; }
.topnav > a {
  color: var(--muted); font-weight: 600; font-size: 14px;
  padding: 6px 12px; border-radius: 8px; transition: .15s;
}
.topnav > a:hover { color: var(--blue); background: var(--blue-dim); }
.btn-link {
  background: none; border: none; padding: 6px 10px;
  border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--muted) !important; transition: .15s;
}
.btn-link:hover { color: var(--danger) !important; background: #fef2f2; }

/* ─── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 20px; border-radius: 12px;
  font-weight: 700; font-size: 15px; border: 2px solid transparent;
  transition: all .15s; white-space: nowrap; cursor: pointer;
}

/* Yellow = primary CTA */
.btn-primary {
  background: var(--yellow);
  color: var(--yellow-text);
  border-color: var(--yellow);
  box-shadow: 0 3px 10px rgba(252,208,8,.30);
}
.btn-primary:hover {
  background: var(--yellow-dark);
  border-color: var(--yellow-dark);
  color: #fff;
  box-shadow: 0 5px 16px rgba(252,208,8,.45);
  transform: translateY(-1px);
}

/* Blue = secondary action */
.btn-blue {
  background: var(--blue);
  color: #ffffff;
  border-color: var(--blue);
  box-shadow: 0 3px 10px rgba(90,50,255,.28);
}
.btn-blue:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
  box-shadow: 0 5px 16px rgba(90,50,255,.40);
  transform: translateY(-1px);
}

/* Outline = tertiary */
.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-dim);
}

/* Ghost = minimal */
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

.btn-block { width: 100%; }
.btn-lg { height: 52px; font-size: 16px; padding: 0 28px; border-radius: 14px; }
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ─── Form controls ───────────────────────────────── */
.input, .select, .textarea {
  width: 100%; height: 46px; padding: 0 14px;
  border: 2px solid var(--border); border-radius: 12px;
  background: var(--surface); font-family: inherit;
  font-size: 15px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.textarea { padding: 12px 14px; height: auto; min-height: 100px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(252,208,8,.15);
}
.label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--muted); }

/* ─── Hero ────────────────────────────────────────── */
.hero { padding: 64px 0 40px; text-align: center; }
.hero h1 {
  font-size: 44px; font-weight: 900; letter-spacing: -1px; margin-bottom: 14px; line-height: 1.2;
  background: linear-gradient(135deg, var(--blue-text) 0%, var(--blue) 60%, #A08CFF 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 24px; font-size: 16px; }

/* ─── Action cards ────────────────────────────────── */
.action-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px; margin: 40px 0;
}
.action-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  color: var(--text); transition: all .2s; box-shadow: var(--sh-sm);
}
.action-card:hover {
  transform: translateY(-5px); box-shadow: var(--sh-lg);
  border-color: var(--yellow);
}
.action-card:hover .icon { background: var(--yellow-dim); }
.action-card .icon {
  font-size: 32px; width: 62px; height: 62px;
  border-radius: 14px; display: grid; place-items: center;
  background: var(--blue-dim); transition: background .2s;
}
.action-card h3 { font-size: 20px; font-weight: 800; }
.action-card p  { color: var(--muted); font-size: 14px; line-height: 1.6; flex: 1; }

/* ─── Generic card ────────────────────────────────── */
.card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--sh-sm); margin-bottom: 20px;
}
.card h2 { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ─── Page heading ────────────────────────────────── */
.page-head { padding: 32px 0 16px; }
.page-head h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -.5px; }
.page-head p  { color: var(--muted); margin: 6px 0 0; font-size: 15px; }

/* ─── Footer ──────────────────────────────────────── */
.footer {
  margin-top: 48px; padding: 28px 0;
  border-top: 2px solid var(--yellow-dim);
  color: var(--muted); font-size: 14px; text-align: center;
  background: var(--surface);
}

/* ─── Café ────────────────────────────────────────── */
.cat-title {
  margin: 36px 0 16px; font-size: 19px; font-weight: 900;
  display: flex; align-items: center; gap: 10px; color: var(--text);
}
.cat-title::before {
  content: ''; display: block; width: 5px; height: 24px; border-radius: 3px;
  background: linear-gradient(180deg, var(--yellow), var(--blue));
}
.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.prod {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: var(--sh-sm); transition: all .2s;
}
.prod:hover { box-shadow: var(--sh); transform: translateY(-3px); border-color: var(--yellow); }
.prod-img {
  height: 130px; border-radius: var(--radius-sm);
  background: var(--bg); display: grid; place-items: center;
  font-size: 36px; overflow: hidden; position: relative;
}
.prod-img::before {
  content: ''; position: absolute; inset: -8px;
  background: var(--bg) center / cover no-repeat;
  filter: blur(14px) brightness(.75) saturate(1.3);
  z-index: 0;
}
.prod-img img {
  position: relative; z-index: 1;
  width: 100%; height: 130px; object-fit: contain;
}
.prod-name  { font-weight: 800; font-size: 15px; }
.prod-price { color: var(--blue-text); font-weight: 800; font-size: 16px; }
.prod-foot  { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 4px; }

/* ─── Floating cart ───────────────────────────────── */
.cart-fab {
  position: fixed; bottom: 28px; left: 28px; z-index: 20;
  background: linear-gradient(135deg, var(--yellow), var(--yellow-dark));
  color: var(--yellow-text); border: none;
  width: 64px; height: 64px; border-radius: 32px;
  box-shadow: 0 8px 28px rgba(252,208,8,.50);
  font-size: 26px; display: grid; place-items: center; transition: transform .15s;
}
.cart-fab:hover { transform: scale(1.1); }
.cart-fab .badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--blue); color: #fff;
  font-size: 12px; border-radius: 10px;
  padding: 2px 7px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(90,50,255,.40);
}

/* ─── Cart drawer ─────────────────────────────────── */
.drawer-bg {
  position: fixed; inset: 0; background: rgba(12,26,58,.50);
  backdrop-filter: blur(2px); z-index: 55; display: none;
}
.drawer-bg.open { display: block; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: -420px;
  width: 400px; max-width: 92%; background: var(--surface); z-index: 60;
  box-shadow: var(--sh-lg); transition: left .25s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { left: 0; }
.drawer-head {
  padding: 20px 22px; border-bottom: 2px solid var(--yellow);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 900; font-size: 18px;
  background: linear-gradient(135deg, var(--yellow-dim), #fff);
}
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-foot { padding: 16px 20px; border-top: 2px solid var(--border); background: var(--bg); }
.cart-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--border); gap: 10px;
}
.cart-row:last-child { border-bottom: none; }
.qty {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--bg); border-radius: var(--radius-sm); padding: 3px;
}
.qty button {
  width: 30px; height: 30px; border-radius: 8px;
  border: 2px solid var(--border); background: var(--surface);
  font-weight: 800; font-size: 16px; box-shadow: var(--sh-sm); transition: .12s; color: var(--text);
}
.qty button:hover { background: var(--yellow); color: var(--yellow-text); border-color: var(--yellow); }
.qty span { min-width: 26px; text-align: center; font-weight: 800; }

/* ─── Toasts ──────────────────────────────────────── */
#toast-root {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: var(--text); color: #fff;
  padding: 13px 22px; border-radius: 12px;
  box-shadow: var(--sh-lg); font-weight: 700; font-size: 14px;
  animation: toastin .25s cubic-bezier(.4,0,.2,1);
}
.toast.success { background: var(--success); color: #fff; }
.toast.error   { background: var(--danger);  color: #fff; }
@keyframes toastin { from { opacity: 0; transform: translateY(-12px); } }

/* ─── Reservation steps ───────────────────────────── */
.step-nav { display: flex; gap: 6px; justify-content: center; margin: 12px 0 28px; }
.step-nav span {
  padding: 6px 16px; border-radius: 20px;
  background: var(--border); color: var(--muted); font-size: 13px; font-weight: 700;
}
.step-nav span.on { background: var(--yellow); color: var(--yellow-text); box-shadow: 0 2px 8px rgba(252,208,8,.30); }

.space-card {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px; border: 2px solid var(--border); border-radius: var(--radius);
  background: var(--surface); margin-bottom: 12px; gap: 14px; flex-wrap: wrap;
  transition: all .15s; box-shadow: var(--sh-sm);
}
.space-card:hover { border-color: var(--yellow); box-shadow: var(--sh); }
.space-info h3 { margin: 0 0 4px; font-weight: 800; }
.space-info p  { margin: 0; color: var(--muted); font-size: 14px; }

/* ─── Debug OTP ───────────────────────────────────── */
.debug-otp {
  background: var(--yellow-dim); border: 2px dashed var(--yellow);
  color: var(--yellow-text); padding: 14px 18px; border-radius: 12px;
  margin: 16px 0; font-weight: 800; text-align: center; font-size: 16px;
}

/* ─── Tables ──────────────────────────────────────── */
.table {
  width: 100%; border-collapse: collapse;
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.table th, .table td { padding: 13px 16px; text-align: right; border-bottom: 1px solid var(--border); }
.table th {
  background: var(--bg); font-weight: 800;
  color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .3px;
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8faff; }

/* ─── Status badges ───────────────────────────────── */
.badge-status { display: inline-block; padding: 3px 12px; border-radius: 20px; font-size: 12px; font-weight: 800; }
.st-paid, .st-done, .st-printed { background: #d1fae5; color: #065f46; }
.st-pending_payment, .st-pending, .st-queued { background: var(--yellow-dim); color: var(--yellow-text); }
.st-preparing { background: var(--blue-dim); color: var(--blue-text); }
.st-cancelled, .st-failed { background: #fee2e2; color: #991b1b; }

/* ─── Empty state ─────────────────────────────────── */
.empty { padding: 56px 20px; text-align: center; color: var(--muted); font-size: 15px; }
.empty::before { content: '📭'; display: block; font-size: 40px; margin-bottom: 12px; }

/* ─── Spinner ─────────────────────────────────────── */
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2.5px solid rgba(0,0,0,.15); border-top-color: currentColor;
  border-radius: 50%; animation: spin .65s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Login page ──────────────────────────────────── */
.login-wrap {
  min-height: calc(100vh - 68px);
  display: flex; align-items: center; justify-content: center; padding: 40px 16px;
}
.login-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 20px; padding: 40px 36px;
  width: 100%; max-width: 420px; box-shadow: var(--sh-lg);
}
.login-card h2 { font-size: 24px; font-weight: 900; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 28px; }

/* ─── Mobile ──────────────────────────────────────── */
@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .topnav > a:not(.btn):not(.btn-primary):not(.btn-blue) { display: none; }
  main.container { padding-top: 20px; }
}
