﻿/* =========================================================
   Navd · قالب پنل مدیریت سفرهای گروهی
   RTL · Vazirmatn + Lalezar · Persian-garden palette
   ========================================================= */

@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Lalezar"; src: url("../fonts/Lalezar.ttf") format("truetype"); font-weight: 400; font-display: swap; }

:root {
  /* palette */
  --primary: oklch(0.42 0.085 164);        /* cypress: actions, links, taken seats */
  --primary-hover: oklch(0.37 0.08 164);
  --primary-ink: oklch(0.98 0.01 150);
  --primary-soft: oklch(0.42 0.085 164 / 0.1);
  --saffron: oklch(0.8 0.15 78);           /* leader, open trips */
  --saffron-ink: oklch(0.32 0.06 70);
  --pomegranate: oklch(0.53 0.17 28);      /* cancel, danger */
  --pomegranate-soft: oklch(0.53 0.17 28 / 0.1);
  --pistachio: oklch(0.84 0.09 125);       /* pending, secondary */
  --seat: oklch(0.91 0.012 150);           /* empty seat, tracks */
  --panel: oklch(0.255 0.045 168);         /* sidebar */
  --panel-ink: oklch(0.93 0.02 150);

  --bg: oklch(0.982 0.006 150);
  --surface: oklch(0.997 0.003 150);
  --text: oklch(0.26 0.03 170);
  --muted: oklch(0.5 0.025 165);
  --border: oklch(0.9 0.012 160);
  --hover: oklch(0.955 0.01 155);

  /* type */
  --font: "Vazirmatn", Tahoma, sans-serif;
  --font-display: "Lalezar", "Vazirmatn", sans-serif;
  --fs-sm: 14px;
  --fs-base: 15px;
  --fs-h: 24px;
  --fs-display: 40px;

  --radius: 10px;
  --shadow: 0 1px 2px oklch(0.26 0.03 170 / 0.05);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --sidebar-w: 256px;
}

*, *::before, *::after { box-sizing: border-box; }
html { direction: rtl; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-base); line-height: 1.8; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 400; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.sm { font-size: var(--fs-sm); }
.display { font-family: var(--font-display); font-weight: 400; }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 14px; height: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: var(--sidebar-w); flex-shrink: 0; background: var(--panel); color: var(--panel-ink); padding: 24px; display: flex; flex-direction: column; gap: 40px; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 50%; background: var(--saffron); color: var(--saffron-ink); display: grid; place-items: center; animation: needle 9s ease-in-out infinite; }
.brand-mark .icon { width: 24px; height: 24px; }
.brand-name { font-family: var(--font-display); font-size: 24px; line-height: 1; }
@keyframes needle { 0%, 100% { transform: rotate(0); } 35% { transform: rotate(14deg); } 70% { transform: rotate(-8deg); } }

.nav { display: flex; flex-direction: column; gap: 24px; }
.nav-group { display: flex; flex-direction: column; gap: 4px; }
.nav-title { padding: 0 12px 4px; font-size: var(--fs-sm); color: oklch(0.93 0.02 150 / 0.7); }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius); color: oklch(0.93 0.02 150 / 0.78); font-size: var(--fs-base); transition: background 200ms var(--ease), color 200ms var(--ease); }
.nav-link:hover { background: oklch(0.93 0.02 150 / 0.06); color: var(--panel-ink); text-decoration: none; }
.nav-link.active { background: oklch(0.93 0.02 150 / 0.12); color: var(--panel-ink); font-weight: 600; }
.nav-link.active .icon { color: var(--saffron); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 48px; }
.topbar-start { display: flex; align-items: center; gap: 8px; }
.topbar .brand { color: var(--primary); display: none; }
.content { flex: 1; padding: 16px 48px 64px; }
.footer { padding: 16px 48px; font-size: var(--fs-sm); color: var(--muted); }

