/* =========================================================
   راهینو · پوسته flux (شیشه مشکی + لیمویی + بنفش)
   رنگ‌های برگه A4 (sheet-*) عمداً همان سربرگ رسمی قبلی مانده‌اند.
   ========================================================= */
:root {
  --lime: #d4f46b; --lime-d: #b9dc3c; --lav: #b3a4f5; --lav-d: #7e68e6;
  --ink: #1b1c17; --ink2: #26271f; --night: #0e0f0c;
  --bg: #e6e7e1; --card: #fbfbf8; --soft: #efefea; --chip: #e9eae3;
  --text: #1b1c17; --muted: #5c5d55; --line: #dcddd5;
  --danger: #b8322a; --ok: #2f7a3c; --warn: #8a5a00; --stamp: #2a3b9c;
  --sheet-navy: #0d2240; --sheet-amber: #f29a28;
  /* نام‌های قدیمی برای سازگاری */
  --navy: var(--ink); --navy2: var(--ink); --navy3: var(--lav-d); --amber: var(--lime); --amber-d: var(--lime-d);
  --radius: 22px; --pill: 999px;
  --shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 30px -18px rgba(27,28,23,.35);
  --mx: 80%; --my: 15%; --ang: 0deg;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: Vazirmatn, Tahoma, sans-serif; background: var(--night); color: var(--text); font-size: 15px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--lime); color: var(--ink); }
.boot { display: grid; place-items: center; height: 100vh; color: #a9aaa2; }
.ltr { direction: ltr; text-align: left; }
.num { font-feature-settings: "tnum"; }
.muted { color: var(--muted); }
.hidden { display: none !important; }
:focus-visible { outline: 2.5px solid var(--lav-d); outline-offset: 2px; }

/* ---------- صحنه و قاب شیشه‌ای ---------- */
.stage { position: relative; min-height: 100vh; padding: 20px; isolation: isolate; }
.aura { position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px circle at var(--mx) var(--my), rgba(179,164,245,.62), rgba(126,104,230,.22) 35%, transparent 65%),
    radial-gradient(780px circle at calc(100% - var(--mx)) calc(100% - var(--my)), rgba(212,244,107,.36), transparent 60%),
    var(--night); }
.glass { position: relative; isolation: isolate; border-radius: 34px; padding: 12px;
  background:
    radial-gradient(520px circle at var(--mx) var(--my), rgba(179,164,245,.8), rgba(126,104,230,.3) 40%, transparent 70%),
    radial-gradient(480px circle at calc(100% - var(--mx)) calc(100% - var(--my)), rgba(212,244,107,.5), transparent 65%),
    linear-gradient(145deg, rgba(255,255,255,.08), rgba(255,255,255,.02) 40%, rgba(0,0,0,.35)),
    rgba(16,17,14,.4);
  backdrop-filter: blur(28px) saturate(150%); -webkit-backdrop-filter: blur(28px) saturate(150%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), inset 0 -1px 0 rgba(0,0,0,.45), 0 40px 90px -30px rgba(0,0,0,.85); }
.glass::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none; z-index: -1;
  background: conic-gradient(from var(--ang) at var(--mx) var(--my), rgba(212,244,107,.9), rgba(179,164,245,.9) 25%, rgba(255,255,255,.08) 45%, rgba(255,255,255,.06) 70%, rgba(212,244,107,.9));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* ---------- ورود ---------- */