/* user menu */
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 12px; padding: 4px 4px 4px 16px; border: 0; background: none; border-radius: 999px; font: inherit; color: inherit; cursor: pointer; }
.user-btn:hover { background: var(--hover); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-family: var(--font-display); font-size: 18px; }
.user-meta { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.4; }
.user-meta b { font-size: var(--fs-sm); }
.dropdown { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); min-width: 200px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px oklch(0.26 0.03 170 / 0.12); padding: 6px; display: none; z-index: 30; }
.dropdown.open { display: block; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: var(--fs-sm); color: inherit; cursor: pointer; text-align: start; }
.dropdown-item:hover { background: var(--hover); text-decoration: none; }
.dropdown-item.danger { color: var(--pomegranate); }
.dropdown-label { padding: 6px 10px; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 32px; }
.page-head h1 { font-family: var(--font-display); font-size: var(--fs-display); line-height: 1.3; }
.page-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.back { margin-bottom: 16px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: var(--radius); border: 1px solid transparent; background: var(--primary); color: var(--primary-ink); font: inherit; font-size: var(--fs-sm); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background 200ms var(--ease), transform 120ms; }
.btn:hover { background: var(--primary-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border); box-shadow: var(--shadow); }
.btn-outline:hover { background: var(--hover); }
.btn-ghost { background: none; color: var(--text); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { background: var(--pomegranate); }
.btn-danger:hover { background: oklch(0.48 0.17 28); }
.btn-danger-outline { background: var(--surface); color: var(--pomegranate); border-color: oklch(0.53 0.17 28 / 0.35); }
.btn-danger-outline:hover { background: var(--pomegranate-soft); }
.btn-sm { height: 32px; padding: 0 10px; font-weight: 500; }
.btn-lg { height: 44px; font-size: var(--fs-base); }
.btn-icon { width: 36px; padding: 0; }
.btn-block { width: 100%; }
.text-danger { color: var(--pomegranate) !important; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 24px 8px; }
.card-title { font-family: var(--font-display); font-size: var(--fs-h); line-height: 1.4; }
.card-body { padding: 16px 24px 24px; }
.card-flush { padding: 0; overflow: hidden; }

.grid { display: grid; gap: 24px; }
.grid-dash { grid-template-columns: minmax(0, 1fr) 320px; }
.grid-detail { grid-template-columns: minmax(0, 1fr) 300px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-7-5 { grid-template-columns: 7fr 5fr; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.stack-sm { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.wrap { flex-wrap: wrap; }
.mb { margin-bottom: 24px; }

/* ---------- hero (dashboard) ---------- */
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }
.hero h1 { font-family: var(--font-display); font-size: 56px; line-height: 1.3; }
.hero h1 em { font-style: normal; color: var(--primary); }
.hero p { margin: 4px 0 0; color: var(--muted); font-size: 16px; }

/* departures board */
.departure { display: grid; grid-template-columns: 88px minmax(0, 1fr) 220px auto; align-items: center; gap: 16px; padding: 16px 8px; border-radius: var(--radius); color: inherit; transition: background 200ms var(--ease); }
.departure + .departure { border-top: 1px solid var(--border); }
.departure:hover { background: var(--hover); text-decoration: none; }
.date-tile { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: var(--radius); background: var(--panel); color: var(--panel-ink); line-height: 1.3; }
.date-tile b { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1.1; }
.date-tile span { font-size: var(--fs-sm); opacity: 0.75; }
.departure-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route { display: flex; align-items: center; gap: 4px; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- seats (signature) ---------- */
.seat-strip { display: flex; flex-direction: column; gap: 6px; }
.seats { display: flex; gap: 3px; max-width: 224px; }
.seats i { flex: 1; max-width: 8px; height: 12px; border-radius: 3px 3px 2px 2px; background: var(--seat); }
.seats i.taken, .seat.taken { background: var(--primary); color: var(--primary-ink); }
.seats i.pending, .seat.pending { background: var(--pistachio); }
.seats i.leader, .seat.leader { background: var(--saffron); color: var(--saffron-ink); }
.seat-count { font-size: var(--fs-sm); color: var(--muted); }

.bus { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 16px 24px 24px; background: var(--surface); border: 2px solid var(--border); border-radius: 30px; }
.bus-front { display: flex; justify-content: space-between; align-items: center; width: 100%; font-size: var(--fs-sm); color: var(--muted); }
.wheel { width: 28px; height: 28px; border-radius: 50%; border: 2px solid oklch(0.5 0.025 165 / 0.4); }
.bus-row { display: flex; gap: 8px; width: 192px; }
.bus-row .seat:nth-child(3) { margin-inline-start: 24px; }
.seat { width: 36px; height: 36px; border-radius: 10px 10px 4px 4px; background: var(--seat); color: var(--muted); display: grid; place-items: center; font-size: 12px; opacity: 0; animation: board 300ms var(--ease) forwards; animation-delay: calc(150ms + var(--i, 0) * 35ms); }
.seat .icon { width: 16px; height: 16px; fill: currentColor; }
@keyframes board { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: var(--fs-sm); color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 12px; border-radius: 3px 3px 1px 1px; background: var(--seat); }

/* ---------- meters ---------- */
.meter { display: flex; flex-direction: column; gap: 8px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; }
.meter-head b { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1; }
.track { height: 8px; border-radius: 999px; background: var(--seat); overflow: hidden; }
.track.lg { height: 12px; }
.fill { height: 100%; border-radius: 999px; background: var(--primary); animation: grow 800ms var(--ease) both; transform-origin: right; }
.fill.saffron { background: var(--saffron); }
.fill.pistachio { background: var(--pistachio); }
@keyframes grow { from { transform: scaleX(0); } }
.status-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; }
.status-legend { display: grid; grid-template-columns: 1fr; gap: 12px; font-size: var(--fs-sm); }
.status-legend div { display: flex; align-items: center; gap: 8px; }
.status-legend b { margin-inline-start: auto; }
.dot { width: 12px; height: 12px; border-radius: 50%; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 12px; border-radius: 999px; font-size: var(--fs-sm); white-space: nowrap; line-height: 1.8; }
.badge-open { background: var(--saffron); color: var(--saffron-ink); }
.badge-closed { background: var(--seat); }
.badge-cancelled { background: var(--pomegranate-soft); color: var(--pomegranate); }
.badge-finished, .badge-done { background: var(--primary-soft); color: var(--primary); }
.badge-warn { background: var(--saffron); color: var(--saffron-ink); }
.badge-outline { border: 1px solid var(--border); background: var(--surface); }
.badge-leader { background: var(--saffron); color: var(--saffron-ink); padding: 0 8px; }
.badge-leader .icon { fill: currentColor; }
.bg-saffron { background: var(--saffron); } .bg-primary { background: var(--primary); } .bg-pomegranate { background: var(--pomegranate); } .bg-muted { background: oklch(0.5 0.025 165 / 0.4); } .bg-pistachio { background: var(--pistachio); }

.score { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font-family: var(--font-display); font-size: 18px; background: var(--seat); }
.score.high { background: var(--primary); color: var(--primary-ink); }
.score.mid { background: var(--pistachio); }

/* ---------- facts ---------- */
.fact { display: flex; flex-direction: column; gap: 2px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.2); }
.fact b { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.3; }
.fact b.accent { color: var(--primary); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th { padding: 12px 8px; text-align: start; font-size: var(--fs-sm); font-weight: 500; color: var(--muted); white-space: nowrap; border-bottom: 1px solid var(--border); }
.table td { padding: 14px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table th:first-child, .table td:first-child { padding-inline-start: 24px; }
.table th:last-child, .table td:last-child { padding-inline-end: 24px; }
.table tbody tr { transition: background 160ms; }
.table tbody tr:hover { background: var(--hover); }
.table tr.is-muted { opacity: 0.5; }
.table .end { text-align: end; }
.table .strong { font-weight: 600; }
.table .sub { font-size: var(--fs-sm); color: var(--muted); }
/* جدول در عرض کم: هر ردیف به شکل کارت درمی‌آید؛ عنوان هر خانه از data-label خوانده می‌شود */
@media (max-width: 720px) {
  .table.table-cards thead { display: none; }
  .table.table-cards, .table.table-cards tbody, .table.table-cards tr, .table.table-cards td { display: block; width: 100%; }
  .table.table-cards tr { padding: 14px 20px; border-bottom: 1px solid var(--border); }
  .table.table-cards tbody tr:last-child { border-bottom: 0; }
  .table.table-cards td { padding: 6px 0; border: 0; }
  .table.table-cards td::before { content: attr(data-label); display: block; font-size: var(--fs-sm); color: var(--muted); }
  .table.table-cards td:first-child { padding-bottom: 8px; font-size: 16px; font-weight: 600; }
  .table.table-cards td:first-child::before { display: none; }
  .table.table-cards td.cell-actions { display: block; justify-content: flex-start; padding-top: 12px; }
  .table.table-cards td.cell-actions::before { display: none; }
  .table.table-cards td.cell-actions form { display: block; }
  .table.table-cards td.cell-actions .btn { width: 100%; justify-content: center; }
}
.cell-actions { display: flex; justify-content: flex-end; gap: 4px; white-space: nowrap; }
.empty { padding: 56px 24px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 16px; }

/* ---------- toolbar / forms ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); cursor: pointer; transition: background 160ms; }
.pill:hover { background: var(--hover); }
.pill.on, .pill[aria-pressed="true"] { background: var(--primary); border-color: transparent; color: var(--primary-ink); }
.pill:disabled { opacity: 0.3; pointer-events: none; }

.search { position: relative; width: 288px; max-width: 100%; }
.search .icon { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .input { padding-inline-start: 38px; }

.form-grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.label { font-size: var(--fs-sm); font-weight: 600; }
.input, .select, .textarea { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; font-size: var(--fs-sm); box-shadow: var(--shadow); transition: border-color 160ms, box-shadow 160ms; }
.textarea { height: auto; padding: 8px 12px; line-height: 1.8; resize: vertical; }
.select { appearance: none; padding-inline-end: 12px; padding-inline-start: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23778' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input:disabled, .select:disabled { opacity: 0.55; }
.input.is-invalid, .select.is-invalid { border-color: var(--pomegranate); }
.field-error { font-size: var(--fs-sm); color: var(--pomegranate); }
.hint { font-size: var(--fs-sm); color: var(--muted); }
.fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.legend-title { padding: 0; font-weight: 700; font-size: var(--fs-base); color: var(--primary); }

.check { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--primary); margin: 0; }

.switch { display: inline-flex; align-items: center; gap: 10px; font-size: var(--fs-sm); cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .knob { position: relative; width: 36px; height: 20px; border-radius: 999px; background: var(--seat); transition: background 200ms var(--ease); flex-shrink: 0; }
.switch .knob::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 16px; height: 16px; border-radius: 50%; background: white; box-shadow: 0 1px 2px oklch(0 0 0 / 0.2); transition: inset-inline-start 200ms var(--ease); }
.switch input:checked + .knob { background: var(--primary); }
.switch input:checked + .knob::after { inset-inline-start: 18px; }
.switch input:focus-visible + .knob { box-shadow: 0 0 0 3px var(--primary-soft); }

.segmented { display: inline-flex; gap: 4px; padding: 3px; border-radius: var(--radius); background: var(--seat); }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: block; padding: 4px 14px; border-radius: 8px; font-size: var(--fs-sm); }
.segmented input:checked + span { background: var(--surface); box-shadow: var(--shadow); font-weight: 600; }

.alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--radius); font-size: var(--fs-sm); margin-bottom: 16px; }
.alert-success { background: var(--primary-soft); color: var(--primary); }
.alert-error { background: var(--pomegranate-soft); color: var(--pomegranate); }
.alert-info { background: var(--hover); color: var(--muted); }

.opt-grid { display: grid; grid-template-columns: 1fr 1fr 80px 36px; gap: 8px; align-items: center; }
.opt-new { padding: 8px; border-radius: var(--radius); background: var(--hover); }
.cond { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: var(--fs-sm); }
.cond .icon, .cond-inline .icon { color: var(--saffron-ink); }
.cond-inline { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-sm); }
.cond-inline .icon { margin-top: 4px; }
.req { color: var(--pomegranate); margin-inline-start: 2px; }

.cat-card { display: flex; flex-direction: column; gap: 16px; padding: 24px; }
.cat-card .big { font-family: var(--font-display); font-size: 36px; color: var(--primary); line-height: 1; }

.bars { display: flex; flex-direction: column; gap: 16px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-row .row { justify-content: space-between; font-size: var(--fs-sm); }
.numbers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.numbers b { font-family: var(--font-display); font-weight: 400; font-size: 30px; color: var(--primary); display: block; line-height: 1.3; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 24px; background: oklch(0.2 0.03 168 / 0.45); }
.modal.open { display: flex; animation: fade 200ms var(--ease); }
.modal-dialog { width: 100%; max-width: 520px; max-height: calc(100vh - 48px); overflow-y: auto; background: var(--surface); border-radius: calc(var(--radius) * 1.6); box-shadow: 0 24px 64px oklch(0.2 0.03 168 / 0.25); animation: rise 260ms var(--ease); }
.modal-lg { max-width: 720px; } .modal-xl { max-width: 900px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 24px 8px; }
.modal-title { font-family: var(--font-display); font-size: var(--fs-h); line-height: 1.4; }
.modal-body { padding: 16px 24px; display: flex; flex-direction: column; gap: 28px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px 24px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* popover (discount) */
.pop { position: relative; display: inline-block; }
.pop-panel { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); width: 260px; padding: 16px; display: none; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px oklch(0.26 0.03 170 / 0.12); z-index: 20; }
.pop.open .pop-panel { display: flex; }

/* ---------- login ---------- */
.login { display: grid; grid-template-columns: 1fr 480px; min-height: 100vh; }
.login-art { background: var(--panel); color: var(--panel-ink); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h2 { font-family: var(--font-display); font-size: 64px; line-height: 1.3; }
.login-art h2 span { color: var(--saffron); }
.login-seats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.login-seats i { width: 20px; height: 24px; border-radius: 6px 6px 3px 3px; background: oklch(0.93 0.02 150 / 0.15); opacity: 0; animation: board 300ms var(--ease) forwards; animation-delay: calc(300ms + var(--i) * 40ms); }
.login-seats i.t { background: oklch(0.93 0.02 150 / 0.7); }
.login-seats i.l { background: var(--saffron); }
.login-form { display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 28px; }
.login-box h1 { font-family: var(--font-display); font-size: var(--fs-display); line-height: 1.2; }

/* ---------- mobile ---------- */
.menu-btn { display: none; }
.backdrop { display: none; }
@media (max-width: 1100px) {
  .grid-dash, .grid-detail, .grid-7-5 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 40; transform: translateX(100%); transition: transform 280ms var(--ease); }
  .sidebar.open { transform: none; }
  .backdrop.open { display: block; position: fixed; inset: 0; z-index: 35; background: oklch(0.2 0.03 168 / 0.45); }
  .menu-btn { display: inline-flex; }
  .topbar .brand { display: flex; }
  .topbar, .content, .footer { padding-inline: 24px; }
  .user-meta { display: none; }
  .user-btn { padding: 4px; }
  .grid-2, .cols-2, .cols-3, .cols-4, .cols-6 { grid-template-columns: 1fr; }
  .span-2, .span-3 { grid-column: auto; }
  .departure { grid-template-columns: 72px minmax(0, 1fr); }
  .departure .seat-strip { grid-column: 1 / -1; }
  .departure .badge { display: none; }
  .hero h1 { font-size: 40px; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .search { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; } }

/* =========================================================
   اتصال به ASP.NET MVC (اعتبارسنجی، مدال Ajax، جدول‌ها)
   ========================================================= */
/* خطاهای ValidationMessageFor و فیلدهای نامعتبر */
.field-validation-error { font-size: var(--fs-sm); color: var(--pomegranate); }
.field-validation-valid { display: none; }
.input-validation-error { border-color: var(--pomegranate) !important; }
.validation-summary-valid { display: none; }

/* فرم‌هایی که فقط دور یک دکمه هستند در چیدمان اثری ندارند */
.inline-form { display: contents; }

/* هدر مدال: هم برای مدال و هم وقتی فرم به‌صورت صفحه کامل باز شود */
.modal-dialog > form, .form-page > form { display: block; }
.form-page { max-width: 900px; }
.form-page.narrow { max-width: 560px; }
.modal-loading { padding: 64px 24px; display: grid; place-items: center; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--seat); border-top-color: var(--primary); animation: spin 700ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* پیام‌های بستنی */
.alert .alert-close { margin-inline-start: auto; border: 0; background: none; color: inherit; cursor: pointer; padding: 0; display: grid; place-items: center; opacity: 0.7; }
.alert .alert-close:hover { opacity: 1; }
.login-alert { position: fixed; top: 16px; inset-inline: 16px; z-index: 60; max-width: 480px; margin: 0 auto; }

/* انتخاب چندتایی به‌شکل pill (چک‌باکس داخل label) */
label.pill { display: inline-flex; align-items: center; gap: 6px; }
label.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.pill:has(input:checked), label.pill.on { background: var(--primary); border-color: transparent; color: var(--primary-ink); }
label.pill:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--primary-soft); }
.opt-group { display: flex; flex-direction: column; gap: 8px; }
.opt-group + .opt-group { margin-top: 12px; }
.opt-group-title { font-size: var(--fs-sm); color: var(--muted); }
.opt-scroll { max-height: 320px; overflow-y: auto; padding-inline-end: 4px; }

/* جدول: صفحه‌بندی و حالت خالی */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }
.pager .actions { gap: 4px; }
.pager[hidden] { display: none; }
.table th[data-sort] { cursor: pointer; user-select: none; }
.table th[data-sort]:hover { color: var(--text); }
.table th[aria-sort="ascending"]::after { content: " ↑"; }
.table th[aria-sort="descending"]::after { content: " ↓"; }
.table td.empty-cell { padding: 48px 24px; text-align: center; color: var(--muted); }

/* ردیف گزینه‌ها در ویرایش سؤال (فرم جدا برای هر ردیف) */
.opt-grid.with-delete { grid-template-columns: 1fr 1fr 80px 36px 36px; }
@media (max-width: 960px) {
  .opt-grid, .opt-grid.with-delete { grid-template-columns: 1fr 1fr; }
}

/* داشبورد: خط شاخص بدون نوار */
.kpi-line { display: flex; justify-content: space-between; align-items: baseline; font-size: var(--fs-sm); }
.kpi-line b { font-family: var(--font-display); font-weight: 400; font-size: 24px; line-height: 1; }

/* صفحه خطا */
.error-box { max-width: 520px; margin: 48px auto; text-align: center; padding: 40px 24px; }
.error-box .icon { width: 40px; height: 40px; color: var(--saffron-ink); }

/* ---------- تقویم شمسی (data-jdate) ---------- */
.jdp { position: fixed; z-index: 90; padding: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 12px 32px oklch(0.26 0.03 170 / 0.18); }
.jdp[hidden] { display: none; }
.jdp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.jdp-title { font-size: var(--fs-sm); font-weight: 600; }
.jdp-nav { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; font-size: 18px; line-height: 1; color: var(--text); }
.jdp-nav:hover { background: var(--hover); }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdp-dow { text-align: center; font-size: 12px; color: var(--muted); padding: 2px 0; }
.jdp-empty { height: 32px; }
.jdp-day { height: 32px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; font: inherit; font-size: var(--fs-sm); color: var(--text); }
.jdp-day:hover { background: var(--hover); }
.jdp-day.today { box-shadow: inset 0 0 0 1px var(--border); }
.jdp-day.on { background: var(--primary); color: var(--primary-ink); font-weight: 600; }

/* ---------- کارت برنامه‌های سفر با تصویر ---------- */
.trip-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.trip-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.4); box-shadow: var(--shadow); overflow: hidden; }
.trip-cover { aspect-ratio: 16 / 9; background: var(--seat); }
.trip-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.trip-cover-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.trip-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 18px; }
.trip-title { font-family: var(--font-display); font-size: 20px; line-height: 1.5; }
.trip-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; }
.trip-thumb { width: 100%; max-width: 280px; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius); }
.trip-image-field { display: flex; flex-direction: column; gap: 10px; }

/* ---------- پرسش‌های پشت سر هم و سؤال‌های وابسته ---------- */
.q-list { display: flex; flex-direction: column; gap: 12px; }
.q-block { padding: 16px 18px; box-shadow: none; }
.q-block[hidden] { display: none; }
.q-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.q-no { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 13px; }
.q-title { font-weight: 700; line-height: 1.7; }

/* ---------- برنامه‌های مناسب شما ---------- */
.suggest-list { display: flex; flex-direction: column; gap: 12px; }
.suggest-item { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.2); }
.suggest-cover { flex: 0 0 108px; width: 108px; height: 72px; overflow: hidden; background: var(--seat); border-radius: var(--radius); }
.suggest-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.suggest-cover-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.suggest-body { flex: 1 1 auto; min-width: 0; }
.suggest-action { flex: 0 0 auto; }

@media (max-width: 720px) {
  .suggest-item { flex-wrap: wrap; }
  .suggest-cover { flex: 0 0 100%; width: 100%; height: 140px; }
  .suggest-action { width: 100%; }
  .suggest-action .btn { width: 100%; }
}