.auth { max-width: 1280px; margin: 0 auto; min-height: calc(100vh - 40px); display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand { color: #fff; padding: 40px 44px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; border-radius: 26px; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-brand h1 { font-size: clamp(48px, 6vw, 84px); line-height: 1.1; font-weight: 900; margin: 0; letter-spacing: -1px; }
.auth-brand p { color: rgba(255,255,255,.78); font-size: 17px; margin: 14px 0 0; max-width: 420px; }
.auth-brand .badge { display: inline-flex; gap: 8px; align-items: center; color: var(--ink); background: var(--lime); font-size: 14px; font-weight: 700; padding: 6px 14px; border-radius: var(--pill); }
.orbs { position: relative; height: 240px; margin: 24px 0; }
.orbs i { position: absolute; border-radius: 50%; border: 5px solid rgba(16,17,14,.6); animation: bob 7s ease-in-out infinite; }
.orbs .o1 { width: 210px; height: 210px; background: var(--lav); inset-inline-start: 4%; top: 0; }
.orbs .o2 { width: 150px; height: 150px; background: var(--ink); inset-inline-start: calc(4% + 180px); top: 40px; animation-delay: -2s; border-color: rgba(255,255,255,.12); }
.orbs .o3 { width: 120px; height: 120px; background: var(--lime); inset-inline-start: calc(4% + 120px); top: 150px; animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.road { position: absolute; inset-inline: 0; bottom: 22px; height: 4px; background: repeating-linear-gradient(90deg, var(--lime) 0 46px, transparent 46px 80px); opacity: .5; animation: road 2.6s linear infinite; }
@keyframes road { to { background-position: 80px 0; } }
@media (prefers-reduced-motion: reduce) { .road, .orbs i { animation: none; } }
.auth-form { display: grid; place-items: center; padding: 32px; background: var(--bg); border-radius: 26px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 30px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.3px; }
.auth-card .muted { margin: 0 0 28px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; min-height: 0; } .auth-brand { padding: 26px; } .orbs { display: none; } .auth-brand h1 { font-size: 44px; margin-top: 40px; } .auth-form { padding: 28px 20px; } }

/* ---------- فرم ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field .err { display: block; color: var(--danger); font-size: 14px; margin-top: 4px; font-weight: 500; font-style: normal; }
.field .hint { display: block; color: var(--muted); font-size: 14px; margin-top: 4px; font-style: normal; }
.input { width: 100%; height: 48px; border: 1.5px solid transparent; border-radius: 16px; background: #fff; padding: 0 16px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; box-shadow: 0 0 0 1px var(--line) inset; }
textarea.input { height: auto; padding: 12px 16px; resize: vertical; line-height: 1.9; }
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px rgba(179,164,245,.45); }
.input.bad { border-color: var(--danger); }
.input[readonly], .input:disabled { background: var(--soft); color: var(--muted); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: 22px 21px, 17px 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-start: 40px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--ink); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: var(--pill); border: 1.5px solid transparent; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s, transform .08s, box-shadow .15s; text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-amber { background: var(--lime); color: var(--ink); box-shadow: 0 8px 22px -12px rgba(185,220,60,.9); }
.btn-amber:hover { background: #def97f; }
.btn-ghost { background: var(--card); border-color: transparent; color: var(--text); box-shadow: 0 0 0 1px var(--line) inset; }
.btn-ghost:hover { background: #fff; }
.btn-danger { background: var(--card); border-color: #efc9c5; color: var(--danger); }
.btn-danger:hover { background: #fdf1f0; }
.btn-glass { background: rgba(255,255,255,.1); color: #fff; }
.btn-glass:hover { background: rgba(255,255,255,.18); }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 0; background: transparent; cursor: pointer; color: inherit; transition: background .15s; }
.icon-btn:hover { background: rgba(255,255,255,.1); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- پوسته ---------- */
.shell { display: flex; max-width: 1480px; margin: 0 auto; min-height: calc(100vh - 40px); }
.sidebar { width: 252px; flex: none; color: rgba(255,255,255,.8); padding: 16px 10px 10px; display: flex; flex-direction: column; position: sticky; top: 32px; height: calc(100vh - 64px); }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 26px; color: #fff; text-decoration: none; }
.brand-mark { width: 46px; height: 46px; border-radius: 50%; background: var(--lime); display: grid; place-items: center; color: var(--ink); flex: none; }
.brand-mark svg.i { width: 22px; height: 22px; }
.brand b { display: block; font-size: 18px; font-weight: 900; line-height: 1.4; }
.brand small { color: rgba(255,255,255,.7); font-size: 14px; }
.nav a { position: relative; display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 8px; border-radius: var(--pill); text-decoration: none; font-weight: 600; margin-bottom: 4px; transition: background .2s, color .2s; }
.nav-ic { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); transition: background .2s; }
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: var(--card); color: var(--ink); font-weight: 800; box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.nav a.on .nav-ic { background: var(--lime); }
.nav .sep { height: 1px; background: rgba(255,255,255,.08); margin: 12px 8px; }
.side-new { margin: 18px 0; }
.me { margin-top: auto; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.08); border-radius: 24px; padding: 10px; display: flex; align-items: center; gap: 8px; }
.me .av { width: 42px; height: 42px; border-radius: 50%; background: var(--lav); color: var(--ink); display: grid; place-items: center; font-weight: 900; flex: none; }
.me div { min-width: 0; flex: 1; }
.me b { display: block; color: #fff; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { font-size: 14px; color: rgba(255,255,255,.7); }
.me .icon-btn { width: 36px; height: 36px; color: rgba(255,255,255,.85); }
.main { flex: 1; min-width: 0; background: var(--bg); border-radius: 26px; position: relative; z-index: 1; }
.topbar { position: sticky; top: 20px; z-index: 20; border-radius: 26px 26px 0 0; background: rgba(230,231,225,.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.topbar-in { margin: 0 auto; height: 84px; display: flex; align-items: center; gap: 12px; padding: 0 30px; }
.topbar h1 { margin: 0; font-size: 28px; font-weight: 900; letter-spacing: -.4px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .date { color: var(--ink); background: var(--card); font-size: 14px; font-weight: 600; padding: 8px 16px; border-radius: var(--pill); box-shadow: 0 0 0 1px var(--line) inset; }
.topbar .icon-btn { background: var(--card); }
.topbar .icon-btn:hover { background: #fff; }
.content { margin: 0 auto; padding: 6px 30px 40px; }
.mobile-nav, .mobile-only { display: none !important; }
@media (max-width: 1000px) {
  .stage { padding: 8px; }
  .glass { padding: 6px; border-radius: 28px; }
  .shell { min-height: calc(100vh - 16px); }
  .sidebar { display: none; }
  .main { border-radius: 22px; }
  .topbar { top: 8px; border-radius: 22px 22px 0 0; }
  .topbar-in { height: 70px; padding-inline: 16px; }
  .topbar h1 { font-size: 22px; }
  .content { padding: 4px 14px 120px; }
  .topbar .date { display: none; }
  .mobile-only { display: grid !important; }
  .mobile-nav { display: flex !important; position: fixed; inset-inline: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 30; padding: 6px; gap: 4px; border-radius: var(--pill);
    background: rgba(20,21,17,.72); backdrop-filter: blur(20px) saturate(150%); -webkit-backdrop-filter: blur(20px) saturate(150%); box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 20px 40px -16px rgba(0,0,0,.7); }
  .mobile-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 7px 0; border-radius: var(--pill); text-decoration: none; color: rgba(255,255,255,.75); font-size: 14px; font-weight: 700; }
  .mobile-nav a.on { color: var(--ink); background: var(--lime); }
}

/* ---------- کارت‌ها و جدول ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.map-card { padding: 18px; margin-bottom: 14px; }
.map-legend { display: flex; gap: 18px; align-items: center; color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-inline-end: 5px; }
.legend-dot.live { background: var(--lime-d); box-shadow: 0 0 0 4px rgba(185,220,60,.18); }
.legend-dot.stale { background: #aaa; }
.fleet-map { min-height: 390px; position: relative; overflow: hidden; border-radius: 18px; background: #dfe4dc; isolation: isolate; }
.map-grid { position: absolute; inset: 0; opacity: .35; background: linear-gradient(28deg, transparent 48%, #b7c6b8 49% 51%, transparent 52%), linear-gradient(116deg, transparent 48%, #c4d0c6 49% 51%, transparent 52%), repeating-linear-gradient(90deg, transparent 0 82px, rgba(255,255,255,.6) 83px 85px), repeating-linear-gradient(0deg, transparent 0 72px, rgba(255,255,255,.55) 73px 75px); }
.map-road { position: absolute; height: 16px; border-radius: 999px; background: #f8faf5; box-shadow: 0 0 0 2px rgba(160,177,163,.4); transform: rotate(-18deg); z-index: 1; }
.road-a { width: 120%; left: -10%; top: 48%; }
.road-b { width: 90%; left: 5%; top: 32%; transform: rotate(28deg); }
.map-pin { position: absolute; z-index: 3; width: 40px; height: 40px; margin: -20px 0 0 -20px; border: 4px solid var(--card); border-radius: 50%; display: grid; place-items: center; color: var(--ink); cursor: pointer; box-shadow: 0 5px 14px rgba(27,28,23,.22); }
.map-pin.live { background: var(--lime); }
.map-pin.stale { background: #b6b8b0; color: #4d4e48; }
.map-pin:hover { transform: scale(1.08); }
.map-pin svg.i { width: 18px; height: 18px; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); z-index: 2; }
.card > .table-wrap { overflow-x: auto; }
.t small { display: block; margin-top: 2px; }
.error-state { min-height: 180px; display: grid; place-items: center; align-content: center; gap: 8px; text-align: center; padding: 28px; }
.error-state p { margin: 0; color: var(--muted); }
.card.dark { background: var(--ink); color: #fff; }
.pad { padding: 22px; }
.card h3 { margin: 0 0 16px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.card h3 > svg.i { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--chip); }
.card.dark h3 > svg.i { background: rgba(255,255,255,.1); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.toolbar .grow { flex: 1; min-width: 220px; position: relative; }
.toolbar .grow svg.i { position: absolute; inset-inline-start: 16px; top: 15px; color: var(--muted); }
.toolbar .grow .input { padding-inline-start: 44px; border-radius: var(--pill); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; background: var(--card); padding: 4px; border-radius: var(--pill); box-shadow: 0 0 0 1px var(--line) inset; }
.chip { height: 38px; padding: 0 16px; border-radius: var(--pill); border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: 14px; color: var(--muted); transition: background .15s, color .15s; }
.chip:hover { color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; min-width: 760px; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.t th { text-align: right; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; background: transparent; }
table.t td { padding: 13px 16px; border-bottom: 1px solid #ebebe5; vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #f3f4ee; }
.card.dark table.t th { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.1); }
.card.dark table.t td { border-color: rgba(255,255,255,.07); }
.card.dark table.t tr.click:hover td { background: rgba(255,255,255,.05); }
.card.dark .muted { color: rgba(255,255,255,.65); }
.actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: var(--pill); font-size: 14px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.draft { background: #ece8fd; color: #4b36b8; }
.pill.final { background: var(--lime); color: var(--ink); }
.pill.void { background: #f6e1df; color: var(--danger); }
.pill.role { background: var(--chip); color: var(--ink); }
.pill.role::before { display: none; }

/* پلاک ایرانی */
.plate { display: inline-flex; direction: ltr; unicode-bidi: isolate; align-items: stretch; border: 1.5px solid #1b1b1b; border-radius: 5px; overflow: hidden; background: #fff; color: #111; font-weight: 800; font-size: 14px; line-height: 1; height: 28px; white-space: nowrap; }
.plate .ir { width: 9px; background: #1d4ea8; }
.plate .main { direction: ltr; unicode-bidi: isolate; display: flex; align-items: center; gap: 5px; padding: 0 7px; background: transparent; border-radius: 0; }
.plate .reg { border-left: 1.5px solid #1b1b1b; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 6px; font-size: 14px; }
.plate .reg small { font-size: 8px; font-weight: 700; }
.plate-in { display: flex; direction: ltr; gap: 6px; align-items: center; }
.plate-in .input { text-align: center; padding: 0 6px; }
.plate-in .a { width: 62px; } .plate-in .l { width: 82px; } .plate-in .b { width: 78px; } .plate-in .r { width: 62px; }
.plate-in .ir-l { font-size: 14px; color: var(--muted); font-weight: 700; }

/* داشبورد (bento) */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-head h2 { margin: 0; font-size: clamp(30px, 3.4vw, 44px); font-weight: 900; letter-spacing: -.8px; line-height: 1.2; }
.page-head p { margin: 4px 0 0; }
.page-actions { margin-inline-start: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.c-head { display: flex; align-items: center; gap: 10px; }
.c-head h3 { margin: 0; }
.c-ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--chip); flex: none; }
.card.dark .c-ic { background: rgba(255,255,255,.1); }
.c-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bento { display: grid; gap: 12px; margin-bottom: 12px; grid-template-columns: 1.15fr 1fr 1fr; grid-template-areas: "dest a b" "dest ring ring"; }
.b-dest { grid-area: dest; display: flex; flex-direction: column; }
.b-ring { grid-area: ring; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; }
.bento > .stat:nth-of-type(2) { grid-area: a; } .bento > .stat:nth-of-type(3) { grid-area: b; }
.stat b { display: block; font-size: 46px; font-weight: 900; line-height: 1.1; margin-top: auto; padding-top: 22px; letter-spacing: -1px; }
.stat > span { color: var(--muted); font-size: 14px; font-weight: 600; }
.stat.lav { background: var(--lav); }
.stat.lav .c-ic { background: rgba(255,255,255,.45); }
.stat.lav > span { color: rgba(27,28,23,.78); }
.big { display: flex; align-items: baseline; gap: 8px; margin: 18px 0 22px; }
.big b { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.big span { color: var(--muted); font-size: 14px; }
.dest-bars { display: grid; gap: 16px; margin-top: auto; }
.dest-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.dest-top span { display: inline-flex; align-items: center; gap: 8px; }
.dest-top b { font-size: 20px; font-weight: 800; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dest-bar .track { height: 10px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.dest-bar .fill { height: 100%; border-radius: 99px; animation: grow .9s cubic-bezier(.2,.8,.2,1) both; transform-origin: right; }
@keyframes grow { from { transform: scaleX(0); } }
.lime { background: var(--lime); } .lav { background: var(--lav); } .ink { background: var(--ink); }
.ring-row { display: flex; align-items: center; gap: 20px; margin-top: 16px; }
.ring-row b { display: block; font-size: 26px; font-weight: 900; }
.ring { --p: 0; width: 104px; height: 104px; border-radius: 50%; flex: none; display: grid; place-items: center; background: conic-gradient(var(--ink) calc(var(--p) * 1%), var(--chip) 0); position: relative; }
.ring::after { content: ""; position: absolute; inset: 13px; border-radius: 50%; background: var(--card); }
.ring span { position: relative; z-index: 1; font-weight: 900; font-size: 20px; }
@media (max-width: 1180px) { .bento { grid-template-columns: 1fr 1fr; grid-template-areas: "a b" "dest dest" "ring ring"; } }
@media (max-width: 600px) { .bento { grid-template-columns: 1fr 1fr; } .stat b, .big b { font-size: 36px; } }

/* ویرایشگر نامه */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: 18px; align-items: start; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; align-items: center; }
.editor-actions .spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }
.picker { max-height: 360px; overflow: auto; border-radius: 18px; background: var(--soft); padding: 4px; }
.pick { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 14px; cursor: pointer; transition: background .15s; }
.pick + .pick { margin-top: 2px; }
.pick:hover { background: #fff; }
.pick.on { background: #f2fbd2; box-shadow: 0 0 0 1.5px var(--lime-d) inset; }
.pick input { accent-color: var(--ink); width: 18px; height: 18px; }
.pick b { display: block; font-size: 14px; }
.pick small { color: var(--muted); font-size: 14px; }
.preview-col { position: sticky; top: 124px; }
.preview-frame { background: var(--ink); border-radius: var(--radius); padding: 16px; overflow: hidden; background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 9px); }
.preview-scale { transform-origin: top right; }
.lock-note { display: flex; gap: 10px; align-items: center; background: var(--lime); color: var(--ink); padding: 12px 18px; border-radius: var(--pill); font-weight: 700; margin-bottom: 16px; }
.lock-note.void { background: #f6e1df; color: var(--danger); }
.seg { display: none; }
@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .preview-col { position: static; }
  .seg { display: flex; background: var(--card); border-radius: var(--pill); padding: 4px; margin-bottom: 14px; box-shadow: 0 0 0 1px var(--line) inset; }
  .seg button { flex: 1; height: 42px; border: 0; border-radius: var(--pill); background: transparent; font-weight: 700; cursor: pointer; color: var(--muted); }
  .seg button.on { background: var(--ink); color: #fff; }
  .editor.show-preview .form-col { display: none; }
  .editor:not(.show-preview) .preview-col { display: none; }
}

/* ---------- برگه A4 ---------- */
.sheet { width: 210mm; height: 297mm; background: #fff; color: #111; position: relative; overflow: hidden; direction: rtl; font-size: 13.5pt; line-height: 2.05; box-shadow: 0 10px 30px -10px rgba(0,0,0,.35); }
.sheet.f-vazir { font-family: Vazirmatn, Tahoma, sans-serif; font-size: 12.5pt; }
.sheet.f-naskh { font-family: "Noto Naskh Arabic", serif; }
.sheet.f-amiri { font-family: Amiri, serif; }
.sheet.f-markazi { font-family: "Markazi Text", serif; font-size: 15pt; }
.sheet.f-scheherazade { font-family: "Scheherazade New", serif; font-size: 15pt; }
.sheet .lh-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sheet .lh { position: absolute; top: 0; inset-inline: 0; height: 40mm; padding: 10mm 16mm 0; display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 1.2mm solid var(--sheet-navy); }
.sheet .lh::after { content: ""; position: absolute; inset-inline: 0; bottom: -2.6mm; height: .8mm; background: var(--sheet-amber); }
.sheet .lh .co { font-family: Vazirmatn, sans-serif; }
.sheet .lh .co b { display: block; font-size: 21pt; font-weight: 900; color: var(--sheet-navy); line-height: 1.3; }
.sheet .lh .co small { font-size: 10pt; color: #444; font-weight: 600; }
.sheet .meta { position: absolute; top: 12mm; left: 16mm; font-family: Vazirmatn, sans-serif; font-size: 10.5pt; line-height: 2; }
.sheet .meta div { display: flex; gap: 3mm; }
.sheet .meta span { color: #555; min-width: 13mm; }
.sheet .meta b { font-weight: 700; }
.sheet .body { position: absolute; top: 50mm; inset-inline: 18mm; bottom: 22mm; display: flex; flex-direction: column; }
.sheet .to { font-weight: 700; margin: 0; }
.sheet p { margin: 0; }
.sheet .subj { font-weight: 700; margin: 2mm 0; }
.sheet .text { white-space: pre-line; text-align: justify; margin-top: 2mm; }
.sheet table { width: 100%; border-collapse: collapse; margin: 4mm 0; font-family: Vazirmatn, sans-serif; font-size: 9.5pt; line-height: 1.6; }
.sheet th { background: #eef1f6; font-weight: 800; }
.sheet th, .sheet td { border: .3mm solid #555; padding: 1.4mm 1.6mm; text-align: center; }
.sheet.dense table { font-size: 8.5pt; }
.sheet.dense th, .sheet.dense td { padding: .8mm 1.2mm; }
.sheet .coord { font-size: 11pt; margin-top: 2mm; }
.sheet .sign { margin-top: auto; align-self: flex-end; margin-left: -8mm; width: 66mm; text-align: center; font-family: Vazirmatn, sans-serif; line-height: 1.7; }
.sheet .sign b { display: block; font-size: 12pt; }
.sheet .sign small { font-size: 10.5pt; }
.sheet .sign .imgs { position: relative; height: 30mm; }
.sheet .sign .stamp { position: absolute; left: 4mm; top: 0; width: 30mm; height: 30mm; object-fit: contain; transform: rotate(-10deg); mix-blend-mode: multiply; }
.sheet .sign .signature { position: absolute; right: 6mm; top: 6mm; width: 34mm; height: 20mm; object-fit: contain; mix-blend-mode: multiply; }
.sheet .foot { position: absolute; bottom: 0; inset-inline: 0; height: 16mm; background: var(--sheet-navy); color: #dfe7f3; font-family: Vazirmatn, sans-serif; font-size: 9pt; display: flex; align-items: center; justify-content: center; gap: 6mm; }
.sheet .wm { position: absolute; top: 45%; left: 50%; transform: translate(-50%, -50%) rotate(-28deg); font-family: Vazirmatn, sans-serif; font-size: 70pt; font-weight: 900; color: rgba(184,50,42,.09); white-space: nowrap; pointer-events: none; }
.sheet .wm.draft { color: rgba(168,100,0,.08); }

/* ---------- کشو و پنجره ---------- */
.overlay { position: fixed; inset: 0; background: rgba(8,9,6,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 50; display: flex; justify-content: flex-start; padding: 10px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.drawer { width: min(480px, 100%); height: 100%; background: var(--bg); display: flex; flex-direction: column; animation: slide .22s ease-out; border-radius: 28px; overflow: hidden; box-shadow: 0 30px 80px -20px rgba(0,0,0,.7); }
@keyframes slide { from { transform: translateX(-30px); opacity: .4; } }
.drawer-head { background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; }
.drawer-head h2 { margin: 0; font-size: 19px; font-weight: 900; }
.drawer-body { flex: 1; overflow: auto; padding: 20px; }
.drawer-foot { display: flex; gap: 10px; padding: 14px 20px; background: var(--card); }
.dialog-wrap { position: fixed; inset: 0; background: rgba(8,9,6,.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 60; display: grid; place-items: center; padding: 16px; animation: fade .15s; }
.dialog { background: var(--card); border-radius: 28px; width: min(440px, 100%); padding: 26px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.5); }
.dialog h3 { margin: 0 0 8px; font-size: 20px; font-weight: 900; }
.dialog p { margin: 0 0 16px; color: var(--muted); }
.dialog .row { display: flex; gap: 10px; justify-content: flex-start; margin-top: 8px; }
.secret { font-family: ui-monospace, monospace; background: var(--soft); padding: 12px; border-radius: 16px; direction: ltr; text-align: center; font-size: 17px; letter-spacing: 1px; user-select: all; }

#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; }
.toast { background: rgba(20,21,17,.9); backdrop-filter: blur(14px); color: #fff; padding: 11px 20px; border-radius: var(--pill); font-weight: 700; box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 14px 30px -12px rgba(0,0,0,.6); animation: fade .2s; max-width: 90vw; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--lime); color: var(--ink); }

.upl { display: grid; gap: 10px; }
.upl .box { aspect-ratio: 1 / 1; border: 2px dashed #c9cac0; border-radius: 20px; display: grid; place-items: center; background: var(--soft); overflow: hidden; color: var(--muted); font-size: 14px; text-align: center; padding: 10px; }
.upl .box.tall { aspect-ratio: 1 / 1.414; }
.upl .box img { width: 100%; height: 100%; object-fit: contain; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.imgs3 { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 14px; }
@media (max-width: 900px) { .settings-grid { grid-template-columns: 1fr; } }

#print-root { display: none; }
@page { size: A4; margin: 0; }
@media print {
  body { background: #fff; }
  .stage, .aura { display: none !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; }
  #print-root .sheet { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
