/* =====================================================
   مدیریت باشگاه — سیستم طراحی «کارت و مهر»
   زبان بصری: کارت عضویت چاپی، مرز جوهری، بارکد، مهر ورود/خروج
   ===================================================== */

/* ---------- فونت ---------- */
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-Bold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-ExtraBold.woff2') format('woff2'); font-weight: 800; font-display: swap; }
@font-face { font-family: 'Vazirmatn'; src: url('fonts/Vazirmatn-Black.woff2') format('woff2'); font-weight: 900; font-display: swap; }

/* ---------- توکن‌ها ---------- */
:root {
  --bg: #F3F5F8;
  --bg2: #E7EBF1;
  --surface: #FFFFFF;
  --ink: #101C2E;
  --ink2: #5B6B83;
  --line: #D4DCE6;
  --card-border: rgba(16, 28, 46, .82);
  --accent: #FF4D1F;
  --accent-press: #D93D12;
  --on-accent: #FFFFFF;
  --in: #0E8A5C;
  --in-bg: rgba(14, 138, 92, .09);
  --out: #C93333;
  --out-bg: rgba(201, 51, 51, .09);
  --warn: #B45309;
  --warn-bg: rgba(245, 158, 11, .13);
  --r-card: 16px;
  --r-btn: 12px;
  --r-chip: 9px;
  --notch-bg: var(--bg);
  --font: 'Vazirmatn', system-ui, sans-serif;
  /* پلکان سایه — عمق نرم جهانی + امضای فیزیکی خود اپ */
  --sh-1: 0 1px 2px rgba(16, 28, 46, .05), 0 2px 8px rgba(16, 28, 46, .05);
  --sh-2: 0 2px 6px rgba(16, 28, 46, .07), 0 10px 28px rgba(16, 28, 46, .09);
  --sh-3: 0 4px 12px rgba(16, 28, 46, .10), 0 24px 64px rgba(16, 28, 46, .16);
  --sh-accent: 0 6px 18px rgba(255, 77, 31, .28), 0 2px 6px rgba(255, 77, 31, .18);
}
[data-theme="dark"] {
  --bg: #0A1626;
  --bg2: #0E1C31;
  --surface: #14233B;
  --ink: #E9EEF6;
  --ink2: #8CA0BE;
  --line: #263C5C;
  --card-border: #40587C;
  --accent: #FF5A26;
  --accent-press: #FF7A50;
  --in: #33C18C;
  --in-bg: rgba(51, 193, 140, .12);
  --out: #FF6B6B;
  --out-bg: rgba(255, 107, 107, .12);
  --warn: #FBBF24;
  --warn-bg: rgba(251, 191, 36, .13);
  --sh-1: 0 1px 2px rgba(2, 8, 20, .4), 0 2px 10px rgba(2, 8, 20, .35);
  --sh-2: 0 2px 8px rgba(2, 8, 20, .45), 0 12px 32px rgba(2, 8, 20, .45);
  --sh-3: 0 4px 14px rgba(2, 8, 20, .5), 0 28px 72px rgba(2, 8, 20, .6);
  --sh-accent: 0 6px 18px rgba(255, 90, 38, .30), 0 2px 6px rgba(255, 90, 38, .20);
}

/* ---------- پایه (طبق اسکیل mobile-native) ---------- */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overscroll-behavior: none;
  /* v55b: هیچ سرریز افقی حق اسکرول‌خوردن ندارد — باگ گوشی‌های RTL (شیفت کل رابط با اسکرول گیرکرده) */
  overflow-x: clip;
}
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  text-align: start;
  overflow-x: clip;
}
input, textarea, select { font-size: 16px; font-family: var(--font); }
button, a, [role="button"] { touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover, .chip:hover, .tile:hover, .member-row:hover, .mtable-row:hover, .ibtn:hover { filter: brightness(1.03); }
}
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
b { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* اسکرول‌بار ظریف — استاندارد اپ‌های دسکتاپی */
@supports (-webkit-touch-callout: none) or (scrollbar-width: thin) {
  * { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--ink2); }
::selection { background: rgba(255, 77, 31, .25); }

.ic { width: 20px; height: 20px; flex: none; }
.ic.big { width: 34px; height: 34px; }

/* ---------- اجزای امضایی: پانچ، بارکد، مهر ---------- */
.notch {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--notch-bg);
  border: 1.5px solid var(--card-border);
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.notch-r { right: -9px; }
.notch-l { left: -9px; }
.sheet .notch { --notch-bg: var(--surface); }

.barcode {
  height: 22px;
  margin-top: 16px;
  border-radius: 4px;
  background:
    repeating-linear-gradient(90deg,
      var(--ink) 0 2px, transparent 2px 5px,
      var(--ink) 5px 6px, transparent 6px 12px,
      var(--ink) 12px 15px, transparent 15px 17px,
      var(--ink) 17px 18px, transparent 18px 24px),
    repeating-linear-gradient(90deg,
      transparent 0 3px, var(--ink) 3px 3.6px, transparent 3.6px 9px);
  opacity: .8;
}

.stampchip {
  display: inline-block;
  font: 700 12px var(--font);
  padding: 3px 10px;
  border: 2px solid currentColor;
  border-radius: 7px;
  white-space: nowrap;
}
.stampchip.is-in { color: var(--in); background: var(--in-bg); }
.stampchip.is-out { color: var(--out); background: var(--out-bg); }
.stampchip.is-muted { color: var(--ink2); }

.stamp {
  font: 900 44px var(--font);
  padding: 8px 34px;
  border: 4px solid currentColor;
  border-radius: 12px;
  position: relative;
  opacity: 0;
}
.stamp::after {
  content: '';
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: 8px;
  opacity: .45;
}
.stamp.st-in { color: var(--in); }
.stamp.st-out { color: var(--out); }

/* ---------- دکمه‌ها ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: var(--r-btn);
  font: 700 15px var(--font);
  border: 1.5px solid var(--card-border);
  cursor: pointer;
  transition: transform .1s ease-out, box-shadow .1s ease-out, background .12s;
  min-height: 46px;
}
.btn:active { transform: translateY(2px); }
.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: var(--sh-accent);
}
.btn-primary:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(255, 77, 31, .22); }
.btn-ghost { background: var(--surface); color: var(--ink); }
.btn-danger { background: var(--surface); color: var(--out); border-color: var(--out); }

.btn-block { width: 100%; }
.btn.small { padding: 8px 12px; font-size: 13px; min-height: 38px; }
.btn-fab {
  position: fixed;
  bottom: calc(16px + env(safe-area-inset-bottom));
  inset-inline: 14px;
  z-index: 40;
  box-shadow: var(--sh-accent);
}

.ibtn {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  position: relative;
  transition: transform .1s;
}
.ibtn:active { transform: scale(.93); }
.ibtn.small { width: 34px; height: 34px; border-radius: 12px; }

/* ---------- ورود ---------- */
.view {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: calc(20px + env(safe-area-inset-top)) 18px calc(20px + env(safe-area-inset-bottom));
}
.login-wrap { width: min(420px, 100%); }
.login-card {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 24px 22px 18px;
}
.login-stamp {
  display: inline-block;
  font: 800 12px var(--font);
  color: var(--accent);
  border: 2.5px solid currentColor;
  border-radius: 12px;
  padding: 4px 13px;
}
.login-title { font: 900 24px var(--font); margin: 14px 0 4px; }
.login-sub { font: 500 13px var(--font); color: var(--ink2); margin: 0; }
.login-form { margin-top: 14px; }
.login-error { color: var(--out); font: 600 13px var(--font); min-height: 20px; margin: 6px 0 0; }
.login-foot { text-align: center; font: 500 12px var(--font); color: var(--ink2); margin-top: 16px; }

/* ---------- فرم‌ها ---------- */
.f-label { display: block; font: 600 12px var(--font); color: var(--ink2); margin: 14px 4px 6px; }
.f-input, .f-select {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--surface);
  color: var(--ink);
  font: 500 16px var(--font);
  transition: border-color .15s, box-shadow .15s;
}
/* فیلد فیلتر اعضا: جهت خودکار تا شماره موبایل هم درست تایپ شود */
.f-input[dir="auto"] { text-align: start; }
/* فلش سلکت داخل قاب، سمت چپ (RTL) */
.f-select {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238A8F98' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
}
.daterow .f-select { background-position: left 8px center; padding-inline-end: 26px; }
[dir="rtl"] .f-select { background-position: left 12px center; }
.f-input:focus, .f-select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--in-bg);
}
.f-select.narrow { width: auto; }
.f-hint { font: 500 12px var(--font); color: var(--ink2); line-height: 1.9; margin: 8px 4px; }
.f-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* فیلدهای تاریخ (شروع/پایان دوره) در موبایل زیر هم می‌آیند تا کشوی سال «۱۴۰۵» کامل دیده شود */
.f-row2-dates { grid-template-columns: 1fr; }
@media (min-width: 700px) { .f-row2-dates { grid-template-columns: 1fr 1fr; } }
.form { padding-bottom: 8px; }
.daterow { display: grid; grid-template-columns: 1.15fr 1.25fr .85fr; gap: 8px; }
.daterow .f-select { padding: 10px 6px; font-size: 13px; text-align: center; text-align-last: center; }

.seg {
  display: flex;
  border: 1.5px solid var(--line);
  border-radius: var(--r-btn);
  overflow: hidden;
  background: var(--surface);
}
.seg-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 8px;
  font: 700 13px var(--font);
  background: transparent;
  color: var(--ink2);
  border: none;
  border-inline-start: 1.5px solid var(--line);
  cursor: pointer;
  position: relative;
}
.seg-btn:first-child { border-inline-start: none; }
.seg-btn.active { background: var(--ink); color: var(--bg); }
.seg-btn:has(input:checked) { background: var(--ink); color: var(--bg); }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }

.checkline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--line);
  font: 600 14px var(--font);
}
.checkline input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--accent); }

/* ---------- نوار بالا ---------- */
#shell { min-height: 100dvh; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1.5px solid var(--card-border);
}
.brand { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.brand > b { font: 800 16px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font: 500 12px var(--font); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; }

.syncdot svg { transition: color .2s; }
.syncdot[data-state="idle"] svg { color: var(--in); }
.syncdot[data-state="syncing"] svg { color: var(--accent); animation: spin 1s linear infinite; }
.syncdot[data-state="offline"] svg { color: var(--ink2); }
.syncdot[data-state="error"] svg { color: var(--out); }
@keyframes spin { to { transform: rotate(360deg); } }
.pendingbadge {
  display: none;
  position: absolute;
  top: -5px;
  inset-inline-start: -5px;
  background: var(--accent);
  color: var(--on-accent);
  font: 700 11px var(--font);
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  place-items: center;
  padding: 0 5px;
}
.pendingbadge.show { display: grid; }

/* ---------- صفحات ---------- */
#pages {
  flex: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 14px calc(30px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}
.page { display: none; }
.page.active { display: block; }
.page.pop { animation: pageIn .22s cubic-bezier(.2, .9, .3, 1); }
@keyframes pageIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.searchline {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-btn);
  padding: 10px 13px;
  color: var(--ink2);
}
.search-input { flex: 1; border: none; background: transparent; color: var(--ink); font: 500 15px var(--font); }
.search-input:focus { outline: none; }
.filterline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filterline .f-select { max-width: 170px; }
.hist-count { font: 600 12px var(--font); color: var(--ink2); margin: 0 4px 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: var(--r-chip);
  border: 1.5px solid var(--line);
  background: var(--surface);
  font: 600 13px var(--font);
  color: var(--ink2);
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
}
.chip:active { transform: scale(.96); }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: 0 3px 10px rgba(255, 77, 31, .22); }
.chip-dark { background: rgba(0,0,0,.4); border-color: rgba(255,255,255,.45); color: #fff; }
.chip-dark.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: none; }

.sec-head { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.sec-title { font: 800 14px var(--font); margin: 4px 2px 10px; }

/* ---------- درب ورودی ---------- */
.gate-dock {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 14px;
}
.gate-scan {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 20px;
  background: var(--accent);
  color: var(--on-accent);
  border: 1.5px solid var(--card-border);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: var(--sh-accent);
  transition: transform .1s ease-out, box-shadow .1s ease-out;
  text-align: start;
}
.gate-scan:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(255, 77, 31, .22); }
.gate-scan-txt { display: flex; flex-direction: column; gap: 3px; }
.gate-scan-txt b { font: 800 17px var(--font); }
.gate-scan-txt i { font: 500 12px var(--font); font-style: normal; opacity: .85; }
.gate-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
#btn-nfc.active { border-color: var(--in); color: var(--in); box-shadow: inset 0 0 0 1.5px var(--in); }

.ministat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.gstat {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.gstat b { font: 900 22px var(--font); font-variant-numeric: tabular-nums; }
.gstat span { font: 500 12px var(--font); color: var(--ink2); }
.gstat-in b { color: var(--in); }
.gstat-out b { color: var(--out); }

/* ---------- فید و دفتر ---------- */
.feed { display: flex; flex-direction: column; }
.feed-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px dashed var(--line);
}
.feed-name { flex: 1; font: 600 14px var(--font); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-code { font: 600 12px var(--font); color: var(--ink2); }
.feed-t { font: 700 13px var(--font); font-variant-numeric: tabular-nums; }
.feed-m {
  font: 600 11px var(--font);
  color: var(--ink2);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 6px;
}
.day-head { font: 700 12px var(--font); color: var(--ink2); margin-top: 14px; padding: 0 4px 2px; }

.ledger { display: flex; flex-direction: column; }
.ledger-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--line);
}
.lr-date { font: 500 12px var(--font); color: var(--ink2); width: 105px; flex: none; }
.lr-name { flex: 1; font: 600 14px var(--font); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-note { font: 500 12px var(--font); color: var(--ink2); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-amt { font: 800 14px var(--font); font-variant-numeric: tabular-nums; }

/* ---------- اعضا (v21 — کارت‌های تمام‌عرض) ---------- */
.list { display: flex; flex-direction: column; }
/* ردیف ساده — صفحهٔ ثبت‌نام (آخرین ثبت‌نام‌ها) */
.member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  margin-bottom: 10px;
  cursor: pointer;
  text-align: start;
  font-family: var(--font);
  transition: transform .1s;
}
.member-row:active { transform: scale(.985); }
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--bg2);
  border: 1.5px solid var(--line);
  display: grid;
  place-items: center;
  font: 800 14px var(--font);
  color: var(--ink2);
  flex: none;
}
.mr-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mr-main b { font: 700 15px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mr-sub { font: 500 12px var(--font); color: var(--ink2); }
.mr-end {
  font: 700 12px var(--font);
  padding: 4px 10px;
  border-radius: 8px;
  border: 1.5px solid currentColor;
  flex: none;
}
.mr-end.is-in { color: var(--in); background: var(--in-bg); }
.mr-end.is-out { color: var(--out); background: var(--out-bg); }
.mr-end.is-muted { color: var(--ink2); }
.mr-end.is-soon { color: #B45309; background: rgba(245, 158, 11, .13); }
[data-theme="dark"] .mr-end.is-soon { color: #FBBF24; }

/* نوار ابزار اعضا: دکمهٔ عضو جدید + جستجو */
.members-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.members-toolbar #btn-member-new { flex: none; }
.members-toolbar .searchline { flex: 1 1 210px; min-width: 180px; }

/* شاخص‌های کوچک فیلترکننده — کوچک‌تر و کاربردی‌تر */
.mstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi-mini {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  min-width: 0;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 9px 10px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s, transform .1s;
}
.kpi-mini .ic { width: 15px; height: 15px; flex: none; color: var(--ink2); }
.kpi-mini b { font: 800 15px/1 var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-mini span { font: 600 11px var(--font); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-mini.is-in .ic { color: var(--in); }
.kpi-mini.is-warn .ic { color: #D97706; }
[data-theme="dark"] .kpi-mini.is-warn .ic { color: #F5A524; }
.kpi-mini.is-out .ic { color: var(--out); }
.kpi-mini.on { border-color: var(--accent); box-shadow: 0 0 0 1.5px var(--accent) inset; }
.kpi-tap { cursor: pointer; font-family: var(--font); transition: border-color .15s, transform .1s; }
.kpi-tap:active { transform: scale(.97); }
@media (max-width: 430px) { .mstats { grid-template-columns: repeat(2, 1fr); } }

/* آواتار وضعیت‌دار (جدول اعضا) */
.mc-avatar.is-in { border-color: var(--in); color: var(--in); background: var(--in-bg); }
.mc-avatar.is-out { border-color: var(--out); color: var(--out); background: var(--out-bg); }
.mc-avatar.is-soon { border-color: #D97706; color: #B45309; background: rgba(245, 158, 11, .12); }
[data-theme="dark"] .mc-avatar.is-soon { color: #FBBF24; }

/* ===== جدول اعضا — مثل اکسل: سرستون مرتب‌سازی + فیلتر هر ستون ===== */
.mtable-wrap { overflow-x: auto; padding-bottom: 4px; }
.mtable { min-width: 920px; }
.mtable-head {
  display: grid;
  grid-template-columns: minmax(140px, 1.35fr) 52px minmax(88px, .85fr) minmax(86px, .8fr) 100px 72px 108px 88px minmax(126px, auto);
  gap: 0 8px;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 8px;
  box-shadow: var(--sh-1);
}
.mth { display: flex; align-items: center; gap: 3px; min-width: 0; font: 700 12px var(--font); color: var(--ink2); }
.mth-sort {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; color: inherit;
  font: 700 12px var(--font);
  cursor: pointer; padding: 4px 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mth-sort.plain { cursor: default; }
.mth-sort:hover { color: var(--ink); }
.mth-sort.on { color: var(--accent); }
.mth-ind { display: inline-flex; }
.mth-ind .ic { width: 11px; height: 11px; opacity: .4; transform: rotate(90deg); }
.mth-ind.desc .ic { transform: rotate(-90deg); }
.mth-sort.on .mth-ind .ic { opacity: 1; }
.mth-filter { background: none; border: none; color: inherit; cursor: pointer; padding: 4px; border-radius: 6px; display: inline-flex; flex: none; }
.mth-filter .ic { width: 12px; height: 12px; }
.mth-filter:hover { background: var(--bg2); color: var(--ink); }
.mth-filter.on { color: var(--accent); background: rgba(255, 77, 31, .1); }
.mtable-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(140px, 1.35fr) 52px minmax(88px, .85fr) minmax(86px, .8fr) 100px 72px 108px 88px minmax(126px, auto);
  gap: 0 8px;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 9px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color .15s, box-shadow .18s, transform .1s;
  box-shadow: var(--sh-1);
}
.mtable-row:hover { border-color: var(--accent); box-shadow: var(--sh-2); }
.mtable-row:active { transform: scale(.995); }
.mtable-row.open-qa { z-index: 40; }
.mtd { min-width: 0; font: 600 12px var(--font); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtd-num { font-variant-numeric: tabular-nums; }
.mtd-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mtd-name .avatar { flex: none; width: 34px; height: 34px; font-size: 12px; }
.mt-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mt-name b { font: 800 13px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mtd-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-start; cursor: default; }
.mtd-actions .ibtn { width: 34px; height: 34px; flex: none; }
.mtd-actions .ibtn .ic { width: 16px; height: 16px; }
.mtd-actions .ibtn.primary-act { color: var(--accent); border-color: var(--accent); background: rgba(255, 77, 31, .06); }
.mtd-actions .ibtn.primary-act:hover { background: rgba(255, 77, 31, .14); }

/* دکمه‌های پرکاربرد */
.mbtn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--bg2);
  color: var(--ink);
  font: 700 12px var(--font);
  cursor: pointer;
  text-decoration: none;
  transition: transform .1s;
}
.mbtn .ic { width: 14px; height: 14px; }
.mbtn:active { transform: scale(.95); }
.mbtn-more {
  background: rgba(255, 77, 31, .09);
  border-color: rgba(255, 77, 31, .45);
  color: var(--accent);
}
[data-theme="dark"] .mbtn-more { background: rgba(255, 90, 38, .14); }

/* منوی «عملیات سریع» — popover بدنهٔ صفحه، دقیقاً زیر خودِ دکمه؛ با هر اسکرول جابه‌جا می‌شود */
.qa-wrap { position: relative; display: inline-flex; }
#qa-pop {
  position: fixed;
  width: 268px;
  max-width: calc(100vw - 16px);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(8, 16, 30, .28);
  padding: 6px;
  z-index: 900;
  font-family: var(--font);
  animation: qadrop .16s ease-out;
}
@keyframes qadrop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.qa-drop-head { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-bottom: 1.5px dashed var(--line); margin-bottom: 4px; }
.qa-drop-head .avatar { width: 30px; height: 30px; font-size: 11px; }
.qa-drop-txt { display: flex; flex-direction: column; min-width: 0; }
.qa-drop-txt b { font: 800 13px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-drop-txt i { font: 500 11px var(--font); font-style: normal; color: var(--ink2); }
.qa-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; text-align: start;
  padding: 10px 12px;
  border: none; border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: 700 12px var(--font);
  cursor: pointer;
}
.qa-item .ic { width: 15px; height: 15px; color: var(--ink2); flex: none; }
.qa-item:hover { background: var(--bg2); }
.qa-item.qa-danger { color: var(--out); }
.qa-item.qa-danger .ic { color: var(--out); }

/* پنجرهٔ فیلتر ستونی — مثل فیلتر اکسل */
#mfilter-pop {
  position: fixed; z-index: 900;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(8, 16, 30, .3);
  padding: 10px;
  font-family: var(--font);
}
.mf-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.mf-head b { font: 800 13px var(--font); }
.mf-all { display: flex; gap: 8px; align-items: center; font: 700 12px var(--font); padding: 7px 8px; border-bottom: 1.5px dashed var(--line); margin-bottom: 4px; cursor: pointer; }
.mf-list { max-height: 250px; overflow-y: auto; }
.mf-item { display: flex; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; font: 600 12px var(--font); cursor: pointer; }
.mf-item:hover { background: var(--bg2); }
.mf-item span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mf-item i { font-style: normal; color: var(--ink2); font-size: 11px; }

/* سربرگ صفحات کامل اعضا — دکمهٔ بازگشت + عنوان */
.page-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.page-top .btn { flex: none; }
.page-top-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.page-top-t b { font: 800 16px var(--font); }
.page-top-t span { font: 500 12px var(--font); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-flip { transform: scaleX(-1); }
/* چیدمان صفحهٔ «کارت و جزئیات» — دو ستونه در دسکتاپ */
.minfo-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 900px) { .minfo-grid { grid-template-columns: minmax(340px, 420px) 1fr; align-items: start; } }
/* تب‌های تنظیمات — هر بخش در تب مخصوص خودش */
.set-tabs {
  display: flex; flex-wrap: wrap; gap: 5px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  margin-bottom: 14px;
  box-shadow: var(--sh-1);
}
.set-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--ink2);
  font: 700 13px var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.set-tab .ic { width: 15px; height: 15px; }
.set-tab:hover { color: var(--ink); background: var(--bg2); }
.set-tab.active { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(255, 77, 31, .25); }
.set-tab.active .ic { color: #fff; }
.set-panel { display: none; }
.set-panel.active { display: block; }
@media (hover: hover) and (pointer: fine) {
  .member-row:hover { border-color: var(--card-border); box-shadow: var(--sh-1); }
  .mbtn:hover, .qa-item:hover { filter: brightness(1.04); }
}

/* ---------- کارت عضویت ---------- */
.gymcard {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
}
.gymcard-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.gymcard-brand { font: 700 12px var(--font); color: var(--ink2); }
.gymcard-info { text-align: center; }
.gymcard-name { font: 900 20px var(--font); margin: 0 0 8px; text-align: center; }
.gymcard-sub { font: 500 12px var(--font); color: var(--ink2); line-height: 1.9; margin: 0; }
.gymcard.big .gymcard-name { font-size: 24px; }
/* کارت عمودی — QR بزرگ در مرکز */
.gymcard.vert .qr {
  display: block;
  margin: 10px auto 16px;
  width: 210px; height: 210px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 8px;
  box-sizing: border-box;
}
.gymcard.vert.big .qr { width: 240px; height: 240px; }
.gymcard.expired { border-style: dashed; }

.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- ثبت‌نام (رسید) ---------- */
.slip {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 16px 14px;
  background: var(--surface);
}
.slip-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 800 13px var(--font);
  color: var(--accent);
  margin-bottom: 4px;
}

/* ---------- مالی ---------- */
.fin-totalcard {
  position: relative;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  box-shadow: var(--sh-1);
}
.fin-label { font: 600 12px var(--font); color: var(--ink2); }
.fin-total { font: 900 30px var(--font); font-variant-numeric: tabular-nums; line-height: 1.3; }
.fin-unit { font: 600 13px var(--font); color: var(--ink2); }

/* ---------- تنظیمات ---------- */
.panel {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--sh-1);
}
.kv {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px dashed var(--line);
  font: 500 13px var(--font);
}
.kv span { color: var(--ink2); }
.kv b { font: 700 13px var(--font); text-align: end; }
.users-list { display: flex; flex-direction: column; }
.user-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 2px; border-bottom: 1px dashed var(--line); }
.user-row b { font: 700 14px var(--font); }
.user-sub { font: 500 12px var(--font); color: var(--ink2); }

/* ---------- لانچر ---------- */
.overlay { display: none; }
.overlay.open { display: block; }
#launcher {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.launcher-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  animation: pageIn .2s ease-out;
}
.launcher-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 6px 0 16px;
}
.launcher-head b { font: 900 20px var(--font); }
.launcher-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-card);
  padding: 16px;
  min-height: 118px;
  cursor: pointer;
  text-align: start;
  font-family: var(--font);
  transition: transform .1s ease-out, box-shadow .15s, border-color .15s;
  box-shadow: var(--sh-1);
}
.tile:hover { border-color: var(--card-border); box-shadow: var(--sh-2); }
.tile:active { transform: scale(.97); }
.tile-ic {
  width: 26px; height: 26px;
  padding: 9px; box-sizing: content-box;
  border-radius: 12px;
  background: rgba(255, 77, 31, .1);
  color: var(--accent);
}
.tile-label { font: 800 15px var(--font); color: var(--ink); }
.tile-desc { font: 500 12px var(--font); color: var(--ink2); line-height: 1.7; }
@media (min-width: 700px) { .launcher-grid { grid-template-columns: repeat(3, 1fr); } }
.launcher-foot { text-align: center; font: 500 12px var(--font); color: var(--ink2); margin-top: 18px; }

/* ---------- اسکنر ---------- */
#scanner {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #050B14;
  display: none;
  flex-direction: column;
}
#scanner.open { display: flex; }
.scan-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  color: #fff;
}
.scan-top b { font: 800 15px var(--font); }
.scan-stage { flex: 1; position: relative; overflow: hidden; }
#scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(72vw, 320px);
  aspect-ratio: 1;
  border: 2.5px solid rgba(255, 255, 255, .9);
  border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(4, 8, 16, .45);
}
.scan-line {
  position: absolute;
  top: 16%;
  inset-inline: 16%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  animation: scanMove 2.1s ease-in-out infinite alternate;
}
@keyframes scanMove { from { top: 17%; } to { top: 81%; } }
.scan-bottom {
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.scan-hint { text-align: center; font: 600 13px var(--font); color: #C9D6E8; margin: 0; }
.scan-error {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  background: rgba(201, 51, 51, .16);
  border: 1.5px solid var(--out);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.scan-error b { font: 800 14px var(--font); color: #fff; }
.scan-error span { font: 500 12px var(--font); color: #F0B9B9; line-height: 1.8; }
#scanner .btn { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); color: #fff; }
#scanner .btn.on { background: var(--accent); border-color: var(--accent); }
#scanner .ibtn { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .08); color: #fff; }
.scan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- نتیجه (مهر) ---------- */
#result {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 20px;
  background: color-mix(in srgb, var(--in) 9%, var(--bg));
}
#result.open { display: grid; }
#result.is-out { background: color-mix(in srgb, var(--out) 9%, var(--bg)); }
.result-card {
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 26px 22px 22px;
  width: min(86vw, 360px);
  max-width: calc(100vw - 32px);
  box-sizing: border-box; /* v57: بدون این، پدینگ + بوردر روی موبایل از 86vw می‌گذشت و کارت در RTL به چپ سرریز می‌شد */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
  animation: cardIn .25s cubic-bezier(.2, .9, .3, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.result-card h3 { font: 800 20px var(--font); margin: 14px 0 0; }
.result-code { font: 600 13px var(--font); color: var(--ink2); margin: 0; }
.result-plan { font: 500 12px var(--font); color: var(--ink2); line-height: 1.9; margin: 0; }
.result-time { font: 700 14px var(--font); font-variant-numeric: tabular-nums; margin: 4px 0 10px; }
#result.open .stamp { animation: stampIn .34s cubic-bezier(.2, .8, .3, 1) both; animation-delay: .08s; }
@keyframes stampIn {
  0% { opacity: 0; transform: scale(2.2); }
  62% { opacity: 1; transform: scale(.9); }
  100% { opacity: 1; transform: scale(1); }
}

/* ---------- شیت ---------- */
#sheet-root { position: relative; z-index: 70; }
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 16, 30, .5);
  opacity: 0;
  transition: opacity .25s;
}
#sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: 16px 20px 0 0;
  border-top: 1.5px solid var(--card-border);
  transform: translateY(102%);
  transition: transform .32s cubic-bezier(.22, 1.1, .36, 1);
  z-index: 71;
}
#sheet-root.open .sheet { transform: none; }
.sheet-handle {
  width: 44px; height: 5px;
  background: var(--line);
  border-radius: 999px;
  margin: 10px auto 0;
  cursor: pointer;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 6px;
}
.sheet-head h3 { font: 800 16px var(--font); margin: 0; }
.sheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 18px calc(22px + env(safe-area-inset-bottom));
}

/* ---------- خالی ---------- */
.empty {
  text-align: center;
  padding: 38px 14px;
  color: var(--ink2);
}
.empty .ic {
  width: 22px; height: 22px; opacity: .9;
  padding: 16px;
  box-sizing: content-box;
  border-radius: 50%;
  background: var(--bg2);
  border: 1.5px dashed var(--line);
}
.empty p { font: 500 13px var(--font); line-height: 2; max-width: 280px; margin: 14px auto 0; }

/* ---------- توست ---------- */
/* toast ها زیر نوار بالا — هیچ‌وقت دکمه‌های بالا را نمی‌پوشانند و با کیبورد و دکمه‌های پایین تداخل ندارند */
#toasts {
  position: fixed;
  top: calc(66px + env(safe-area-inset-top));
  inset-inline: 16px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  box-sizing: border-box; /* بدون این، padding باعث سرریز و بیرون‌زدگی کامل عرض می‌شود */
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--ink);
  color: var(--bg);
  padding: 13px 16px;
  border-radius: 12px;
  border-inline-start: 4px solid transparent;
  font: 600 13px var(--font);
  max-width: 460px;
  width: 100%;
  margin-inline: auto;
  transform: translateY(-16px);
  opacity: 0;
  transition: transform .28s cubic-bezier(.2, .9, .3, 1), opacity .28s;
  box-shadow: var(--sh-3);
  pointer-events: auto;
  cursor: pointer;
}
.toast.show { transform: none; opacity: 1; }
.toast-ok { border-inline-start-color: #57D9A4; }
.toast-err { border-inline-start-color: #FF9B9B; }
.toast-warn { border-inline-start-color: #FFD37D; }
.toast-info { border-inline-start-color: #9FC0F0; }
.toast-ok .ic { color: #57D9A4; }
.toast-err .ic { color: #FF9B9B; }
.toast-warn .ic { color: #FFD37D; }
.toast-info .ic { color: #9FC0F0; }

/* ---------- کارت NFC ---------- */
/* فیلد کد کارت + دکمهٔ خواندن NFC */
.uidrow {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.uidrow .f-input { flex: 1; min-width: 0; font-family: 'Vazirmatn', ui-monospace, monospace; letter-spacing: .5px; }
.uidrow .btn { flex: none; white-space: nowrap; }

/* ردیف کارت در پروفایل عضو */
.cardrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--line);
}
.cardrow:last-child { border-bottom: none; }
.carduid {
  flex: 1;
  min-width: 0;
  font: 600 12px ui-monospace, monospace;
  color: var(--ink2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* راهنمای نصب */
.guide {
  margin: 10px 4px 6px;
  padding-inline-start: 20px;
}
.guide li {
  font: 500 13px var(--font);
  line-height: 2.1;
  margin-bottom: 4px;
}

/* نشان سبز/قرمز چک‌های نصب */
.kv-ok b { color: var(--in); }
.kv-bad b { color: var(--out); }

/* ---------- دسکتاپ ---------- */
@media (min-width: 700px) {
  .topbar { max-width: 648px; margin: 0 auto; border-inline: 1.5px solid var(--card-border); border-top: none; }
  .btn-fab { inset-inline: auto; width: 240px; inset-inline-end: calc((100% - 640px) / 2 + 14px); }
}

/* ---------- سایدبار و نسخهٔ حرفه‌ای دسکتاپ (عرض بزرگ) ---------- */
#sidebar { display: none; }
.side-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 8px 16px; border-bottom: 1.5px dashed var(--line); margin-bottom: 12px;
}
.side-mark {
  width: 42px; height: 42px; flex: none;
  border-radius: 12px;
  background: linear-gradient(150deg, #1A2F52, #0A1626);
  display: grid; place-items: center;
  box-shadow: var(--sh-2);
  position: relative;
}
.side-mark::after { content: ""; width: 16px; height: 16px; border-radius: 5px; background: var(--accent); }
.side-brand-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.side-brand-txt b { font: 900 15px/1.4 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand-txt span { font: 500 12px var(--font); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.side-group:last-child { margin-bottom: 0; }
.side-group-label {
  font: 700 11px var(--font); color: var(--ink2); opacity: .85;
  letter-spacing: .4px;
  padding: 6px 12px 5px;
}
.side-item {
  /* لیبل خارج از جریان (absolute) — باگ رندر کروم در RTL، عرض متنِ درون‌جریانیِ آیتم فعال را صفر می‌کرد */
  position: relative;
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: var(--r-btn); border: none;
  background: transparent; color: var(--ink);
  font: 700 14px var(--font); cursor: pointer; text-align: start;
  transition: background .15s;
}
.side-item .ic { width: 20px; height: 20px; flex: none; color: var(--ink2); transition: color .15s; }
.side-item span {
  position: absolute;
  inset-inline-start: 44px;
  top: 50%;
  transform: translateY(-50%);
  max-width: calc(100% - 56px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-item:hover { background: rgba(127, 145, 170, .12); }
.side-item.active { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px rgba(255, 77, 31, .30); }
.side-item.active .ic { color: var(--on-accent); }
.side-foot { border-top: 1.5px dashed var(--line); padding: 12px 10px 4px; }
.side-date { font: 700 12px var(--font); color: var(--ink); }
.side-ver { font: 500 11px var(--font); color: var(--ink2); margin-top: 4px; }

@media (min-width: 1100px) {
  #shell {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "side top" "side main";
    height: 100dvh;
    overflow: hidden;
  }
  #sidebar {
    display: flex; flex-direction: column; gap: 6px;
    grid-area: side;
    border-inline-end: 1.5px solid var(--card-border);
    background: var(--surface);
    padding: 16px 12px;
    min-height: 0;
    overflow-y: auto;
  }
  #btn-launcher { display: none; }
  .topbar { grid-area: top; max-width: none; margin: 0; border-inline: none; position: static; }
  main#pages {
    grid-area: main;
    /* اسکرول‌بار همیشه در لبهٔ چپِ ناحیهٔ محتوا ثابت است — سایدبار هیچ‌وقت تغییر سایز نمی‌دهد */
    overflow-y: scroll;
    height: 100%;
    max-width: none;
    scrollbar-gutter: stable;
    padding: 20px 24px 40px;
  }
  /* همه‌چیز از ۱۰۰٪ عرض استفاده می‌کند — دیگر وسط‌چین نیست */
  #pages .page { max-width: none; width: 100%; }
  /* شیت → پنجرهٔ وسط‌چین */
  .sheet {
    inset-inline: 0; bottom: auto; top: 50%;
    max-width: 680px; margin-inline: auto;
    border-radius: 16px;
    border: 1.5px solid var(--card-border);
    border-top: 1.5px solid var(--card-border);
    max-height: 88dvh;
    transform: translate(0, -46%) scale(.97);
    opacity: 0;
    transition: transform .28s cubic-bezier(.22, 1.1, .36, 1), opacity .22s;
    box-shadow: 0 30px 90px rgba(8, 16, 30, .38);
  }
  #sheet-root.open .sheet { transform: translate(0, -50%) scale(1); opacity: 1; }
  .sheet-handle { display: none; }
  .sheet-body { padding: 8px 26px 26px; }
  /* ===== اعضا — جدول تمام‌عرض دسکتاپ ===== */
  .mstats { gap: 10px; }
  #members-list { display: block; }
  .mtable-row { padding: 10px 16px; }
  .mtd { font-size: 13px; }
  #register-recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px 14px; }
  #register-recent .sec-title { grid-column: 1 / -1; }
  /* ===== داشبورد دسکتاپ: چیدمان تمام‌عرض ===== */
  .dash-actions .btn { flex: 0 0 auto; }
  #gate-feed .feed-row, #hist-list .feed-row { padding: 13px 10px; font-size: 15px; }
  .feed-name { font-size: 15px; }
  .feed-t { font-size: 14px; }
  /* دفتر مالی — ستون‌های پهن */
  .lr-note { max-width: 320px; }
  /* تنظیمات — تک‌ستونه؛ بخش‌ها در تب‌ها هستند */
  [data-page="settings"].active { display: block; }
  [data-page="settings"] .panel { margin-bottom: 16px; }
  .set-tab { padding: 10px 18px; font-size: 13px; }
  #toasts { align-items: center; }
}

/* اسپلش بوت — پوشش کامل تا آماده شدن مقصد (لاگین یا اپ) */
#boot-splash {
  position: fixed; inset: 0; z-index: 9990;
  display: grid; place-items: center;
  background: var(--bg);
  transition: opacity .3s ease;
}
#boot-splash.done { opacity: 0; pointer-events: none; }
.splash-box { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.splash-mark {
  width: 58px; height: 58px; border-radius: 17px;
  background: linear-gradient(150deg, #1A2F52, #0A1626);
  display: grid; place-items: center;
  box-shadow: 0 14px 34px rgba(10, 22, 38, .35);
}
.splash-mark::after { content: ""; width: 23px; height: 23px; border-radius: 6px; background: #FF4D1F; }
.splash-box > b { font: 900 17px var(--font); color: var(--ink); }
.splash-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}

/* ---------- کاهش حرکت ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =============== v14: دسکتاپ — دکمه‌های موبایلی پنهان شوند =============== */
body.is-desktop .btn-install { display: none !important; }
body.is-desktop #install-panel { display: none !important; }

/* هشدار بوت — مرورگر قدیمی یا اتصال ناامن */
#boot-warn {
  position: fixed; inset-inline: 12px; bottom: 14px; z-index: 9999;
  background: #FFF6E5; color: #5A3A00;
  border: 1.5px solid #E8B45A; border-radius: 12px;
  padding: 12px 14px; font: 500 13px/1.9 var(--font);
  box-shadow: 0 12px 32px rgba(0,0,0,.18);
}
#boot-warn a { color: #C2410C; font-weight: 700; margin-inline-start: 6px; }

/* =============== v22: داشبورد — شاخص‌های فشرده و کاربردی =============== */
.dash-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  min-width: 0;
  box-shadow: var(--sh-1);
}
.kpi .kpi-ic {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  border-radius: 12px; color: var(--ink2); flex: none;
  background: var(--bg2);
}
.kpi .kpi-ic .ic { width: 20px; height: 20px; }
.kpi > div { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.kpi b { font: 900 20px/1.2 var(--font); color: var(--ink); letter-spacing: -.3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi span { font: 600 11px var(--font); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi i { font: 500 11px var(--font); color: var(--ink2); font-style: normal; }
.kpi.is-in { border-color: rgba(34, 197, 94, .4); }
.kpi.is-in .kpi-ic { color: var(--in); background: var(--in-bg); }
.kpi.is-in b { color: var(--in); }
.kpi.is-out { border-color: rgba(239, 68, 68, .35); }
.kpi.is-out .kpi-ic { color: var(--out); background: var(--out-bg); }
.kpi.is-money { border-color: rgba(255, 77, 31, .35); }
.kpi.is-money .kpi-ic { color: var(--accent); background: rgba(255, 77, 31, .1); }
.kpi.is-money b { color: var(--accent); }
.kpi em { font-style: normal; font-weight: 600; font-size: 11px; color: var(--ink2); }
/* کارت درآمد در موبایل تمام‌عرض تا عدد بزرگ جا شود */
.kpi-wide { grid-column: 1 / -1; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.dash-actions .btn { flex: 1 1 auto; }
.dash-mid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.dash-panel { padding: 16px 18px; margin: 0; }
.sec-head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 10px; }
.sec-head-row .sec-title { margin: 0; }
.chip-mini { padding: 3px 10px; font-size: 12px; }

/* نمودار تردد ۱۴ روز */
.chartbars { display: flex; flex-direction: row-reverse; gap: 6px; align-items: flex-end; height: 150px; padding-top: 8px; }
.cbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.cbar i { width: 100%; max-width: 30px; border-radius: 7px 7px 3px 3px; background: var(--accent); opacity: .85; }
.cbar.is-zero i { background: var(--line); opacity: 1; height: 3% !important; }
.cbar span { font: 700 11px var(--font); color: var(--ink2); min-height: 13px; }
.cbar em { font: 500 11px var(--font); color: var(--ink2); font-style: normal; opacity: .8; }

/* دوره‌های رو به پایان */
.exp-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border-radius: 12px;
  border: 1.5px solid var(--card-border); background: var(--surface);
  margin-bottom: 8px; cursor: pointer;
}
.exp-row:hover { border-color: var(--accent); }
.exp-row .feed-name { flex: 1; font: 700 14px var(--font); color: var(--ink); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-row .feed-code { font: 600 12px var(--font); color: var(--ink2); }
.exp-left {
  font: 700 12px var(--font); color: #B45309;
  background: rgba(245, 158, 11, .13);
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.exp-row.is-urgent .exp-left { color: #B91C1C; background: rgba(239, 68, 68, .14); }
.exp-go .ic { width: 16px; height: 16px; color: var(--ink2); }

/* اورلی قطع اتصال */
#net-error .result-card .ic.big { width: 40px; height: 40px; color: var(--out); }

/* =============== v19: مسیر راهبردی =============== */
.rm-progress { padding: 18px; margin-bottom: 12px; }
.rm-headline { display: flex; flex-direction: column; gap: 4px; }
.rm-headline b { font: 900 16px var(--font); color: var(--ink); }
.rm-headline span { font: 600 12px var(--font); color: var(--ink2); }
.rm-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 10px; }
.rm-bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--in), var(--accent)); transition: width .4s; }
.rm-phase { margin: 18px 2px 8px; }
.rm-phase .sec-title { margin: 0; }
.rm-ph-desc { font: 500 12px var(--font); color: var(--ink2); }
.rm-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1.5px solid var(--card-border);
  border-radius: 12px; padding: 11px 14px; margin-bottom: 8px;
}
.rm-row.is-done { opacity: .78; }
/* متن فارسی با line-through تکه‌تکه و به‌هم‌ریخته رندر می‌شود — استاندارد: رنگ محو به‌جای خط‌خوردگی */
.rm-row.is-done .rm-txt b { color: var(--ink2); }
.rm-row.is-done .rm-txt span { opacity: .8; }
.rm-check { position: relative; display: inline-flex; flex: none; cursor: pointer; }
.rm-check input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.rm-box {
  width: 24px; height: 24px; border-radius: 8px;
  border: 2px solid var(--line); background: var(--bg);
  display: grid; place-items: center; color: transparent; transition: .15s;
}
.rm-box .ic { width: 14px; height: 14px; stroke-width: 3; }
.rm-row.is-done .rm-box { background: var(--in); border-color: var(--in); color: #fff; }
.rm-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rm-txt b { font: 700 14px var(--font); color: var(--ink); }
.rm-txt span { font: 500 12px var(--font); color: var(--ink2); }
.rm-del { color: var(--out); flex: none; }

/* دسکتاپ — داشبورد و مسیر راهبردی تمام‌عرض */
@media (min-width: 1100px) {
  .dash-kpis { grid-template-columns: repeat(5, 1fr); }
  .kpi-wide { grid-column: auto; }
  .kpi b { font-size: 20px; }
  .dash-mid { grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); }
  .chartbars { height: 190px; }
  .gate-scan { min-height: 150px; padding: 24px; }
  .gate-scan-txt b { font-size: 20px; }
  .gate-scan-txt i { font-size: 13px; }
}




/* ================= v26 — تب‌های سطح صفحه، بوفه، مالی، پرمیشن، امنیت، راهنما ================= */

/* تب‌های سطح صفحه (اعضا/مالی/بوفه/امنیت/پروفایل عضو) — هم‌خانوادهٔ set-tab */
/* تب‌بار سطح صفحه — پنل واحد با قرص فعال؛ واضح است که بالای صفحه تب‌بندی است */
.ptabs, .set-tabs {
  display: flex; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
  background: var(--bg2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 14px;
}
.ptabs::-webkit-scrollbar, .set-tabs::-webkit-scrollbar { display: none; }
.ptab, .set-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  flex: 1 0 auto;
  min-height: 38px;
  padding: 8px 16px;
  border: none; border-radius: 12px;
  background: transparent;
  color: var(--ink2);
  font: 700 13px var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
.ptab .ic, .set-tab .ic { width: 15px; height: 15px; }
.ptab:hover, .set-tab:hover { color: var(--ink); }
.ptab.active, .set-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--sh-1);
  border: 1.5px solid var(--line);
  padding: 6.5px 14.5px;
  font-weight: 800;
}
.ptab.active .ic, .set-tab.active .ic { color: var(--accent); }
.ptab.is-warn { color: #D97706; }
[data-theme="dark"] .ptab.is-warn { color: #F5A524; }

/* textarea — هم‌خانوادهٔ فیلد فرم */
textarea.f-input {
  width: 100%; box-sizing: border-box;
  resize: vertical;
  line-height: 1.9;
  background: var(--bg2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--ink);
  font: 500 13px var(--font);
}
textarea.f-input:focus { outline: none; border-color: var(--accent); }

/* لوگو و بنر در تنظیمات + صفحهٔ ورود + سایدبار */
.brand-imgs { display: flex; gap: 12px; flex-wrap: wrap; }
.brand-img-box { flex: 1 1 180px; display: flex; flex-direction: column; gap: 8px; }
.brand-img-box.is-wide { flex: 2 1 260px; }
.brand-preview {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  min-height: 70px;
}
.brand-preview.is-logo { height: 110px; }
.brand-preview.is-banner { height: 90px; }
.brand-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.brand-preview.is-banner img { width: 100%; height: 100%; object-fit: cover; }
.set-noimg { font: 600 12px var(--font); color: var(--ink2); padding: 8px; text-align: center; }
.side-logo { width: 34px; height: 34px; border-radius: 12px; object-fit: cover; flex: none; }
.login-logo { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; display: block; margin: 0 auto 8px; }
.login-banner { width: 100%; height: 92px; object-fit: cover; border-radius: 12px; display: block; margin-bottom: 10px; }
.small-btn { font-size: 12px; padding: 7px 10px; }

/* کاربرها — ردیف تنظیمات حساب‌ها */
.user-row { display: flex; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1.5px dashed var(--line); flex-wrap: wrap; }
.user-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.user-main b { font: 800 13px var(--font); }
.user-sub { font: 500 12px var(--font); color: var(--ink2); }
.user-pass { flex: 1 1 150px; max-width: 220px; }

/* بوفه — POS */
.cafe-sell { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .cafe-sell { grid-template-columns: 1fr 320px; align-items: start; } }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 9px; }
.pos-item {
  display: flex; flex-direction: column; gap: 3px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  text-align: start;
  font-family: var(--font);
  transition: transform .1s, border-color .15s;
}
.pos-item:active { transform: scale(.96); }
.pos-item b { font: 800 13px var(--font); color: var(--ink); }
.pos-item span { font: 700 12px var(--font); color: var(--accent); font-variant-numeric: tabular-nums; }
.pos-item i { font: 500 11px var(--font); font-style: normal; color: var(--ink2); }
.pos-item.is-out { opacity: .5; border-style: dashed; }
.cart-panel { position: sticky; top: 12px; }
.cart-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1.5px dashed var(--line); }
.cart-name { flex: 1; min-width: 0; font: 700 13px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-qty { display: inline-flex; align-items: center; gap: 7px; }
.cart-qty b { font: 800 13px var(--font); min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-sum { font: 700 12px var(--font); color: var(--ink2); font-variant-numeric: tabular-nums; }
.cart-total { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font: 800 14px var(--font); }
.cart-total b { color: var(--accent); font-variant-numeric: tabular-nums; }

/* گزارش‌های مالی و بوفه */
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 9px; margin-bottom: 10px; }
.rep-card { background: var(--bg2); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 3px; }
.rep-card b { font: 800 17px var(--font); font-variant-numeric: tabular-nums; }
.rep-card span { font: 600 11px var(--font); color: var(--ink2); }
.rep-card.is-in b { color: var(--in); }
.rep-card.is-out b { color: var(--out); }
.rep-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.rep-lbl { flex: 0 0 150px; font: 600 12px var(--font); color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-bar { flex: 1; height: 9px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.rep-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.rep-bar i.is-in { background: var(--in); }
.rep-bar i.is-out { background: var(--out); }
.rep-v { flex: none; font: 700 12px var(--font); font-variant-numeric: tabular-nums; }
.sec-day { display: block; font: 500 11px var(--font); font-style: normal; color: var(--ink2); }

/* پرمیشن‌ها */
.perm-card { margin-bottom: 12px; }
.perm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.perm-head-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.perm-head-txt b { font: 800 14px var(--font); }
.perm-head-txt span { font: 500 12px var(--font); color: var(--ink2); }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 7px; margin-bottom: 8px; }
.perm-item {
  display: flex; align-items: center; gap: 7px;
  background: var(--bg2);
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  font: 600 12px var(--font);
  cursor: pointer;
}
.perm-item input { accent-color: var(--accent); }

/* امنیت */
.kv-note { display: block; font: 500 11px var(--font); font-style: normal; color: var(--ink2); width: 100%; }
.kv { position: relative; }
.kv-ok { border-inline-start: 3px solid var(--in); }
.kv-bad { border-inline-start: 3px solid var(--out); }

/* موبایل */
@media (max-width: 700px) {
  .rep-lbl { flex-basis: 110px; font-size: 11px; }
  .fin-totalcard { padding: 14px 18px; }
}

/* ================= v27 — بازسازی گرافیکی بر اساس پنل ۵ داور ================= */

/* فیلدهای عددی: تراز یکنواخت */
input[inputmode="numeric"], input[inputmode="tel"] { text-align: right; font-variant-numeric: tabular-nums; }
.f-row2 .f-input, .f-row2 .f-select { min-height: 42px; box-sizing: border-box; }
.f-select { min-height: 42px; }

/* چیپ‌ها: یکدست کامل (ارتفاع/گوشه/فاصله) */
.chip {
  min-height: 36px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 12px;
  font: 700 12px var(--font);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .chip .ic { width: 13px; height: 13px; }
.filterline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filterline .f-select { min-height: 38px; }
.filterline .btn { min-height: 38px; }

/* ارتفاع واحد دکمه‌ها */
.btn { min-height: 40px; }
.small-btn { min-height: 34px; }

/* دکمه‌های هدر لمس‌پذیرتر */
.ibtn { width: 42px; height: 42px; }
.topbar-actions { gap: 8px; }

/* kv — یادداشت زیر خط خودش؛ تراز عمودی درست */
.kv { align-items: flex-start; }
.kv .kv-note { width: 100%; }
.kv-ok { border-inline-start: 3px solid var(--in); padding-inline-start: 10px; }
.kv-bad { border-inline-start: 3px solid var(--out); padding-inline-start: 10px; }

/* کارت‌های گزارش: هم‌اندازه */
.rep-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.rep-card { min-height: 84px; justify-content: center; }
.rep-row { min-height: 34px; }
.rep-row .rep-lbl { line-height: 1.6; }

/* کارت مالی: متن وسط‌چین و ارتفاع ثابت */
.fin-totalcard { align-items: baseline; min-height: 64px; padding-block: 14px; }
.fin-totalcard .notch { --notch-bg: var(--bg); }

/* نوار پیشرفت مسیر راهبردی — تک‌رنگ */
.rm-bar i { background: linear-gradient(90deg, var(--accent), #ff7a52) !important; }

/* ---------- بوفه: منوی زیبا (کارت‌های دسته‌بندی‌شده) ---------- */
.menu-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.menu-cat-title {
  display: flex; align-items: center; gap: 8px;
  margin: 16px 2px 8px;
  font: 800 13px var(--font);
  color: var(--ink);
}
.menu-cat-title .ic { color: var(--accent); }
.menu-cat-title::after { content: ''; flex: 1; height: 1.5px; background: var(--line); border-radius: 2px; }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.menu-card {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--sh-1);
}
.menu-card-head { display: flex; align-items: flex-start; gap: 9px; }
.menu-emoji {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
}
.menu-card-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.menu-card-name b { font: 800 13px var(--font); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-card-name span { font: 500 11px var(--font); color: var(--ink2); }
.menu-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.menu-price { font: 800 14px var(--font); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.menu-price::after { content: ' تومان'; font: 600 11px var(--font); color: var(--ink2); }
.menu-stock { font: 600 11px var(--font); color: var(--ink2); white-space: nowrap; }
.menu-stock.low { color: var(--out); }
.menu-card-actions { display: flex; gap: 4px; }

/* بوفه — POS: کارت‌های فروش هم‌اندازه و بدون سرریز متن */
.pos-item { min-height: 86px; }
.pos-item b { line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-item span { font-variant-numeric: tabular-nums; }
.cart-row { min-height: 40px; }
.cart-name { line-height: 1.5; }

/* انبار — جدول‌وار: ستون‌های هم‌تراز */
.stk-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1.5px dashed var(--line); min-height: 52px; }
.stk-row .avatar { display: flex; align-items: center; justify-content: center; }

/* امنیت/حساب‌ها — ایزوله‌سازی bidi */
.bdi-user, .bdi-ip { unicode-bidi: isolate; font-weight: 800; }
.bdi-ip { font-weight: 600; color: var(--ink2); font-variant-numeric: tabular-nums; }
.led-sub { unicode-bidi: plaintext; }
.carduid { font-variant-numeric: tabular-nums; }

/* کاربرها — زیرنویس تمیز */
.user-sub { display: inline-flex; gap: 6px; align-items: center; }

/* خالی‌بودن لیست: دکمهٔ اقدام در خود empty-state */
.empty .btn { margin-top: 10px; }

/* فرم‌های مالی: خط تاریخ — یک ردیف استاندارد و جمع‌وجور */
.daterow { display: flex; gap: 8px; }
.daterow .f-select { min-height: 38px; padding-block: 6px; }
.timewrap { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.timewrap input, input[type="time"] { min-height: 38px; max-width: 130px; direction: ltr; text-align: center; }

/* آیتم‌های دکمهٔ شناور زیر لیست‌های بلند روی موبایل */
@media (max-width: 700px) {
  .pos-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-grid { grid-template-columns: 1fr; }
  .rep-grid { grid-template-columns: repeat(2, 1fr); }
  .menu-card { padding: 11px 12px; }
}

/* تکمیلی v27 */
.flex-sp { flex: 1; }
.menu-cat-n { font: 600 11px var(--font); font-style: normal; color: var(--ink2); margin-inline-start: 8px; }
.pos-unit { font: 600 11px var(--font); font-style: normal; color: var(--ink2); }
.stk-row .led-main b { line-height: 1.5; }

/* v28 — تکمیلی پنل داوری */
.req { color: var(--out); font-style: normal; font-weight: 800; margin-inline-start: 2px; }
.f-label { display: flex; align-items: center; gap: 2px; }
/* چیپ‌های فیلتر اعضا: عرض محتوایی یکدست */
.chips .chip { min-width: 72px; justify-content: center; }
/* دات وضعیت KPI: همیشه هم‌اندازه و هم‌جایگاه */
.kpi b { position: relative; }
.kpi .kpi-dot { width: 8px; height: 8px; flex: none; display: inline-block; border-radius: 50%; }
/* سبد خالی */
.cart-empty-note { font: 600 13px var(--font); color: var(--ink2); }
/* جدول اعضا: ستون وضعیت همیشه محتوا */
.mtable-row .mr-end { justify-self: start; }
/* موبایل: جدول اعضا → فاصلهٔ لمسی ردیف اکشن */
@media (max-width: 700px) {
  .mtable-wrap { margin-inline: -14px; }
  .members-actions { display: grid; grid-template-columns: 1fr; gap: 8px; }
}

/* v28b — تکمیلی */
.chip-mini.is-ok { background: var(--in-bg); color: var(--in); border-color: transparent; }
/* ساعت ورودی‌ها: همیشه ۲۴ساعته */
input[type="time"] { font-family: var(--font); }

/* ═══════════ v30 — سوابق ورود و خروج: فیلترهای لیست‌باکسی + کارت تک‌سطری + عرض کامل ═══════════ */

/* ---- نوار فیلتر: همه در یک سطر، ترتیب از راست: جستجو، عضو، بازه(+تاریخ)، نوع، روش ---- */
.histbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 10px;
  box-shadow: var(--sh-1);
  position: sticky;
  top: 58px;
  z-index: 30;
}
.histbar-search { flex: 0 1 170px; min-width: 118px; max-width: 220px; min-height: 36px; padding: 6px 12px; font-size: 13px; }
.histbar-member { flex: 0 0 auto; width: auto; min-height: 36px; padding: 6px 30px 6px 12px; font-size: 13px; }
.histbar-range  { flex: 0 0 auto; width: auto; min-height: 36px; padding: 6px 30px 6px 12px; font-size: 13px; }
.histbar-date   { flex: 0 1 128px; min-width: 108px; min-height: 36px; padding: 6px 12px; font-size: 12px; text-align: start; color: var(--ink); cursor: pointer; }
.histbar-date:focus { outline: none; border-color: var(--accent); }
.histbar-type   { flex: 0 0 auto; width: auto; min-height: 36px; padding: 6px 30px 6px 12px; font-size: 13px; }
.histbar-method { flex: 0 0 auto; width: auto; min-height: 36px; padding: 6px 30px 6px 12px; font-size: 13px; }

/* بازهٔ از/تا تاریخ دلخواه — v65: دو لیست‌باکس شمسی */
.histbar-drange { display: flex; align-items: center; gap: 6px; }
.histbar-drange .drange-sep { font: 700 12px var(--font); color: var(--ink2); flex: none; }
.histbar-drange .histbar-lb { flex: 0 1 152px; min-width: 122px; }
.histbar-drange .histbar-lb .lb-trigger { width: 100%; font-size: 12.5px; }

/* فیلترهای سوابق: بدون فلش، راست‌چین صریح */
.histbar select {
  direction: rtl;
  text-align: start;
  text-align-last: start;
  background-image: none;
  padding-inline-start: 12px;
  padding-inline-end: 12px;
}

/* یادداشت داخل کارت سوابق */
.hcard-note { font: 500 12px var(--font); color: var(--ink2); flex-basis: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* موبایل: سلول‌های کارت مثل قبل در یک سطر می‌پیچند */
.hcard > .hcell { display: inline-flex; align-items: center; gap: 4px; min-width: 0; padding: 11px 0; }
.hcard > .hcell.hc-name { flex-wrap: wrap; }
.hcard > .hcell.hc-name .hcard-name { flex: 0 1 auto; }



/* ---- خلاصهٔ آماری ---- */
.hist-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  background: var(--bg2);
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 14px;
  font: 500 12px var(--font);
  color: var(--ink2);
}
.hist-summary:empty { display: none; }
.hs-item { display: inline-flex; align-items: center; gap: 5px; }
.hs-item b { color: var(--ink); font-weight: 800; font-size: 13px; }
.hs-item i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.hs-in i { background: var(--in); }
.hs-out i { background: var(--out); }
.hs-in b { color: var(--in); }
.hs-out b { color: var(--out); }
.hs-sep { width: 1px; height: 14px; background: var(--line); }
.hs-method { color: var(--ink2); }
.hs-item .ic { width: 13px; height: 13px; opacity: .6; }

/* ---- سرگروه روز ---- */
.hist-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 18px 2px 8px;
}
.hist-day:first-child { margin-top: 2px; }
.hist-day-t { font: 800 13px var(--font); color: var(--ink); }
.hist-day-n { font: 600 12px var(--font); color: var(--ink2); background: var(--bg2); padding: 3px 10px; border-radius: 999px; }

/* ---- کارت تک‌سطری تردد — تمام‌عرض محتوا ---- */
.hcard {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1.5px solid var(--card-border, var(--line));
  border-radius: 15px;
  margin-bottom: 9px;
  box-shadow: var(--sh-1);
  cursor: pointer;
  transition: border-color .15s, box-shadow .18s, transform .1s;
  overflow: hidden;
}
.hcard:hover { border-color: var(--accent); box-shadow: var(--sh-2); }
.hcard:active { transform: scale(.995); }
.hcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* نوار رنگی سمت راست */
.hcard-side {
  flex: none;
  width: 46px;
  display: grid;
  place-items: center;
  background: var(--bg2);
  border-inline-end: 1.5px solid var(--line);
}
.hcard-side .ic { width: 19px; height: 19px; }
.hcard-in .hcard-side { background: var(--in-bg); color: var(--in); border-inline-end-color: rgba(34, 197, 94, .25); }
.hcard-out .hcard-side { background: var(--out-bg); color: var(--out); border-inline-end-color: rgba(239, 68, 68, .25); }

/* بدنهٔ تک‌سطری: همهٔ داده‌ها در یک سطر با جداکننده */
.hcard-line {
  flex: 1;
  min-width: 0;
  padding: 11px 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;   /* فاصلهٔ افقی بیشتر برای خوانایی بهتر داده‌ها */
}
.hcard-name { font: 800 14px var(--font); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.hcard-chip { font: 700 11px var(--font); padding: 2.5px 10px; border-radius: 999px; flex: none; }
.hcard-chip.st-in { background: var(--in-bg); color: var(--in); }
.hcard-chip.st-out { background: var(--out-bg); color: var(--out); }
.hcard-method { font: 700 11px var(--font); padding: 2px 8px; border-radius: 7px; background: var(--bg2); color: var(--ink2); flex: none; }
.hcard-method.mth-nfc { color: #7c3aed; background: rgba(124, 58, 237, .1); }
.hcard-method.mth-qr { color: #0e7490; background: rgba(14, 116, 144, .1); }
.hcard-method.mth-manual { color: #b45309; background: rgba(180, 83, 9, .1); }
.hcard-method.mth-bridge { color: #1d4ed8; background: rgba(29, 78, 216, .1); }
.hcard-plan { font: 600 11px var(--font); color: var(--ink2); flex: none; }
.hcard-sep { color: var(--ink2); opacity: .5; font-size: 12px; flex: none; user-select: none; }
.hcard-meta { display: inline-flex; align-items: center; gap: 4px; font: 500 12px var(--font); color: var(--ink2); white-space: nowrap; }
.hcard-meta .ic { width: 12.5px; height: 12.5px; opacity: .65; }
.hcard-time { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--ink); font-size: 13px; white-space: nowrap; }
.hcard-time .ic { width: 13px; height: 13px; opacity: .7; }

/* اکشن‌های سمت چپ */
.hcard-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 0 10px;
  border-inline-start: 1.5px dashed var(--line);
}
.hcard-actions .ibtn { width: 32px; height: 32px; }
.ibtn.primary-act { color: var(--accent); border: 1.5px solid var(--accent); background: rgba(255, 77, 31, .06); }
.ibtn.primary-act:hover { background: rgba(255, 77, 31, .14); }
.ibtn.danger { color: var(--out); }
.ibtn.danger:hover { background: var(--out-bg); }

/* ---- مودال تأیید وسط صفحه ---- */
.dlg-root { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 20px; }
.dlg-back { position: absolute; inset: 0; background: rgba(8, 16, 30, .45); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s; }
.dlg-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  padding: 26px 24px 20px;
  text-align: center;
  box-shadow: 0 30px 90px rgba(8, 16, 30, .38);
  transform: translateY(14px) scale(.96);
  opacity: 0;
  transition: transform .24s cubic-bezier(.22, 1.1, .36, 1), opacity .2s;
}
.dlg-root.show .dlg-back { opacity: 1; }
.dlg-root.show .dlg-box { transform: none; opacity: 1; }
.dlg-ic { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--out-bg); color: var(--out); }
.dlg-ic .ic { width: 24px; height: 24px; }
.dlg-title { font: 800 16.5px var(--font); color: var(--ink); margin: 0 0 10px; }
.dlg-msg { font: 500 13px var(--font); line-height: 2; color: var(--ink2); margin-bottom: 18px; }
.dlg-msg b { color: var(--ink); }
.dlg-msg .tx-in { color: var(--in); }
.dlg-msg .tx-out { color: var(--out); }
.dlg-actions { display: flex; gap: 10px; }
.dlg-actions .btn { flex: 1; min-height: 44px; }

/* ---- موبایل ---- */
@media (max-width: 760px) {
  .histbar { top: 52px; padding: 8px 10px; }
  .histbar-search { flex: 1 1 100%; order: -1; }
  .histbar-member, .histbar-range, .histbar-date, .histbar-type, .histbar-method { flex: 1 1 calc(50% - 8px); max-width: none; }
  .histbar-drange { flex: 1 1 calc(50% - 8px); }
  .histbar-drange.hidden { display: none; }
  .hcard { gap: 6px 12px; }
  .hcard > .hcell { padding: 9px 0; }
  .hcard > .hcell.hc-name { padding-inline-start: 12px; }
  .hcard-side { width: 38px; }
  .hcard-side .ic { width: 16px; height: 16px; }
  .hcard-name { max-width: 150px; font-size: 13px; }
  .hcard-actions { padding: 0 8px; flex-direction: column; gap: 4px; }
  .hcard-head { display: none !important; }
}

/* حالت تاریک — رنگ‌های روش برند */
[data-theme="dark"] .hcard-method.mth-nfc { color: #a78bfa; background: rgba(167, 139, 250, .15); }
[data-theme="dark"] .hcard-method.mth-qr { color: #67e8f9; background: rgba(103, 232, 249, .13); }
[data-theme="dark"] .hcard-method.mth-manual { color: #fbbf24; background: rgba(251, 191, 36, .13); }
[data-theme="dark"] .hcard-method.mth-bridge { color: #93c5fd; background: rgba(147, 197, 253, .13); }
[data-theme="dark"] .hcard-method.mth-qr { color: #67e8f9; background: rgba(103, 232, 249, .13); }
[data-theme="dark"] .hcard-method.mth-manual { color: #fbbf24; background: rgba(251, 191, 36, .13); }
[data-theme="dark"] .hcard-method.mth-bridge { color: #93c5fd; background: rgba(147, 197, 253, .13); }

/* ═══════════ v31 — تقویم شمسی (popup) ═══════════ */
.jdate-input { cursor: pointer; }
.jdate-pop {
  position: fixed;
  z-index: 300;
  width: 292px;
  background: var(--surface);
  border: 1.5px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(8, 16, 30, .35);
  padding: 12px 14px 10px;
  animation: pageIn .18s cubic-bezier(.2, .9, .3, 1);
  user-select: none;
}
.jdp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.jdp-title { font: 800 14px var(--font); color: var(--ink); }
.jdp-nav {
  width: 30px; height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: 700 16px/1 var(--font);
  cursor: pointer;
}
.jdp-nav:hover { background: var(--bg2); }
.jdp-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 2px; }
.jdp-dow span { text-align: center; font: 700 11px var(--font); color: var(--ink2); padding: 4px 0; }
.jdp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.jdp-day {
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font: 600 12px var(--font);
  color: var(--ink);
  cursor: pointer;
}
.jdp-day:hover { background: var(--bg2); }
.jdp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent); color: var(--accent); }
.jdp-day.is-sel { background: var(--accent); color: #fff; font-weight: 800; }
.jdp-day.is-sel.is-today { box-shadow: inset 0 0 0 2px #fff; color: #fff; }
.jdp-blank { height: 32px; }
.jdp-foot { display: flex; justify-content: center; margin-top: 8px; padding-top: 8px; border-top: 1.5px dashed var(--line); }
.jdp-today {
  border: 1.5px solid var(--accent);
  background: rgba(255, 77, 31, .07);
  color: var(--accent);
  font: 700 12px var(--font);
  padding: 6px 22px;
  border-radius: 999px;
  cursor: pointer;
}
.jdp-today:hover { background: rgba(255, 77, 31, .14); }

@media (max-width: 430px) {
  .jdate-pop { width: min(292px, calc(100vw - 16px)); }
}

/* ═══════════ v32 — صفحهٔ تمدید دوره ═══════════ */
.ren-status {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px;
  background: var(--bg2); border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 10px 16px; margin-bottom: 14px; font: 500 13px var(--font); color: var(--ink2);
}
.ren-status b { color: var(--ink); }
.ren-status .mr-end { padding: 3px 12px; font-size: 12px; }
.ren-pay-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--bg2); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.ren-pay-row .f-label { margin: 0; }
.ren-list { display: flex; flex-direction: column; gap: 8px; }
.ren-item {
  display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 9px 14px; font: 500 12px var(--font); color: var(--ink2); box-shadow: var(--sh-1);
}
.ren-item b { color: var(--ink); font-weight: 800; }
.ren-item .ren-amt { color: var(--in); font-weight: 800; }
.ren-item .ren-date { font-weight: 700; color: var(--ink); }

/* v32 — عرض میانی: ستون‌های کد و موبایل پنهان تا جدول همیشه در کادر بماند */
@media (max-width: 1180px) and (min-width: 701px) {
  .mtable-head, .mtable-row {
    grid-template-columns: minmax(130px, 1.3fr) minmax(78px, .8fr) 96px 70px 100px 86px minmax(112px, auto);
  }
  .mtable-head > :nth-child(2), .mtable-row > .mtd[data-col="code"],
  .mtable-head > :nth-child(3), .mtable-row > .mtd[data-col="phone"] { display: none; }
  .mtable { min-width: 600px; }
}

/* ═══ v34 — سرستون و چیدمان ستونی کارت‌های سوابق (دسکتاپ) ═══ */
@media (min-width: 761px) {
  .hcard-head, .hcard {
    display: grid;
    grid-template-columns: 46px minmax(150px, 1.35fr) 70px 84px 66px 112px 58px minmax(96px, auto);
    gap: 0 10px;
    align-items: center;
  }
  .hcard-head {
    background: var(--surface);
    border: 1.5px solid var(--line);
    border-radius: 12px;
    padding: 8px 0;
    margin-bottom: 8px;
    box-shadow: var(--sh-1);
    overflow: hidden;
  }
  .hcard-head > div {
    font: 700 12px var(--font);
    color: var(--ink2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 2px 0;
  }
  .hcard-head .hh-side { text-align: center; }
  .hcard > .hcell { display: flex; padding: 11px 0; }
  .hcard > .hcell .hcard-name { max-width: none; }
  .hcard > .hcell.hc-name { padding-inline-start: 14px; }
}
/* عرض میانی: ستون کد پنهان تا همه‌چیز در کادر بماند */
@media (min-width: 761px) and (max-width: 1180px) {
  .hcard-head, .hcard { grid-template-columns: 46px minmax(140px, 1.3fr) 70px 84px 106px 58px minmax(90px, auto); }
  .hcard-head > :nth-child(5), .hcard > .hc-code { display: none; }
}

/* ═══════════ v35 — پروفایل عضو بازنویسی‌شده + حالت‌های تعاملی آیکون‌ها ═══════════ */
/* هیروی عضو: هویت + آمار + اکشن‌های همیشه در دسترس */
.mhero {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--sh-1);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.mhero::before { content: ''; position: absolute; inset-inline: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent), rgba(255, 77, 31, 0)); }
.mhero.is-in::before { background: linear-gradient(90deg, var(--in), rgba(34, 197, 94, 0)); }
.mhero.is-out::before { background: linear-gradient(90deg, var(--out), rgba(239, 68, 68, 0)); }
.mhero-main { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mhero-avatar {
  width: 56px; height: 56px; flex: none;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--accent); color: #fff;
  font: 800 20px var(--font);
}
.mhero-id { flex: 1; min-width: 180px; }
.mhero-name { font: 800 20px/1.3 var(--font); color: var(--ink); margin: 0 0 3px; }
.mhero-sub { font: 500 13px var(--font); color: var(--ink2); margin: 0; }
.mhero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.mtile { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 56px; }
.mtile b { display: block; font: 800 17px var(--font); color: var(--ink); }
.mtile span { font: 500 11px var(--font); color: var(--ink2); }
.mhero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.mhero-actions .btn { min-height: 44px; }
/* نوار کارت عضویت: QR + هویت + اشتراک/دانلود */
.mcard-band {
  display: flex; align-items: center; gap: 14px;
  margin-top: 14px;
  background: #101B2E;
  border-radius: 16px;
  padding: 12px 14px;
  color: #fff;
}
.mcard-qrbox { flex: none; background: #fff; border-radius: 12px; padding: 6px; display: grid; place-items: center; }
.mcard-qrbox .qr { width: 104px; height: 104px; display: block; }
.mcard-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mcard-brand { font: 600 11px var(--font); opacity: .72; }
.mcard-info b { font: 800 15px var(--font); }
.mcard-info > span:last-child { font: 500 12px var(--font); opacity: .8; }
.mcard-acts { display: flex; gap: 8px; flex: none; }
.mcard-acts .ibtn { width: 42px; height: 42px; background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .28); }
.mcard-acts .ibtn:hover { background: rgba(255, 255, 255, .24); }
.panel-danger { border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .05); }
@media (max-width: 700px) {
  .mhero { padding: 14px; }
  .mhero-stats { grid-template-columns: repeat(2, 1fr); }
  .mhero-name { font-size: 18.5px; }
  .mcard-band { flex-direction: column; text-align: center; }
  .mcard-info { align-items: center; }
  .mcard-acts { justify-content: center; }
}

/* حالت‌های تعاملی دکمه‌های آیکونی ردیف اعضا: hover رنگ هر عمل، کلیک پررنگ‌تر */
.mtd-actions .ibtn, .hcard-actions .ibtn { transition: color .15s ease-out, background-color .15s ease-out, border-color .15s ease-out, transform .12s ease-out; }
.mtd-actions .ibtn[data-act="in"]:hover { color: var(--in); border-color: var(--in); background: var(--in-bg); }
.mtd-actions .ibtn[data-act="in"]:active { color: #fff; background: var(--in); border-color: var(--in); transform: scale(.9); }
.mtd-actions .ibtn[data-act="renew"]:hover, .mtd-actions .ibtn[data-act="renew"].primary-act:hover { color: var(--accent); border-color: var(--accent); background: rgba(255, 77, 31, .1); }
.mtd-actions .ibtn[data-act="renew"]:active, .mtd-actions .ibtn[data-act="renew"].primary-act:active { color: #fff; background: var(--accent); border-color: var(--accent); transform: scale(.9); }
.mtd-actions .ibtn[data-act="qa"]:hover { color: #7c3aed; border-color: #7c3aed; background: rgba(124, 58, 237, .09); }
.mtd-actions .ibtn[data-act="qa"]:active { color: #fff; background: #7c3aed; border-color: #7c3aed; transform: scale(.9); }

/* ═══════════ v36 — حسابداری اعضا (دفتر تفصیلی) + توقف عضویت ═══════════ */
.mtile.tile-out { border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .06); }
.mtile.tile-in { border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .06); }
.stampchip.is-susp, .badge.is-susp { background: rgba(59, 130, 246, .13); color: #3b82f6; border-color: rgba(59, 130, 246, .3); }
.chip.is-susp { color: #3b82f6; }
/* بنر توقف عضویت در هیرو */
.susp-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: rgba(59, 130, 246, .08);
  border: 1px solid rgba(59, 130, 246, .3);
  border-radius: 12px; padding: 12px 14px; margin-top: 14px;
}
.susp-banner .ic { width: 22px; height: 22px; flex: none; color: #3b82f6; }
.susp-txt { flex: 1; min-width: 180px; }
.susp-txt b { display: block; font: 800 14px var(--font); color: #3b82f6; }
.susp-txt span { font: 500 12px var(--font); color: var(--ink2); }
/* بنر ماندهٔ حساب در صورت‌حساب عضو */
.bal-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px;
  margin-bottom: 12px; background: var(--surface);
}
.bal-banner.is-out { border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .05); }
.bal-banner.is-in { border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .05); }
.bal-main { display: flex; flex-direction: column; gap: 2px; }
.bal-lbl { font: 500 12px var(--font); color: var(--ink2); }
.bal-val { font: 800 17px var(--font); color: var(--ink); }
/* کاشی‌ها و ردیف‌های دفتر تفصیلی */
.led-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.led-account { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); margin-bottom: 8px; overflow: hidden; }
.led-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; background: none; border: 0; text-align: right; cursor: pointer;
  font-family: var(--font); min-height: 44px; transition: background-color .15s ease-out;
}
.led-row:hover { background: var(--bg2); }
.led-row .avatar {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; color: var(--accent);
}
.led-row .led-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.led-row .led-main b { font: 700 14px var(--font); color: var(--ink); }
.led-row .led-main .led-sub { font: 500 12px var(--font); color: var(--ink2); }
.led-row .led-t { font: 800 13px var(--font); color: var(--ink); white-space: nowrap; }
.led-panel { padding: 4px 12px 12px; border-top: 1px dashed var(--line); }
.led-panel .f-row3 { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; }
.led-panel .form { padding-top: 6px; }
/* پیش‌نمایش ماندهٔ فرم عضو */
.mf-bal-preview {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--bg2); border: 1px dashed var(--line); border-radius: 12px;
  padding: 10px 14px; margin: 10px 0;
}
.mf-bal-preview span { font: 500 12px var(--font); color: var(--ink2); }
.mf-bal-preview b { font: 800 14px var(--font); color: var(--ink); }
.mf-bal-preview b.is-out { color: var(--out); }
.mf-bal-preview b.is-in { color: var(--in); }
.mf-return-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-top: 10px; }
@media (max-width: 700px) {
  .led-tiles { grid-template-columns: 1fr; }
  .bal-banner { flex-direction: column; align-items: stretch; }
}

/* ═══════════ v37 — لیست‌باکس مشترک + دفتر مالی بازنویسی‌شده + عکس عضو ═══════════ */
/* ---------- لیست‌باکس (کامپوننت مشترک) ---------- */
.lb { position: relative; display: inline-flex; min-width: 140px; }
.lb-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 44px; padding: 8px 12px; width: 100%;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  font: 600 13px var(--font); color: var(--ink); cursor: pointer;
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}
.lb-trigger:hover { background: var(--bg2); }
.lb-trigger.open, .lb-trigger:focus-visible { border-color: var(--accent); outline: 2px solid rgba(249, 115, 22, .25); outline-offset: 1px; }
.lb-val { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.lb-val .ic { width: 15px; height: 15px; color: var(--accent); }
.lb-val.is-empty { color: var(--ink2); font-weight: 500; }
.lb-chev .ic { width: 16px; height: 16px; color: var(--ink2); transition: transform 150ms ease-out; }
.lb-trigger.open .lb-chev .ic { transform: rotate(180deg); }
.lb-panel {
  position: absolute; top: calc(100% + 6px); right: 0; left: auto; min-width: 200px; width: max-content; max-width: 320px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 4px 16px rgba(28, 25, 23, .12);
  padding: 6px; z-index: 60;
}
.lb-panel:focus { outline: none; }
.lb-search { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; color: var(--ink2); }
.lb-search .ic { width: 15px; height: 15px; }
.lb-search input { border: 0; outline: none; background: none; font: 500 13px var(--font); color: var(--ink); width: 100%; min-height: 32px; }
.lb-opts { max-height: 260px; overflow-y: auto; }
.lb-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  min-height: 44px; padding: 8px 10px; border: 0; background: none; border-radius: 8px;
  font: 600 13px var(--font); color: var(--ink); cursor: pointer; text-align: right;
  transition: background-color 120ms ease-out;
}
.lb-opt:hover, .lb-opt:focus-visible { background: var(--bg2); outline: none; }
.lb-opt.active { background: rgba(249, 115, 22, .1); color: var(--accent); }
.lb-opt-ic .ic { width: 15px; height: 15px; color: var(--ink2); }
.lb-opt.active .lb-opt-ic .ic { color: var(--accent); }
.lb-opt-l { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-opt-check .ic { width: 15px; height: 15px; color: var(--accent); }
.lb-empty { padding: 14px; text-align: center; font: 500 12px var(--font); color: var(--ink2); }
/* ---------- کاشی‌های فشردهٔ ۴تایی ---------- */
.tiles-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.tile-mini {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 14px; min-height: 62px;
}
.tile-mini b { font: 800 17px var(--font); color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tile-mini span { font: 500 11px var(--font); color: var(--ink2); }
.tile-mini.is-out { border-color: rgba(239, 68, 68, .35); background: rgba(239, 68, 68, .05); }
.tile-mini.is-in { border-color: rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .05); }
@media (max-width: 760px) { .tiles-mini { grid-template-columns: repeat(2, 1fr); } }
/* ---------- toolbar + کارت لیست مالی ---------- */
.fin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.fin-toolbar .searchbar { flex: 1; min-width: 220px; }
.finlist {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 6px 0 8px; margin-bottom: 14px; overflow: hidden;
}
.finlist-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--bg2);
}
.finlist-title { display: flex; flex-direction: column; gap: 1px; }
.finlist-title b { font: 800 14px var(--font); color: var(--ink); }
.finlist-title span { font: 500 12px var(--font); color: var(--ink2); }
.finlist-meta { display: flex; align-items: baseline; gap: 10px; }
.finlist-meta span { font: 500 12px var(--font); color: var(--ink2); }
.finlist-meta b { font: 800 14px var(--font); color: var(--accent); font-variant-numeric: tabular-nums; }
.fin-row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 16px; background: none; border: 0; text-align: right; cursor: pointer;
  font-family: var(--font); min-height: 56px; transition: background-color 120ms ease-out;
}
button.fin-row:hover { background: var(--bg2); }
.fin-row.is-static { cursor: default; }
.fin-row .avatar { width: 40px; height: 40px; flex: none; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; color: var(--accent); font: 800 15px var(--font); }
.fin-row .avatar.is-img, img.avatar.is-img, img.mhero-avatar.is-img { object-fit: cover; color: unset; }
img.avatar.is-img { display: block; }
.fin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fin-main b { font: 700 13px var(--font); color: var(--ink); }
.fin-main .fin-sub { font: 500 12px var(--font); color: var(--ink2); }
.fin-amt { font: 800 14px var(--font); color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fin-amt.is-out { color: var(--out); }
.fin-amt.is-in { color: var(--in); }
.chip-mini { display: inline-block; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font: 600 11px var(--font); color: var(--ink2); font-style: normal; }
.fin-rowpanel { padding: 4px 16px 14px; border-top: 1px dashed var(--line); }
.fin-rowpanel .f-row3 { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 8px; }
.fin-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 900px) { .fin-duo { grid-template-columns: 1fr; } }
/* ---------- کارت مشترک غنی ---------- */
#fin-totalcard { display: block; }
.ftc-head { display: flex; flex-direction: column; gap: 1px; margin-bottom: 8px; }
.ftc-title { font: 800 13px var(--font); color: var(--ink); }
.ftc-sub { font: 500 11px var(--font); color: var(--ink2); }
.ftc-main { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ftc-main b { font: 800 24px var(--font); color: var(--ink); font-variant-numeric: tabular-nums; }
.ftc-main span { font: 500 12px var(--font); color: var(--ink2); }
.ftc-main.is-in b { color: var(--in); }
.ftc-main.is-out b { color: var(--out); }
.ftc-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ftc-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font: 600 11px var(--font); color: var(--ink2); font-variant-numeric: tabular-nums; }
.ftc-chip .ic { width: 12px; height: 12px; }
.ftc-chip.is-in { color: var(--in); border-color: rgba(34, 197, 94, .3); background: rgba(34, 197, 94, .06); }
.ftc-chip.is-out { color: var(--out); border-color: rgba(239, 68, 68, .3); background: rgba(239, 68, 68, .06); }
/* ---------- عکس عضو ---------- */
.mf-photo-row { display: flex; gap: 14px; align-items: center; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; }
.mf-photo-prev { width: 72px; height: 72px; flex: none; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink2); }
.mf-photo-prev img { width: 100%; height: 100%; object-fit: cover; }
.mf-photo-prev .ic { width: 26px; height: 26px; }
.mf-photo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.mhero-avatar.is-img { display: block; }
/* ---------- QR پنل + کارت صدور NFC ---------- */
.qr-panel { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mcard-qrbox.big { width: 190px; height: 190px; }
.mcard-qrbox.big canvas { width: 100%; height: 100%; }
.sec-title.sub { margin-top: 14px; font-size: 12px; color: var(--ink2); }
.nfc-issue-card .actions-row { margin-top: 10px; }
/* ---------- لیست‌باکس‌های نوار سوابق ---------- */
.histbar-lb .lb { min-width: 130px; }

/* v37-fix — یکنواختی کاشی خنثی + سرستون ستونی لیست حساب + فایل‌پیکر سفارشی */
.tile-mini:not(.is-out):not(.is-in) { border-color: rgba(249, 115, 22, .22); background: rgba(249, 115, 22, .05); }
.fin-cols-head {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px;
  padding: 6px 16px; border-bottom: 1px solid var(--line);
  font: 600 11px var(--font); color: var(--ink2);
  background: var(--surface);
}
.is-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* v37-fix2 — هدف لمسی ۴۴px برای دکمه‌های آیکونی داخل ردیف‌های مالی */
.fin-row .ibtn, .ledger-row .ibtn { min-width: 44px; min-height: 44px; }

/* ═══ v38 — بوفه بازنویسی‌شده ═══ */
.finlist-head.plain { margin: -12px -12px 8px; border-radius: 12px 14px 0 0; }
.finlist-body.pad { padding: 14px 16px; }
.fin-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.cart-row .cart-qty { display: flex; align-items: center; gap: 8px; flex: none; }
.cart-row .cart-qty b { min-width: 22px; text-align: center; font: 800 14px var(--font); font-variant-numeric: tabular-nums; }
.avatar.menu-emoji { font-size: 17px; line-height: 1; }
.pos-item .is-low { color: var(--out); }
.pos-item.is-out { opacity: .55; }
.finlist.cafe-ftc .finlist-body { background: var(--surface); }

/* v38-fix — گارد موبایل برای مودال تأیید */
.dlg-box { max-width: calc(100vw - 32px); }
.dlg-root { position: fixed; inset: 0; }

/* v38-fix2 — ردیف‌های مالی/بوفه در موبایل: بدون سرریز افقی */
@media (max-width: 760px) {
  .fin-row { flex-wrap: wrap; row-gap: 4px; padding: 10px 12px; gap: 8px; }
  .fin-row .fin-main { flex: 1 1 auto; min-width: 0; }
  .fin-row .fin-main .fin-sub { display: none; }
  .fin-row .avatar { width: 36px; height: 36px; }
  .fin-row .fin-amt { margin-inline-start: auto; }
  .fin-row .rep-bar { flex: 1 1 100%; order: 5; }
  .fin-toolbar .lb { flex: 1 1 auto; }
  .fin-cols-head { display: none; }
}
.fin-row .rep-bar { flex: 1 1 120px; min-width: 0; max-width: 420px; }

/* v38-fix3 — ردیف‌های مالی: بریدگی لبه در تب گزارش (box-sizing صریح + clamp متن) */
.fin-row { box-sizing: border-box; max-width: 100%; }
.fin-main { min-width: 0; max-width: 100%; }
.fin-main b, .fin-main .fin-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ═══ v39 — یکسانی ابعاد همهٔ منوهای مالی و بوفه با مرجع «تب لیست اعضا» ═══
   مرجع اندازه‌گیری‌شده: .kpi-mini (h37 · pad 9/10 · radius 11 · b 15 · span 600-11 · gap 8 شبکه)
   ردیف مرجع: .mtable-row (h58 · pad 9/14 · gap 8) · آواتار 36 · ibtn 34 · سرستون pad 8/14 */
.tiles-mini { gap: 8px; margin-bottom: 12px; }
.tile-mini {
  flex-direction: row; align-items: center; justify-content: center; gap: 7px; min-width: 0;
  padding: 9px 10px; border: 1.5px solid var(--line); border-radius: 12px; min-height: 0;
}
.tile-mini b { font: 800 15px/1 var(--font); font-variant-numeric: tabular-nums; flex: none; }
.tile-mini span {
  font: 600 11px var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.finlist { margin-bottom: 8px; }
.finlist-head { padding: 8px 14px; gap: 8px; }
.finlist-title { gap: 1px; }
.finlist-title b { font: 800 13px var(--font); }
.finlist-title span { font: 500 11px var(--font); }
.finlist-meta { gap: 8px; }
.finlist-meta span { font: 500 11px var(--font); }
.finlist-meta b { font: 800 13px var(--font); }
.fin-row { padding: 9px 14px; min-height: 58px; gap: 8px; }
.fin-row .avatar { width: 36px; height: 36px; border-radius: 50%; font-size: 13px; }
.fin-row .avatar.menu-emoji { font-size: 16px; }
.fin-row .ibtn, .ledger-row .ibtn { min-width: 34px; min-width: 34px; width: 34px; height: 34px; min-height: 34px; padding: 1px 6px; border-radius: 12px; }
.fin-row .fin-amt { font-size: 13px; }
.fin-cols-head { padding: 8px 14px; font: 700 12px var(--font); }
/* جستجوی toolbar — هم‌اندازهٔ جستجوی اعضا */
.fin-toolbar { gap: 8px; margin-bottom: 12px; }
.fin-toolbar .searchbar {
  flex: 1; min-width: 200px; display: flex; align-items: center; height: 42px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 12px;
}
.fin-toolbar .searchbar .f-input {
  border: none; background: none; padding: 0; height: 100%; min-height: 0;
  font: 500 15px var(--font);
}
.fin-toolbar .searchbar .f-input:focus { box-shadow: none; }
/* لیست‌باکس — هم‌اندازهٔ فیلدهای فرم (42) */
.lb-trigger { min-height: 42px; padding: 7px 12px; font-size: 13px; }
/* سگمنت و دکمهٔ کامل — فشرده مثل مرجع */
.seg-btn { padding: 9px 10px; font: 700 13px var(--font); min-height: 42px; }
.btn-block { padding: 10px 14px; min-height: 44px; }
/* کارت مشترک گزارش — هم‌مقیاس کاشی مرجع */
.ftc-main b { font-size: 16px; }
.ftc-head .ftc-title { font-size: 13px; }
.ftc-head .ftc-sub { font-size: 11px; }
.ftc-chip { padding: 5px 10px; font: 700 11px var(--font); }
/* POS بوفه — فشرده و هم‌راستا */
.pos-grid { gap: 8px; }
.pos-item { padding: 10px 12px; border-radius: 12px; border-width: 1.5px; }
@media (max-width: 760px) {
  .tile-mini { justify-content: flex-start; }
}

/* ═══ v39-b — سبد فروش بازنویسی‌شده (کامپکت و تمیز) ═══ */
.cart-panel { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cart-top { display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px; border-bottom: 1.5px solid var(--line); }
.cart-top-t { display: inline-flex; align-items: center; gap: 6px; font: 800 13px var(--font); color: var(--ink); }
.cart-top-t .ic { width: 15px; height: 15px; color: var(--accent); }
.cart-count { font: 600 12px var(--font); color: var(--ink2); background: var(--bg2); border-radius: 999px; padding: 3px 9px; }
.cart-sum-b { font: 800 14px var(--font); color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-items { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto; }
.cart-row { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1.5px dashed var(--line); }
.cart-row:last-child { border-bottom: 0; }
.cart-name { flex: 1; min-width: 0; font: 700 13px var(--font); color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-unit { font: 500 11px var(--font); color: var(--ink2); font-style: normal; }
.cart-qty { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.cart-qty b { font: 800 13px var(--font); min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.cart-qty .ibtn.small { width: 28px; height: 28px; min-width: 28px; min-height: 28px; }
.cart-sum { font: 800 12px var(--font); color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cart-empty-hint { font: 500 12px var(--font); color: var(--ink2); padding: 6px 2px; }
.cart-when { display: flex; align-items: center; gap: 8px; background: var(--bg2); border-radius: 12px; padding: 8px 12px; }
.cart-when-lbl { display: inline-flex; align-items: center; gap: 5px; font: 600 12px var(--font); color: var(--ink2); flex: none; }
.cart-when-lbl .ic { width: 13px; height: 13px; }
.cart-when b { font: 700 12px var(--font); color: var(--ink); font-variant-numeric: tabular-nums; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-when-edit { background: none; border: 0; color: var(--accent); font: 700 12px var(--font); cursor: pointer; padding: 4px 6px; border-radius: 8px; flex: none; }
.cart-when-edit:hover { background: rgba(249, 115, 22, .1); }
.cart-when-box { background: var(--bg2); border-radius: 12px; padding: 10px 12px 6px; }
.cart-when-box .f-hint { margin: 2px 0 6px; }
.cart-v39 .seg { flex: none; }
.cart-v39 .f-label { margin: 2px 0 -4px; }
@media (max-width: 760px) {
  .cart-items { max-height: 220px; }
  .cart-panel { position: static; }
}

/* v39-fix — سرستون جدول اعضا همیشه هم‌عرض جدول (بدون بیرون‌زدگی ستون‌ها از خود سرستون) */
.mtable-head { min-width: 920px; box-sizing: border-box; }
.mtable-row { box-sizing: border-box; }

/* v39-fix2 — دقت میلیمتری نهایی نسبت به مرجع اعضا */
.fin-row .avatar { width: 34px; height: 34px; }              /* + border 1px = 36 مثل اعضا */
.finlist-head { padding: 6px 14px; }
.finlist-title { gap: 0; }
.finlist-title b { font-size: 12px; }
.finlist-title span { font-size: 11px; }
.finlist-meta b { font-size: 12px; }
.finlist-meta span { font-size: 11px; }
.fin-toolbar .searchbar { height: 42px; }

/* v39-fix3 — دقت نهایی: جستجو 42 دقیق، سرستون نزدیک مرجع */
.fin-toolbar .searchbar { box-sizing: border-box; height: 42px; }
.finlist-head { padding: 5px 14px; }
.finlist-title b, .finlist-meta b { line-height: 1.25; }
.finlist-title span, .finlist-meta span { line-height: 1.2; }
.finlist-head { padding: 7px 14px; }

/* ═══ v40 — لایهٔ کنترل‌ها و فشرده‌سازی باکس‌ها (تیم UI) ═══ */
/* هدف لمسی WCAG: radio/checkbox درشت و قابل‌کلیک */
input[type="radio"] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; cursor: pointer; }
input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); flex: none; cursor: pointer; vertical-align: middle; }
label:has(> input[type="radio"]), label:has(> input[type="checkbox"]) {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer;
}
.rm-row input[type="checkbox"] { width: 24px; height: 24px; }
/* دکمه‌های غول داشبورد و کارت من — ۶۰ به ۴۸ */
[data-page="gate"] .btn, [data-page="card"] .btn { min-height: 48px; padding: 11px 16px; font-size: 15px; }
[data-page="gate"] .btn .ic, [data-page="card"] .btn .ic { width: 16px; height: 16px; }
/* تنظیمات: textarea و فرم فشرده‌تر — نه بلند بی‌دلیل */
.panel textarea.f-input { min-height: 96px; }
[data-page="settings"] .panel { padding: 16px; }
/* roadmap: ردیف‌ها با فاصلهٔ نفس‌دار اما نه حجیم */
[data-page="roadmap"] .panel { padding: 14px 16px; }
[data-page="roadmap"] .filterline { gap: 8px; }
[data-page="roadmap"] label { font-size: 12px; }
/* ذرات باقی‌ماندهٔ مقیاس → نزدیک‌ترین پله */
.fin-sec { font-size: 11px; }
.mhero-avatar.is-img, .avatar.is-img { font-size: 13px; }
/* چیپ‌های وضعیت صفحهٔ اعضا — هم‌قرارداد با کاشی مرجع ۳۷ */
.mstats { gap: 8px; }
/* هماهنگی سرریز متن فارسی */
.fin-main b, .cart-name, .mtd-name b, .mth-sort { text-wrap: nowrap; }
.page-top-t b, .finlist-title b, .cart-top-t { text-wrap: balance; }
.checkline input[type="checkbox"] { width: 24px; height: 24px; }

/* ═══════════ v41 — گزارش فعالیت (پرت از golshani als-/al-) + نشست‌ها + پرمیشن آکاردئونی ═══════════ */
.als-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.als-kpis-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.als-kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 13px; box-shadow: var(--sh-1); display: flex; align-items: center; gap: 10px;
  transition: all .2s ease;
}
.als-kpi:hover { transform: translateY(-1px); border-color: var(--accent); }
.als-kpi-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.als-kpi.teal   .als-kpi-icon { background: rgba(14,138,92,.12);  color: #0E8A5C; }
.als-kpi.purple .als-kpi-icon { background: rgba(109,40,217,.10); color: #6D28D9; }
.als-kpi.green  .als-kpi-icon { background: rgba(14,138,92,.12);  color: #0E8A5C; }
.als-kpi.red    .als-kpi-icon { background: rgba(201,51,51,.12);  color: #C93333; }
.als-kpi.amber  .als-kpi-icon { background: rgba(180,83,9,.12);   color: #B45309; }
.als-kpi.blue   .als-kpi-icon { background: rgba(3,105,161,.12);  color: #0369A1; }
.als-kpi.today  .als-kpi-icon { background: rgba(255,77,31,.12);  color: var(--accent); }
.als-kpi-value { font-size: 1.2rem; font-weight: 800; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.als-kpi-label { font-size: .68rem; color: var(--ink2); font-weight: 600; margin-top: 2px; }

.als-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }
.als-grid-1 { grid-template-columns: 1fr; }
.als-card { padding: 16px; min-width: 0; margin-bottom: 0; }
.als-card-title { font-size: .88rem; font-weight: 800; color: var(--ink); margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.als-card-title .ic { color: var(--accent); }
.als-card-sub { font-size: .68rem; color: var(--ink2); margin-bottom: 14px; }

/* روند میله‌ای ۱۴ روز */
.als-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.als-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.als-bar-wrap { width: 100%; max-width: 38px; height: 110px; display: flex; align-items: flex-end; }
.als-bar { width: 100%; border-radius: 6px 6px 3px 3px; min-height: 3px; position: relative; background: linear-gradient(180deg, #FF4D1F, #D93D12); transition: all .25s ease; }
.als-bar:hover { filter: brightness(1.1); box-shadow: 0 0 10px rgba(255,77,31,.35); }
.als-bar-value { position: absolute; top: -18px; right: 50%; transform: translateX(50%); font-size: .6rem; font-weight: 800; color: var(--ink2); white-space: nowrap; }
.als-bar-label { font-size: .58rem; color: var(--ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.als-bar-label.today { color: var(--accent); font-weight: 800; }

/* رتبه‌بندی با مدال */
.als-rank { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.als-rank:last-child { border-bottom: none; }
.als-rank-num { width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: .68rem; font-weight: 800; background: rgba(255,77,31,.09); color: var(--accent); }
.als-rank-num .ic { width: 14px; height: 14px; }
.als-rank-num.r1 { background: linear-gradient(135deg,#F59E0B,#D97706); color: #fff; }
.als-rank-num.r2 { background: linear-gradient(135deg,#94A3B8,#64748B); color: #fff; }
.als-rank-num.r3 { background: linear-gradient(135deg,#D97706,#B45309); color: #fff; }
.als-rank-body { flex: 1; min-width: 0; }
.als-rank-name { font-size: .76rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.als-rank-bar { height: 4px; border-radius: 4px; background: var(--line); margin-top: 4px; overflow: hidden; }
.als-rank-bar-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #FF4D1F, #6D28D9); }
.als-rank-count { font-size: .78rem; font-weight: 800; color: var(--ink); white-space: nowrap; }

/* توزیع رویداد */
.als-dist-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.als-dist-label { width: 130px; font-size: .7rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; display: flex; align-items: center; gap: 4px; }
.als-dist-label .ic { width: 13px; height: 13px; flex-shrink: 0; }
.als-dist-track { flex: 1; height: 18px; border-radius: 6px; background: var(--bg2); overflow: hidden; }
.als-dist-fill { height: 100%; border-radius: 6px; display: flex; align-items: center; justify-content: flex-end; padding-left: 8px; min-width: 30px; transition: width .4s ease; }
.als-dist-count { font-size: .62rem; font-weight: 800; color: #fff; }
.als-dist-pct { width: 44px; font-size: .64rem; color: var(--ink2); font-weight: 700; text-align: left; }

/* ساعات فعالیت */
.als-hours { display: flex; gap: 3px; align-items: flex-end; height: 90px; }
.als-hour-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.als-hour-wrap { width: 100%; height: 64px; display: flex; align-items: flex-end; }
.als-hour-bar { width: 100%; border-radius: 4px 4px 2px 2px; min-height: 2px; background: linear-gradient(180deg, #7C3AED, #4C1D95); transition: all .25s ease; }
.als-hour-bar.peak { background: linear-gradient(180deg, #F59E0B, #B45309); }
.als-hour-label { font-size: .52rem; color: var(--ink2); font-variant-numeric: tabular-nums; }

/* جدول ناموفق‌ها */
.als-table { width: 100%; border-collapse: collapse; }
.als-table th { text-align: right; font-size: .66rem; font-weight: 800; color: var(--ink2); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.als-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-size: .74rem; color: var(--ink); vertical-align: middle; }
.als-table tr:last-child td { border-bottom: none; }

/* ═══ گزارش رویدادها (al-) ═══ */
.al-filters { padding: 12px 14px; }
.al-chiprow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; }
.al-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.al-filterrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.al-filterrow .f-select { width: auto; min-width: 130px; }
.al-search { flex: 1; min-width: 160px; display: flex; align-items: center; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; }
.al-search .ic { color: var(--ink2); width: 15px; height: 15px; }
.al-search input { border: none; background: none; flex: 1; padding: 8px 0; font-family: inherit; font-size: .8rem; color: var(--ink); outline: none; }
.al-count { font-size: .72rem; font-weight: 800; color: var(--ink2); white-space: nowrap; }
.al-list { padding: 0 !important; overflow: hidden; }
.al-row { border-bottom: 1px solid var(--line); }
.al-row:last-child { border-bottom: none; }
.al-row-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.al-row-head:hover { background: var(--bg); }
.al-ic { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.al-ic .ic { width: 17px; height: 17px; }
.al-main { flex: 1; min-width: 0; }
.al-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.al-title b { font-size: .8rem; color: var(--ink); }
.al-desc { font-size: .72rem; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.al-sub { display: flex; gap: 10px; margin-top: 3px; font-size: .68rem; color: var(--ink2); align-items: center; }
.al-user { display: inline-flex; align-items: center; gap: 4px; }
.al-user .ic { width: 12px; height: 12px; }
.al-mod { background: var(--bg2); border-radius: 6px; padding: 1px 7px; font-weight: 700; }
.al-time { text-align: left; font-size: .7rem; color: var(--ink2); font-weight: 700; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.al-time small { display: block; font-weight: 600; opacity: .8; }
.al-caret { color: var(--ink2); transition: transform .2s; flex-shrink: 0; }
.al-row.open .al-caret { transform: rotate(180deg); }
.al-detail { display: none; padding: 0 14px 12px 60px; gap: 6px; flex-wrap: wrap; }
.al-detail.open { display: flex; }
.al-meta-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; color: var(--ink2); }
.al-meta-chip .ic { width: 12px; height: 12px; }
.al-empty { padding: 34px 10px; text-align: center; color: var(--ink2); }
.al-empty .ic { width: 30px; height: 30px; opacity: .35; }
.al-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; font-size: .78rem; color: var(--ink2); }

/* ═══ نشست‌های فعال ═══ */
.sess-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.sess-row:last-child { border-bottom: none; }
.sess-ic { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,77,31,.1); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.sess-main { flex: 1; min-width: 0; }
.sess-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sess-t b { font-size: .82rem; color: var(--ink); }
.sess-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line); display: inline-block; }
.sess-dot.on { background: #0E8A5C; box-shadow: 0 0 6px rgba(14,138,92,.5); }
.sess-s { font-size: .7rem; color: var(--ink2); margin-top: 3px; }

/* ═══ پرمیشن آکاردئونی (الگوی golshani _permissions_component) ═══ */
.pm-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pm-quick { display: flex; gap: 6px; }
.pm-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.pm-card { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.pm-card-head { display: flex; align-items: center; gap: 9px; padding: 9px 12px; cursor: pointer; user-select: none; }
.pm-card-head:hover { background: var(--bg2); }
.pm-arrow { color: var(--ink2); transition: transform .2s; display: flex; }
.pm-card.open .pm-arrow { transform: rotate(180deg); }
.pm-ic { color: var(--accent); display: flex; }
.pm-ic .ic { width: 16px; height: 16px; }
.pm-title { flex: 1; font-size: .82rem; font-weight: 700; color: var(--ink); }
.pm-badge { font-size: .62rem; padding: 2px 9px; border-radius: 999px; font-weight: 800; }
.pm-badge.is-in { background: var(--in-bg); color: var(--in); }
.pm-badge.is-muted { background: var(--bg2); color: var(--ink2); }
.pm-card-body { display: none; padding: 10px 14px; border-top: 1px solid var(--line); }
.pm-card.open .pm-card-body { display: block; }
.pm-desc { display: block; font-size: .68rem; color: var(--ink2); margin-top: 6px; }
.pm-card.open .pm-card-head { background: var(--bg2); }

/* ═══ تغییر رمز ═══ */
.pw-meter { height: 6px; background: var(--bg2); border-radius: 6px; margin: 6px 0 4px; position: relative; overflow: hidden; }
.pw-bar { height: 100%; width: 6%; border-radius: 6px; background: var(--out); transition: all .25s ease; }
.pw-bar[data-level="2"], .pw-bar[data-level="3"] { background: var(--warn); }
.pw-bar[data-level="3"] { width: 75% !important; }
.pw-bar[data-level="4"] { background: var(--in); width: 100% !important; }
.pw-txt { font-size: .66rem; color: var(--ink2); font-weight: 700; }
.pw-bar:not([data-level]):empty + .pw-txt, .pw-bar[data-level=''] { background: var(--line); }
.pw-tips { background: linear-gradient(135deg, rgba(201,51,51,.05), rgba(180,83,9,.05)); }
.req { color: var(--out); }

@media (max-width: 992px) { .als-grid { grid-template-columns: 1fr; } }
@media (max-width: 576px) { .als-kpis { grid-template-columns: 1fr 1fr; } .als-kpis-4 { grid-template-columns: 1fr 1fr; } .al-time small { display: none; } }

/* ═══════════ v42 — کاربران و دسترسی‌ها (الگوی golshani /users) ═══════════ */
.stampchip.is-warn { color: var(--warn); background: var(--warn-bg, rgba(180,83,9,.12)); border-color: rgba(180,83,9,.25); }
.uc-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.uc-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.uc-toolbar .al-search { flex: 1; min-width: 200px; }
.uc-toolbar .al-search input { padding: 10px 0; }
.uc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.uc-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  padding: 14px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--sh-1);
  transition: all .2s ease; min-width: 0;
}
.uc-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.uc-card.is-susp { background: var(--bg); border-style: dashed; }
.uc-top { display: flex; align-items: flex-start; gap: 10px; }
.uc-avatar {
  width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #D93D12); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem; font-weight: 800;
}
.uc-card.is-susp .uc-avatar { background: linear-gradient(135deg, #94A3B8, #64748B); }
.uc-who { flex: 1; min-width: 0; }
.uc-who b { display: block; font-size: .92rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.uc-who code { font-size: .72rem; color: var(--ink2); background: var(--bg2); border-radius: 6px; padding: 1px 7px; display: inline-block; margin-top: 3px; }
.uc-top > .stampchip { flex-shrink: 0; }
.uc-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.uc-badges .stampchip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 9px; font-size: .66rem; font-weight: 800; }
.uc-badges .ic { width: 12px; height: 12px; }
.uc-foot { margin-top: auto; display: flex; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; align-items: center; }
.uc-foot .uc-edit { flex: 1; }
.uc-foot .btn-ghost { flex: 0 0 auto; padding: 7px 10px; }
.uc-foot .uc-del { color: var(--out); }

/* صفحات unew/uedit */
#unew-page .actions-row, #uedit-page .actions-row { margin-top: 4px; }

/* ═══════════ v43 — ادیتور پرمیشن ریز (افزودن به‌جای روشن/خاموش) ═══════════ */
.pm-granted { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pg-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 12px; min-width: 0;
}
.pg-main { flex: 1; min-width: 0; }
.pg-main b { font-size: .82rem; color: var(--ink); display: block; margin-bottom: 4px; }
.pg-subs { display: flex; flex-wrap: wrap; gap: 5px; }
.pg-subs .stampchip { font-size: .62rem; padding: 2px 8px; border-width: 1px; }
.pg-del { color: var(--out); flex-shrink: 0; }
.pm-empty {
  display: flex; align-items: center; gap: 10px; color: var(--ink2);
  border: 1px dashed var(--line); border-radius: 11px; padding: 14px 12px;
  font-size: .78rem; background: var(--bg);
}
.pm-empty .ic { width: 16px; height: 16px; opacity: .5; flex-shrink: 0; }
.ps-row { border: 1px solid var(--line); border-radius: 11px; margin-bottom: 8px; background: var(--surface); overflow: hidden; }
.ps-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; background: none; border: none; cursor: pointer; text-align: start;
  font-family: var(--font);
}
.ps-head:hover { background: var(--bg); }
.ps-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ps-t b { font-size: .82rem; color: var(--ink); }
.ps-t span { font-size: .68rem; color: var(--ink2); }
.ps-arrow { color: var(--ink2); transition: transform .2s; display: flex; }
.ps-arrow .ic { width: 14px; height: 14px; }
.ps-row.open .ps-arrow { transform: rotate(180deg); }
.ps-body { display: none; padding: 4px 12px 12px; border-top: 1px solid var(--line); }
.ps-body.open { display: block; }
.ps-subs { background: var(--bg); border-radius: 9px; padding: 4px 10px; margin: 6px 0; }
.ps-add { margin-top: 6px; }
.pm-ic { color: var(--accent); display: flex; flex-shrink: 0; }
.pm-ic .ic { width: 16px; height: 16px; }

/* ═══ v43 — کارت‌های سلامت امنیت ═══ */
.hp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.hp-card {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
  background: var(--bg);
}
.hp-card.ok { border-color: rgba(16, 163, 74, .3); background: var(--in-bg); }
.hp-card.bad { border-color: rgba(220, 38, 38, .3); background: var(--out-bg); }
.hp-ic { display: flex; flex-shrink: 0; margin-top: 2px; }
.hp-ic .ic { width: 16px; height: 16px; }
.hp-card.ok .hp-ic { color: var(--in); }
.hp-card.bad .hp-ic { color: var(--out); }
.hp-main { flex: 1; min-width: 0; }
.hp-main b { display: block; font-size: .8rem; color: var(--ink); margin-bottom: 3px; }
.hp-main span { font-size: .7rem; color: var(--ink2); line-height: 1.7; }
.hp-badge { font-size: .64rem; font-weight: 800; border-radius: 999px; padding: 2px 9px; flex-shrink: 0; }
.hp-card.ok .hp-badge { background: var(--in); color: #fff; }
.hp-card.bad .hp-badge { background: var(--out); color: #fff; }

/* ═══════════ v44 — حاضرین باشگاه + فیلترهای گزارش فعالیت + قفل پرمیشن ادمین ═══════════ */
.pr-wrap { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.pr-headrow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pr-headrow .sec-title { margin: 0; }
.pr-sub { font-size: .72rem; color: var(--ink2); }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.pr-card {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 13px; padding: 10px 12px;
  background: var(--surface); cursor: pointer; transition: border-color .15s, transform .15s;
  min-width: 0;
}
.pr-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.pr-photo {
  width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--bg); border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .82rem; color: var(--accent);
}
.pr-photo img { width: 100%; height: 100%; object-fit: cover; }
.pr-main { flex: 1; min-width: 0; }
.pr-main b { display: block; font-size: .82rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-main span { font-size: .68rem; color: var(--ink2); }
.pr-card .stampchip { flex-shrink: 0; }
.pr-warn {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--out-bg); color: var(--out); border: 1px solid rgba(220, 38, 38, .3);
  border-radius: 11px; padding: 9px 12px; font-size: .76rem; cursor: pointer;
  text-align: start; font-family: var(--font); width: 100%;
}
.pr-warn b { color: var(--out); }
.pr-warn span { color: var(--ink2); font-size: .7rem; }
.pr-empty {
  display: flex; align-items: center; gap: 10px; color: var(--ink2);
  border: 1px dashed var(--line); border-radius: 12px; padding: 14px;
  font-size: .78rem; background: var(--bg);
}
.pr-empty .ic { width: 16px; height: 16px; opacity: .5; flex-shrink: 0; }
.al-search-sm { flex-shrink: 0; }
.al-search-sm .f-input { width: 190px; min-width: 150px; }
.al-filterrow .histbar-lb { flex-shrink: 0; }
.al-drange {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  padding: 6px 10px; background: var(--bg); border-radius: 10px;
  border: 1px dashed var(--line);
}
.al-drange .histbar-date { width: 150px; }
.al-purge { color: var(--out); flex-shrink: 0; }
.pm-locked {
  display: flex; align-items: center; gap: 10px;
  background: var(--warn-bg, rgba(234, 146, 23, .1)); color: var(--ink2);
  border: 1px dashed var(--line); border-radius: 11px; padding: 12px;
  font-size: .76rem; margin-top: 8px;
}
.pm-locked .ic { width: 16px; height: 16px; color: var(--accent); flex-shrink: 0; }

/* ---------- پلن‌های ثبت‌نام و تمدید (v45) ---------- */
.plans-list { display: grid; gap: 10px; margin-top: 12px; }
.plan-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }
.plan-card.is-off { opacity: .5; }
.plan-main { min-width: 0; }
.plan-main b { display: block; font-size: 1rem; color: var(--ink); }
.plan-main span { color: var(--ink2); font-size: .85rem; }
.plan-badge { font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.plan-badge.is-on { background: var(--in-bg); color: var(--in); }
.plan-badge.is-off-b { background: var(--out-bg); color: var(--out); }
.plan-acts { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.plan-acts .btn { padding: 6px 10px; font-size: .82rem; }

/* ---------- پلن‌ها v46: جستجو/فیلتر + هیستوری ---------- */
.plans-toolbar { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: stretch; margin-bottom: 12px; }
.plans-search { position: relative; }
.plans-search .f-input { width: 100%; height: 44px; padding-right: 36px; margin: 0; }
.plans-search svg { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--ink2); pointer-events: none; }
.plans-toolbar .f-select { height: 44px; margin: 0; }
.plans-toolbar .btn { min-height: 44px; }
.plans-list .btn.is-danger { color: var(--out); }
.plan-card.is-del { opacity: .45; }
.plan-main .plan-badge { display: inline-block; margin-inline-start: 6px; vertical-align: middle; }
.plan-sub { color: var(--ink2); font-size: .78rem; }
.plan-hist-top { font-size: .9rem; color: var(--ink2); margin-bottom: 10px; }
.plan-hist-top b { color: var(--ink); }
.plan-hist { display: grid; }
.hist-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 2px; border-bottom: 1px dashed var(--line); }
.hist-row:last-child { border-bottom: 0; }
.hist-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; background: var(--ink2); }
.hist-dot.create, .hist-dot.resume, .hist-dot.restore { background: var(--in); }
.hist-dot.edit { background: var(--accent); }
.hist-dot.pause { background: var(--warn); }
.hist-dot.delete { background: var(--out); }
.hist-body b { display: block; font-size: .92rem; }
.hist-body span { color: var(--ink2); font-size: .8rem; }
.hist-body em { display: block; font-style: normal; color: var(--ink2); font-size: .82rem; }

/* ---------- v47: تولد سه‌قسمتی + باکس باز و بسته‌شوندهٔ بازگشت عضو حذف‌شده ---------- */
.birth3 { display: grid; grid-template-columns: 1.1fr 1.25fr 1fr; gap: 6px; }
.birth3 .f-input, .birth3 .f-select { height: 42px; margin: 0; }
details.mf-return-box { padding: 0 12px 12px; }
details.mf-return-box > summary { list-style: none; cursor: pointer; padding: 12px 0 10px; font-weight: 700; font-size: .9rem; color: var(--ink); display: flex; align-items: center; gap: 8px; user-select: none; }
details.mf-return-box > summary::-webkit-details-marker { display: none; }
details.mf-return-box > summary::after { content: '▾'; margin-inline-start: auto; color: var(--ink2); transition: transform .25s; }
details.mf-return-box[open] > summary::after { transform: rotate(180deg); }
details.mf-return-box .uidrow, details.mf-return-box .f-hint { margin-bottom: 8px; }

/* ---------- v51: داشبورد ورزشکار — بازطراحی حرفه‌ای (بازخورد کارفرما: سفیدِ تمیز به‌جای بلوک تیره) ---------- */
.ath-wrap { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; padding-bottom: 28px; }
.ath-hero { position: relative; background: var(--bg2); border: 1px solid var(--card-border); border-radius: var(--r-card); padding: 16px; box-shadow: var(--sh-1); overflow: hidden; }
.ath-hero::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 4px; background: var(--accent); }
.ath-hero.is-out::before { background: var(--out); }
.ath-hero.is-susp::before { background: var(--warn); }
.ath-hero-top { display: flex; align-items: center; gap: 12px; }
.ath-ava { width: 60px; height: 60px; border-radius: 20px; object-fit: cover; border: 2px solid var(--card-border); flex: none; }
.ath-ava-txt { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--bg2)); color: var(--accent); font-weight: 800; font-size: 1.3rem; }
.ath-hello { display: block; font-size: .8rem; font-weight: 700; color: var(--ink2); }
.ath-hero-id { flex: 1; min-width: 0; }
.ath-hero-id h2 { margin: 2px 0 7px; font-size: 1.3rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ath-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ath-chip { background: var(--line); color: var(--ink2); border-radius: 999px; padding: 3.5px 11px; font-size: .75rem; font-weight: 700; }
.ath-chip.stt-active { background: var(--in-bg); color: var(--in); }
.ath-chip.stt-expired { background: var(--out-bg); color: var(--out); }
.ath-chip.stt-suspended, .ath-chip.stt-deleted { background: var(--warn-bg); color: var(--out); }
.ath-ring { --p: 0; width: 66px; height: 66px; flex: none; border-radius: 50%; display: grid; place-items: center; align-content: center; background: radial-gradient(closest-side, var(--bg2) 73%, transparent 74%), conic-gradient(var(--accent) var(--p), var(--line) 0); }
.ath-ring b { font-size: 1rem; line-height: 1; color: var(--ink); }
.ath-ring span { font-size: .55rem; color: var(--ink2); line-height: 1.4; }
.ath-hero.is-out .ath-ring, .ath-hero.is-susp .ath-ring { background: radial-gradient(closest-side, var(--bg2) 73%, transparent 74%), conic-gradient(var(--out) var(--p), var(--line) 0); }
.ath-plan { margin: 13px 2px 0; font-size: .95rem; font-weight: 800; color: var(--ink); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.ath-plan i { font-style: normal; font-weight: 600; font-size: .76rem; color: var(--ink2); }
.ath-hero-actions { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ath-date { font-size: .74rem; color: var(--ink2); font-weight: 600; }
.ath-live-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 800; color: var(--in); background: var(--in-bg); border-radius: 999px; padding: 6px 12px; }
.ath-banner { display: flex; align-items: center; gap: 8px; border-radius: var(--r-card); padding: 12px 14px; font-size: .85rem; font-weight: 700; }
.ath-banner.is-out { background: var(--out-bg); color: var(--out); }
.ath-banner.is-susp { background: var(--warn-bg); color: var(--out); }
.ath-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ath-card { background: var(--bg2); border: 1px solid var(--card-border); border-radius: var(--r-card); padding: 13px 14px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 7px; transition: transform .15s, box-shadow .15s; }
@media (hover: hover) and (pointer: fine) { .ath-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); } }
.ath-k { display: flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--ink2); font-weight: 700; }
.ath-k svg { width: 15px; height: 15px; }
.ath-v { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.ath-v i { font-style: normal; font-size: .7rem; font-weight: 600; color: var(--ink2); }
.ath-v.is-out { color: var(--out); }
.ath-v.is-in { color: var(--in); }
.ath-v-dim { font-size: 1rem; }
.ath-note { font-size: .72rem; color: var(--ink2); line-height: 1.55; }
.ath-bar { height: 7px; border-radius: 99px; background: var(--line); overflow: hidden; }
.ath-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s; }

/* ---------- v51: پنل‌های فید ورزشکار ---------- */
.ath-cols { display: grid; grid-template-columns: 1fr; gap: 16px; }
.ath-panel { background: var(--bg2); border: 1px solid var(--card-border); border-radius: var(--r-card); box-shadow: var(--sh-1); overflow: hidden; }
.ath-p-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.ath-p-head .sec-title { margin: 0; border: 0; padding: 0; }
.ath-p-count { margin-inline-start: auto; font-size: .7rem; font-weight: 700; color: var(--ink2); background: var(--line); border-radius: 999px; padding: 2px 10px; }
.ath-rows { overflow: hidden; }
.ath-row { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--line); position: relative; }
.ath-row:last-child { border-bottom: none; }
.ath-row.is-new { animation: athNew 2.2s ease-out; }
@keyframes athNew { 0% { background: color-mix(in srgb, var(--in) 16%, transparent); } 100% { background: transparent; } }
.ath-row-ic { width: 36px; height: 36px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--line); color: var(--ink2); }
.ath-row-ic svg { width: 17px; height: 17px; }
.ath-row-ic.st-in { background: var(--in-bg); color: var(--in); }
.ath-row-ic.st-out { background: var(--out-bg); color: var(--out); }
.ath-row-ic.lg-ch { background: var(--out-bg); color: var(--out); }
.ath-row-ic.lg-in { background: var(--in-bg); color: var(--in); }
.ath-row-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ath-row-b b { font-size: .85rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ath-row-b span { font-size: .72rem; color: var(--ink2); }
.ath-row-am { font-size: .86rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.ath-row-am.lg-ch { color: var(--out); }
.ath-row-am.lg-in { color: var(--in); }
.ath-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; color: var(--ink2); text-align: center; }
.ath-empty svg { width: 26px; height: 26px; opacity: .6; }
.ath-empty p { margin: 0; font-size: .78rem; line-height: 1.7; }

/* ---------- v55: dock پایین ورزشکار — داشبورد | ترددها | اسکن (FAB فقط آیکن) | بوفه | مالی ---------- */
.ath-tabbar { position: fixed; bottom: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); inset-inline: 10px; z-index: 60; display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: end; gap: 4px; padding: 8px 8px 7px; border-radius: 26px; background: color-mix(in srgb, var(--bg2) 84%, transparent); backdrop-filter: blur(20px) saturate(1.2); -webkit-backdrop-filter: blur(20px) saturate(1.2); border: 1px solid var(--card-border); box-shadow: 0 14px 38px rgba(2, 8, 20, .18); }
.ath-tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px 5px; border-radius: 16px; background: none; border: none; color: var(--ink2); font: 700 .68rem var(--font); cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background .2s, color .2s; min-width: 56px; }
.ath-tab svg { width: 21px; height: 21px; }
.ath-tab.active { color: var(--accent); }
.ath-fab { display: flex; flex-direction: column; align-items: center; background: none; border: none; cursor: pointer; margin-top: -34px; padding: 0 4px; -webkit-tap-highlight-color: transparent; }
.ath-fab-c { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, var(--accent), color-mix(in srgb, var(--accent) 68%, #1e293b)); color: var(--on-accent, #fff); box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 45%, transparent), 0 0 0 4px color-mix(in srgb, var(--bg2) 90%, transparent); transition: transform .15s; }
.ath-fab-c svg { width: 34px; height: 34px; }
.ath-fab:active .ath-fab-c { transform: scale(.94); }
@media (min-width: 900px) { .ath-tabbar { display: none !important; } }
@media (max-width: 899px) { body.is-athlete #pages .page.active { padding-bottom: 116px; } }
@media (min-width: 900px) {
  .ath-wrap { max-width: 1080px; gap: 18px; }
  .ath-grid { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
  .ath-cols { grid-template-columns: 1fr 1fr; align-items: start; }
  .ath-ava { width: 68px; height: 68px; border-radius: 24px; }
  .ath-hero-id h2 { font-size: 1.45rem; }
  .ath-ring { width: 76px; height: 76px; }
  .ath-plan { font-size: 1rem; }
}

/* ---------- v51: دکمه‌های CTA هیرو ورزشکار ---------- */
.btn-scan { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px; background: var(--accent); color: var(--on-accent, #fff); font: 800 .9rem var(--font); cursor: pointer; transition: filter .15s, transform .12s; }
.btn-scan svg { width: 18px; height: 18px; }
.btn-scan:active { transform: scale(.97); }
.btn-scan.is-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--card-border); }
@media (hover: hover) and (pointer: fine) {
  .btn-scan:hover { filter: brightness(1.06); }
  .btn-scan.is-ghost:hover { filter: none; background: var(--line); }
}

/* عرض کامل قانون سایدبار: داشبورد ورزشکار، ۱۰۰٪ فضای روبه‌روی سایدبار — اسکن وسط‌چین می‌ماند */
@media (min-width: 1100px) {
  .ath-wrap { max-width: none; }
  .ath-grid { grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); }
  .ath-cols { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); align-items: start; }
}

/* ---------- v51: لایهٔ لایو — زرنگ‌نشان ادمین + پاپ‌آور رویدادها + پیل زنده ---------- */
.live-bell { position: relative; }
.live-badge { position: absolute; top: -3px; inset-inline-end: -3px; min-width: 17px; height: 17px; border-radius: 999px; background: var(--in); color: #fff; font: 800 10px var(--font); display: grid; place-items: center; padding: 0 4px; box-shadow: 0 0 0 2px var(--bg); }
.live-pop { position: fixed; top: 54px; inset-inline-end: 12px; width: min(330px, calc(100vw - 24px)); max-height: min(430px, 70vh); background: var(--bg2); border: 1px solid var(--card-border); border-radius: 16px; box-shadow: var(--sh-2); z-index: 90; display: none; flex-direction: column; overflow: hidden; }
.live-pop.open { display: flex; }
.live-pop-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.live-pop-head b { font-size: .88rem; color: var(--ink); margin-inline-end: auto; }
.live-pop-list { overflow-y: auto; padding: 4px 0; flex: 1; }
.live-pop-row { display: flex; align-items: center; gap: 9px; padding: 9px 14px; }
.live-pop-row + .live-pop-row { border-top: 1px solid var(--line); }
.live-pop-row b { font-size: .8rem; color: var(--ink); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pop-row > span { font-size: .72rem; color: var(--ink2); font-weight: 700; }
.live-pop-empty { padding: 22px 18px; font-size: .78rem; color: var(--ink2); line-height: 1.8; text-align: center; }
.live-pop-foot { border-top: 1px solid var(--line); padding: 8px; }
.live-pop-foot button { width: 100%; text-align: start; padding: 9px 12px; border-radius: 10px; background: none; border: none; color: var(--ink2); font: 700 .78rem var(--font); cursor: pointer; }
.live-pop-foot button:hover { background: var(--line); color: var(--ink); }
.live-pop-foot button.is-on { color: var(--in); }
.live-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .7rem; font-weight: 800; color: var(--in); background: var(--in-bg); border-radius: 999px; padding: 4px 11px; white-space: nowrap; }
.live-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--in); animation: livePulse 1.6s ease-in-out infinite; }
.live-pill.is-stale { color: var(--out); background: var(--out-bg); }
.live-pill.is-stale::before { background: var(--out); animation: none; }
@keyframes livePulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.8); } }
.feed-row.is-new { animation: athNew 2.2s ease-out; }

/* ---------- v52: صفحهٔ اسکن خلوت — دوربین تمام‌قد، بدون باکس بالا ---------- */
.scan-clean { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 24px; }
.scan-foot { display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-radius: var(--r-card); background: var(--bg2); border: 1px solid var(--card-border); box-shadow: var(--sh-1); }
.scan-foot img, .scan-foot-ava { width: 30px; height: 30px; border-radius: 10px; object-fit: cover; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, var(--bg2)); color: var(--accent); font-weight: 800; font-size: .85rem; }
.scan-foot b { font-size: .84rem; color: var(--ink); flex: 1; text-align: start; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-foot span { font-size: .74rem; color: var(--ink2); font-weight: 700; white-space: nowrap; }
.scan-stage { position: relative; border-radius: var(--r-card); overflow: hidden; background: #0b1220; aspect-ratio: 4 / 5; box-shadow: var(--sh-2); }
.scan-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-starting { min-height: 320px; }
.scan-start-spin { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: scanSpin .9s linear infinite; margin-bottom: 4px; }
@keyframes scanSpin { to { transform: rotate(360deg); } }
/* v53 فیکس «کادرهای عجیب»: سایهٔ 999px روی GPUهای موبایل آرتیفکت می‌دهد + تداخل با اسکنر ادمین؛
   حالا با محدودهٔ .scan-stage جداسازی شده و قاب با براکت‌های گوشهٔ تمیز ساخته می‌شود */
.scan-stage .scan-frame {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  width: auto; aspect-ratio: auto; transform: none; border: 0; border-radius: 0; box-shadow: none;
}
.scan-stage .scan-frame::before { content: ''; position: absolute; inset: 0; background: rgba(8, 12, 24, .32); }
.scan-stage .scan-frame i { position: relative; width: 64%; max-width: 340px; aspect-ratio: 1; display: block; }
.scan-stage .scan-frame i::before, .scan-stage .scan-frame i::after,
.scan-stage .scan-frame b::before, .scan-stage .scan-frame b::after {
  content: ''; position: absolute; width: 46px; height: 46px;
  border: 4.5px solid #fff; filter: drop-shadow(0 1px 5px rgba(0, 0, 0, .55));
}
.scan-stage .scan-frame i::before { top: 0; inset-inline-start: 0; border-inline-end: 0; border-bottom: 0; border-top-right-radius: 22px; }
.scan-stage .scan-frame i::after { bottom: 0; inset-inline-end: 0; border-inline-start: 0; border-top: 0; border-bottom-left-radius: 22px; }
.scan-stage .scan-frame b::before { top: 0; inset-inline-end: 0; border-inline-start: 0; border-bottom: 0; border-top-left-radius: 22px; }
.scan-stage .scan-frame b::after { bottom: 0; inset-inline-start: 0; border-inline-end: 0; border-top: 0; border-bottom-right-radius: 22px; }
.scan-toolbar { position: absolute; bottom: 14px; inset-inline: 14px; display: flex; gap: 10px; justify-content: space-between; }
.scan-tb { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35); background: rgba(10, 15, 30, .55); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.scan-tb svg { width: 20px; height: 20px; }
.scan-tb.on { background: var(--accent); border-color: transparent; }
.scan-hint { position: absolute; top: 14px; inset-inline: 0; text-align: center; color: #fff; font: 700 12px var(--font); text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
.scan-idle-inner { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; color: #fff; padding: 20px; text-align: center; }
.scan-idle-ic { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 1px dashed rgba(255, 255, 255, .4); margin-bottom: 6px; }
.scan-idle-ic svg { width: 40px; height: 40px; opacity: .9; }
.scan-idle-ic.is-err { background: color-mix(in srgb, var(--out) 30%, transparent); border-style: solid; }
.scan-idle-inner b { font-size: 1.1rem; }
.scan-idle-inner span { font-size: .82rem; opacity: .85; max-width: 300px; line-height: 1.8; }
.scan-idle-inner .btn { margin-top: 8px; }
.scan-result { background: var(--bg2); border: 1px solid var(--card-border); border-radius: var(--r-card); padding: 28px 18px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; box-shadow: var(--sh-1); }
.scan-stamp { width: 94px; height: 94px; border-radius: 50%; display: grid; place-items: center; color: #fff; animation: stampIn .35s cubic-bezier(.2, 1.4, .4, 1); }
.scan-stamp svg { width: 44px; height: 44px; }
.scan-stamp.is-in { background: var(--in); box-shadow: 0 12px 34px color-mix(in srgb, var(--in) 42%, transparent); }
.scan-stamp.is-out { background: var(--out); box-shadow: 0 12px 34px color-mix(in srgb, var(--out) 42%, transparent); }
.scan-stamp.is-err { background: var(--out); }
@keyframes stampIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.scan-result h3 { margin: 0; font-size: 1.25rem; color: var(--ink); }
.scan-result .scan-time { font-size: .95rem; color: var(--ink2); font-weight: 700; }

/* پوستر کد ورودی + چاپ */
.scan-poster { background: #fff; color: #101C2E; border: 2.5px solid #101C2E; border-radius: 18px; padding: 26px 22px; text-align: center; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.scan-poster-brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.15rem; }
.scan-poster-brand img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; }
.scan-poster-head { font-weight: 800; font-size: 1.02rem; background: #101C2E; color: #fff; padding: 7px 20px; border-radius: 999px; }
.scan-poster-qr { width: 240px; height: 240px; }
.scan-poster-note { font-size: .85rem; font-weight: 600; color: #33415C; max-width: 320px; line-height: 1.8; }
.scan-poster-foot { font-size: .75rem; color: #64748B; }
#print-area { display: none; }
@media print {
  body * { visibility: hidden !important; }
  #print-area, #print-area * { visibility: visible !important; }
  #print-area { display: block !important; position: absolute; inset: 0; background: #fff; padding: 16px; }
  .scan-poster { max-width: 100%; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}

/* ═══════════════ v53: داشبورد ورزشکار — خط لایو + ردیف منو ═══════════════
   v54: باند وضعیت حذف شد — به درخواست کارفرما کارت عضویت (بدون QR) جای آن نشست */

/* ---------- v53: خط لایو — تایم‌لاین تردد ورزشکار ---------- */
.athlive { background: var(--bg2); border: 1px solid var(--card-border); border-radius: var(--r-card); box-shadow: var(--sh-1); overflow: hidden; }
.athlive-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.athlive-head h4 { margin: 0; font-size: .92rem; color: var(--ink); display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; }
.livedot { width: 9px; height: 9px; border-radius: 50%; background: var(--in); box-shadow: 0 0 0 4px var(--in-bg); animation: livePulse 1.6s ease-in-out infinite; flex: none; }
.athlive-more { display: inline-flex; align-items: center; gap: 5px; background: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font: 700 .74rem var(--font); color: var(--accent); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.athlive-more svg { width: 13px; height: 13px; }
@media (hover: hover) and (pointer: fine) { .athlive-more:hover { background: var(--line); } }
.athlive-list { list-style: none; margin: 0; padding: 6px 14px 8px; position: relative; }
.athlive-list::before { content: ''; position: absolute; inset-inline-start: 24px; top: 14px; bottom: 14px; width: 2px; background: var(--line); border-radius: 2px; }
.attline { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 0 9px; padding-inline-start: 20px; }
.attline-dot { position: absolute; inset-inline-start: 5px; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--bg2); z-index: 1; }
.attline-dot.is-in { background: var(--in); box-shadow: 0 0 0 3px var(--in-bg); }
.attline-dot.is-out { background: var(--out); box-shadow: 0 0 0 3px var(--out-bg); }
.attline-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.attline-b b { font-size: .85rem; color: var(--ink); }
.attline-b span { font-size: .7rem; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attline-t { font-size: .72rem; font-weight: 800; color: var(--ink2); flex: none; }
.attline-t.is-fresh { color: var(--accent); }
.attline.is-new { animation: athNew 2.2s ease-out; border-radius: 10px; }
.athlive-list .attline-empty { display: flex; align-items: center; gap: 8px; padding: 18px 4px 18px; padding-inline-start: 20px; color: var(--ink2); font-size: .78rem; line-height: 1.7; }
.athlive-list .attline-empty svg { width: 20px; height: 20px; opacity: .6; flex: none; }
.athlive-list .attline-empty p { margin: 0; }
.athlive-flat { padding: 6px 14px 8px; }

/* ---------- v53: ردیف منوی تخت — ترددها / مالی / بوفه (v55: بدون زیرنویس عدد) ---------- */
.athmenu { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--bg2); border: 1px solid var(--card-border); border-radius: var(--r-card); box-shadow: var(--sh-1); overflow: hidden; }
.athmenu button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 14px; background: none; border: none; cursor: pointer; font-family: var(--font); -webkit-tap-highlight-color: transparent; transition: background .15s; min-width: 0; }
.athmenu button + button { border-inline-start: 1px solid var(--line); }
@media (hover: hover) and (pointer: fine) { .athmenu button:hover { background: var(--line); } }
.athmenu button:active { background: var(--line); }
.athmenu-ic { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; background: var(--line); color: var(--ink2); transition: background .15s, color .15s; }
.athmenu-ic svg { width: 19px; height: 19px; }
.athmenu button:hover .athmenu-ic, .athmenu button:active .athmenu-ic { background: color-mix(in srgb, var(--accent) 14%, var(--bg2)); color: var(--accent); }
.athmenu b { font-size: .86rem; font-weight: 800; color: var(--ink); white-space: nowrap; }

/* ---------- v55: کارت پروفایل ورزشکار (صفحهٔ پروفایل) ---------- */
.prof-card { display: flex; flex-direction: column; gap: 16px; }
.prof-id { display: flex; align-items: center; gap: 14px; }
.prof-ava { position: relative; width: 78px; height: 78px; flex: none; border-radius: 50%; border: none; padding: 0; cursor: pointer; background: var(--line); overflow: visible; -webkit-tap-highlight-color: transparent; }
.prof-ava img, .prof-ava > span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font: 800 1.5rem var(--font); color: var(--accent); background: var(--in-bg); }
.prof-ava-edit { position: absolute; bottom: -2px; inset-inline-end: -2px; width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent, #fff); border: 3px solid var(--bg2); }
.prof-ava-edit svg { width: 12px; height: 12px; }
.prof-id-txt { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.prof-id-txt h3 { margin: 0; font-size: 1.22rem; color: var(--ink); }
.prof-code { font-size: .78rem; color: var(--ink2); font-weight: 700; }
.prof-code em { font-style: normal; color: var(--accent); font-weight: 800; }
.prof-stamp { align-self: flex-start; border-radius: 999px; padding: 4px 11px; font-size: .7rem; font-weight: 800; background: var(--in-bg); color: var(--in); }
.prof-stamp.is-out { background: var(--out-bg); color: var(--out); }
.prof-stamp.is-susp { background: var(--warn-bg); color: var(--out); }
.prof-stamp.is-muted { background: var(--line); color: var(--ink2); }
.prof-grid { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.prof-row { display: flex; align-items: center; gap: 10px; padding: 11px 2px; min-width: 0; }
.prof-row + .prof-row { border-top: 1px solid var(--line); }
.prof-row-ic { width: 32px; height: 32px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--line); color: var(--ink2); }
.prof-row-ic svg { width: 15px; height: 15px; }
.prof-row b { flex: 1; min-width: 0; font-size: .9rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prof-row b.is-out { color: var(--out); }
.prof-row b.is-in { color: var(--in); }
.prof-row i { font-style: normal; font-size: .68rem; color: var(--ink2); font-weight: 700; flex: none; }
/* v55: لمس کارت در داشبورد → پروفایل */
.ath-wrap > .mycard { cursor: pointer; }

/* ---------- v53: سرصفحهٔ مشترک صفحات ورزشکار ---------- */
.ath-head { display: flex; align-items: center; gap: 12px; }
.ath-head-ic { width: 44px; height: 44px; flex: none; border-radius: 14px; display: grid; place-items: center; background: var(--bg2); border: 1px solid var(--card-border); color: var(--accent); }
.ath-head-ic svg { width: 20px; height: 20px; }
.ath-head-b { flex: 1; min-width: 0; }
.ath-head-b h2 { margin: 0; font-size: 1.15rem; color: var(--ink); }
.ath-head-b p { margin: 2px 0 0; font-size: .74rem; color: var(--ink2); line-height: 1.6; }
.ath-head-stats { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex: none; }
.ath-head-stats span { font-size: .7rem; color: var(--ink2); font-weight: 700; white-space: nowrap; }
.ath-head-stats b { color: var(--ink); font-weight: 800; }
.ath-head-stats span.is-warn, .ath-head-stats span.is-warn b { color: var(--out); }
@media (min-width: 900px) { .ath-head-b h2 { font-size: 1.3rem; } .ath-head-stats { flex-direction: row; gap: 14px; } }

/* ---------- v53: مالی من ---------- */
.athfin-sum { background: var(--bg2); border: 1px solid var(--card-border); border-radius: var(--r-card); padding: 14px 16px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 8px; }
.athfin-badge { align-self: flex-start; border-radius: 999px; padding: 5px 14px; font-size: .8rem; font-weight: 800; background: var(--line); color: var(--ink2); }
.athfin-badge.is-out { background: var(--out-bg); color: var(--out); }
.athfin-badge.is-in { background: var(--in-bg); color: var(--in); }
.athfin-badge.is-warn { background: var(--warn-bg); color: var(--warn); }
.athfin-sum p { margin: 0; font-size: .84rem; color: var(--ink2); line-height: 1.8; }
.athfin-sum p b { color: var(--ink); }
.ath-row-ic.st-shop { background: color-mix(in srgb, var(--accent) 12%, var(--bg2)); color: var(--accent); }
.ath-row-ic.lg-out { background: var(--in-bg); color: var(--in); }

/* ---------- v53: کارت اشتراک من — کارت پریمیوم + ستون اطلاعات ---------- */
.cardcols { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.cardcol-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
/* v55b: box-sizing حیاتی بود — بدون آن width:100% + پدینگ ۳۶px سرریز افقی RTL می‌ساخت و کل رابط شیفت می‌شد */
.mycard { position: relative; box-sizing: border-box; border-radius: 20px; background: linear-gradient(152deg, #131F35 0%, #1B2C4A 58%, #10203A 100%); color: #F4F7FC; padding: 15px 16px 13px; box-shadow: 0 18px 40px rgba(9, 18, 38, .35), 0 2px 6px rgba(9, 18, 38, .3); overflow: hidden; }
.mycard::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--accent); }
.mycard::after { content: ''; position: absolute; inset-inline-end: -70px; top: -70px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 26%, transparent), transparent 72%); pointer-events: none; }
.mycard-top { display: flex; align-items: center; gap: 10px; position: relative; }
.mycard-brand { font-size: .92rem; font-weight: 800; opacity: .92; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mycard-stamp { flex: none; border-radius: 999px; padding: 4px 12px; font-size: .7rem; font-weight: 800; background: rgba(255, 255, 255, .12); color: #D7E3F4; border: 1px solid rgba(255, 255, 255, .18); }
.mycard-stamp.is-in { background: rgba(14, 138, 92, .28); color: #7CE0B8; border-color: rgba(14, 138, 92, .5); }
.mycard-stamp.is-out { background: rgba(201, 51, 51, .3); color: #F3A6A6; border-color: rgba(201, 51, 51, .55); }
.mycard-stamp.is-susp { background: rgba(59, 130, 246, .3); color: #A9C8F5; border-color: rgba(59, 130, 246, .5); }
.mycard-mid { display: flex; align-items: center; gap: 14px; margin-top: 16px; position: relative; }
.mycard-who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.mycard-who img, .mycard-ava { width: 46px; height: 46px; border-radius: 15px; object-fit: cover; border: 2px solid rgba(255, 255, 255, .35); }
.mycard-ava { display: grid; place-items: center; background: rgba(255, 255, 255, .14); font-weight: 800; font-size: 1.05rem; color: #fff; }
.mycard-who b { font-size: 1.08rem; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.mycard-who span { font-size: .72rem; color: #B9C7DC; }
.mycard-who span em { font-style: normal; font-weight: 800; color: #fff; letter-spacing: .04em; }
.mycard-qr { flex: none; width: 108px; background: #fff; border-radius: 14px; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; box-shadow: 0 6px 16px rgba(0, 0, 0, .28); }
.mycard-qr canvas { width: 88px !important; height: 88px !important; display: block; }
.mycard-qr span { font-size: .58rem; font-weight: 800; color: #47536B; }
.mycard-plan { margin-top: 14px; padding-top: 12px; border-top: 1px dashed rgba(255, 255, 255, .22); display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: baseline; position: relative; }
.mycard-plan b { font-size: .92rem; }
.mycard-plan span { font-size: .68rem; color: #B9C7DC; }
.mycard-bars { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.mycard-bar span { display: block; font-size: .66rem; color: #B9C7DC; font-weight: 700; margin-bottom: 4px; }
.mycard-bar i { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.mycard-bar i b { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s; }
@media (min-width: 900px) {
  .cardcols { grid-template-columns: minmax(330px, 430px) 1fr; gap: 20px; }
  .mycard { padding: 22px 22px 20px; }
  .mycard-qr { width: 122px; }
  .mycard-qr canvas { width: 100px !important; height: 100px !important; }
}
/* v54: کارت روی داشبورد — مثل یک کارت واقعی در عرض معقول می‌ماند (کش نمی‌آید) */
.ath-wrap > .mycard { width: 100%; }
@media (min-width: 900px) {
  .ath-wrap > .mycard { max-width: 560px; }
}

/* ---------- v53: رویدادهای «ورود رد شد» — ادمین ---------- */
@keyframes denyNew { 0% { background: color-mix(in srgb, var(--out) 18%, transparent); } 100% { background: color-mix(in srgb, var(--out) 7%, transparent); } }
.stampchip.st-deny { color: #fff; background: var(--out); border-color: var(--out); }
.feed-row.is-deny { background: color-mix(in srgb, var(--out) 7%, transparent); animation: denyNew 2.2s ease-out; }
.feed-row.is-deny .feed-name { color: var(--out); }
.live-pop-row.is-deny b, .live-pop-row.is-deny > span { color: var(--out); }
.live-pop-foot { display: flex; gap: 6px; }
.live-pop-foot button { flex: 1; display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px; min-width: 0; }
.live-pop-foot button svg { width: 14px; height: 14px; flex: none; }

/* ---------- v56: کارت اعلان خلاقانهٔ تردد زنده (ادمین) — ورود از بیرون پایین-چپ، ۲ثانیه، خروج از همان‌جا ---------- */
#live-cards { position: fixed; left: 16px; bottom: 16px; z-index: 96; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; pointer-events: none; }
.lc-card { pointer-events: auto; position: relative; box-sizing: border-box; display: flex; align-items: center; gap: 12px; width: min(384px, calc(100vw - 32px)); padding: 13px 14px 16px; border-radius: 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(14px) saturate(1.1); -webkit-backdrop-filter: blur(14px) saturate(1.1); border: 1px solid var(--card-border); box-shadow: 0 18px 44px rgba(2, 8, 20, .22), 0 2px 8px rgba(2, 8, 20, .12); overflow: hidden; cursor: pointer; opacity: 0; transform: translate(-130%, 110%) rotate(-7deg); transform-origin: bottom left; transition: transform .52s cubic-bezier(.2, 1.32, .42, 1), opacity .28s ease; }
.lc-card.go { opacity: 1; transform: translate(0, 0) rotate(0deg); }
.lc-card.lc-leave { opacity: 0; transform: translate(-130%, 110%) rotate(-7deg); transition: transform .42s cubic-bezier(.55, -.2, .85, .45), opacity .32s ease; }
/* لبهٔ رنگی از سمتِ ورود کارت + ته‌رنگ واریانت */
.lc-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--in); }
.lc-card.lc-out::before { background: var(--out); }
.lc-card.lc-deny::before { background: var(--out); }
.lc-card.lc-in { background: linear-gradient(135deg, color-mix(in srgb, var(--in) 7%, var(--surface)) 0%, var(--surface) 55%); }
.lc-card.lc-out { background: linear-gradient(135deg, color-mix(in srgb, var(--out) 7%, var(--surface)) 0%, var(--surface) 55%); }
.lc-card.lc-deny { background: linear-gradient(135deg, color-mix(in srgb, var(--out) 10%, var(--surface)) 0%, var(--surface) 55%); }
.lc-ava { flex: none; width: 46px; height: 46px; border-radius: 14px; overflow: hidden; display: grid; place-items: center; background: var(--in-bg); color: var(--in); border: 1px solid color-mix(in srgb, var(--in) 30%, transparent); }
.lc-ava img { width: 100%; height: 100%; object-fit: cover; }
.lc-card.lc-out .lc-ava { background: var(--out-bg); color: var(--out); border-color: color-mix(in srgb, var(--out) 30%, transparent); }
.lc-card.lc-deny .lc-ava { background: var(--out-bg); color: var(--out); border-color: color-mix(in srgb, var(--out) 30%, transparent); }
.lc-ava svg { width: 22px; height: 22px; }
.lc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lc-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lc-top b { font-size: .95rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc-chip { flex: none; font-size: .72rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; background: var(--in-bg); color: var(--in); border: 1px solid color-mix(in srgb, var(--in) 26%, transparent); }
.lc-out .lc-chip { background: var(--out-bg); color: var(--out); border-color: color-mix(in srgb, var(--out) 26%, transparent); }
.lc-deny .lc-chip { background: var(--out-bg); color: var(--out); border-color: color-mix(in srgb, var(--out) 26%, transparent); }
.lc-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .78rem; color: var(--ink2); }
.lc-meta span { white-space: nowrap; }
.lc-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink2); opacity: .55; flex: none; }
/* نقطهٔ ضربان‌دار لایو */
.lc-dot { position: absolute; top: 11px; right: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--in); color: var(--in); animation: lcPulse 1.5s ease-out infinite; }
.lc-out .lc-dot { background: var(--out); color: var(--out); }
.lc-deny .lc-dot { background: var(--out); }
@keyframes lcPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 55%, transparent); } 70% { box-shadow: 0 0 0 9px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
/* نوار شمارش معکوس — مکث با هاور (هم‌گام با تایمر JS) */
.lc-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.lc-bar i { display: block; height: 100%; width: 100%; background: var(--in); border-radius: 0 3px 3px 0; }
.lc-out .lc-bar i { background: var(--out); }
.lc-deny .lc-bar i { background: var(--out); }
@media (max-width: 560px) { #live-cards { left: 12px; right: 12px; bottom: 12px; align-items: stretch; } .lc-card { width: 100%; transform: translateY(150%) scale(.94); transform-origin: bottom center; } .lc-card.go { transform: none; } .lc-card.lc-leave { transform: translateY(150%) scale(.94); transition-timing-function: cubic-bezier(.5, -.15, .85, .45); } .lc-ava { width: 40px; height: 40px; border-radius: 12px; } .lc-top b { font-size: .88rem; } .lc-dot { top: 9px; right: 11px; } }
/* v57: انیمیشن جذاب مُهر ورود/خروج در موبایل — کارت از پایین بالا می‌آید، مهر با چرخش کوچک می‌کوبد و حلقه موج می‌زند */
@media (max-width: 560px) {
  #result { padding: 16px; }
  #result.open .result-card { animation: resultUp .55s cubic-bezier(.18, 1.28, .4, 1) both; }
  @keyframes resultUp { from { opacity: 0; transform: translateY(64%) scale(.92); } to { opacity: 1; transform: none; } }
  #result.open .stamp { animation: stampSlam .52s cubic-bezier(.2, .8, .3, 1) both; animation-delay: .14s; }
  @keyframes stampSlam {
    0% { opacity: 0; transform: scale(2.3) rotate(-8deg); }
    55% { opacity: 1; transform: scale(.88) rotate(3deg); }
    76% { transform: scale(1.06) rotate(-1.6deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
  }
  .stamp::before { content: ''; position: absolute; inset: -12px; border: 3px solid currentColor; border-radius: 14px; opacity: 0; pointer-events: none; }
  #result.open .stamp::before { animation: stampRing .7s ease-out .38s both; }
  @keyframes stampRing { 0% { opacity: .5; transform: scale(.86); } 100% { opacity: 0; transform: scale(1.3); } }
}
@media (prefers-reduced-motion: reduce) { .lc-card, .lc-card.lc-leave { transform: none; transition: opacity .22s ease; } .lc-dot { animation: none; } }

/* ---------- v57: استپر زمان کارت اعلان (تنظیمات ادمین) ---------- */
.att-sec-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 2px; }
.att-sec-row .f-hint { flex: 1; min-width: 180px; margin: 0; }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.stepper b { min-width: 84px; text-align: center; font-size: .95rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.step-btn { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--card-border); background: var(--surface); color: var(--ink); font: 800 18px/1 var(--font); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.step-btn:active { transform: scale(.94); }
.step-btn:disabled { opacity: .35; cursor: default; transform: none; }

/* ---------- v58: اعلان چسبان ردشدگی — دکمهٔ بستن، بدون تایمر ---------- */
.lc-x { flex: none; width: 30px; height: 30px; border-radius: 10px; border: 1px solid var(--card-border); background: var(--bg2); color: var(--ink2); display: grid; place-items: center; cursor: pointer; padding: 0; margin-inline-start: -4px; touch-action: manipulation; }
.lc-x svg { width: 14px; height: 14px; }
.lc-x:active { transform: scale(.92); }
.lc-card.lc-sticky { border-color: color-mix(in srgb, var(--out) 45%, var(--card-border)); box-shadow: 0 18px 44px rgba(2, 8, 20, .26), 0 2px 10px color-mix(in srgb, var(--out) 24%, transparent); }
.lc-card.lc-sticky .lc-body { flex: 1; }
/* ---------- v58: کارت داشبورد ورزشکار — بدون برند، عکس بزرگ بالای نام ---------- */
.mycard.no-brand .mycard-brand { display: none; }
.mycard.no-brand .mycard-top { justify-content: flex-end; }
.mycard.is-big .mycard-who { align-items: center; text-align: center; gap: 7px; margin-top: 4px; }
.mycard.is-big .mycard-who img, .mycard.is-big .mycard-ava { width: 104px; height: 104px; border-radius: 30px; border-width: 3px; box-shadow: 0 10px 26px rgba(2, 8, 20, .35); }
.mycard.is-big .mycard-ava { font-size: 2rem; }
.mycard.is-big .mycard-who b { font-size: 1.42rem; margin-top: 8px; white-space: normal; line-height: 1.4; }
.mycard.is-big .mycard-who span { font-size: .82rem; color: #C6D2E4; }
.mycard.is-big .mycard-who span em { font-size: .95rem; }
/* ---------- v58: هیرؤ پروفایل ورزشکار (بازنویسی کامل) ---------- */
.prof-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding-top: 22px; }
.prof-hero .prof-ava { width: 132px; height: 132px; }
.prof-hero .prof-ava img, .prof-hero .prof-ava > span { font-size: 2.6rem; }
.prof-hero .prof-ava-edit { width: 34px; height: 34px; }
.prof-hero .prof-ava-edit svg { width: 15px; height: 15px; }
.prof-name { margin: 6px 0 0; font-size: 1.34rem; color: var(--ink); }
.prof-hero .prof-code { font-size: .84rem; }
.prof-photo-hint { margin: 2px 0 0; font-size: .68rem; color: var(--ink2); }
.prof-course-top { display: flex; flex-direction: column; gap: 3px; margin-bottom: 10px; }
.prof-course-top b { font-size: .95rem; color: var(--ink); }
.prof-course-top span { font-size: .74rem; color: var(--ink2); }
.prof-qr-box { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.prof-qr-box .mycard-qr { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.prof-qr-box .mycard-qr span { font-size: .72rem; color: var(--ink2); font-weight: 700; }

/* ═══ v62 — تب «موتورهای هوشمند» (گزارش فعالیت) ═══ */
.eng-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eng-head-main { min-width: 0; }
.eng-title { font-weight: 800; font-size: 1.02rem; display: flex; align-items: center; gap: 8px; color: var(--ink); }
.eng-title small { font-weight: 600; font-size: .74rem; color: var(--ink2); }
.eng-sub { font-size: .78rem; color: var(--ink2); margin-top: 4px; }
.eng-badge { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 14px; font-size: .8rem; font-weight: 800; }
.eng-badge.is-ok { background: #e9f7ee; color: #17954c; }
.eng-badge.is-bad { background: #fdeaea; color: #cf3a3a; }
.eng-tag { display: inline-block; background: var(--bg2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: .68rem; font-weight: 700; color: var(--ink2); margin-inline-end: 4px; }
.eng-tags { white-space: nowrap; }
.eng-ok { color: #17954c; font-weight: 700; white-space: nowrap; }
.eng-bad { color: #cf3a3a; font-weight: 700; white-space: nowrap; }
.eng-row-bad td { background: #fdf5f5; }
.eng-list { margin: 4px 0 0; padding: 0; list-style: none; }
.eng-list li { display: flex; align-items: flex-start; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-size: .84rem; line-height: 1.7; color: var(--ink); }
.eng-list li:last-child { border-bottom: 0; }
.eng-list li svg { flex: none; margin-top: 3px; color: #c2620a; }
.eng-mono li { direction: ltr; text-align: left; font-family: ui-monospace, monospace; font-size: .76rem; color: var(--ink2); }
.eng-note { background: linear-gradient(180deg, #f8fafc, #fff); }
.eng-note p { font-size: .82rem; line-height: 1.9; color: var(--ink2); margin: 6px 0 0; }
.eng-note-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: .9rem; color: var(--ink); }
.eng-cmd { direction: ltr; text-align: left; font-family: ui-monospace, monospace; font-size: .78rem !important; background: var(--bg2); border-radius: 8px; padding: 8px 12px; }
.eng-muted { font-size: .74rem !important; color: #8a93a5 !important; }

/* ═══ v63 — دکمهٔ شروع دیباگ + سابقهٔ دیباگ ═══ */
.eng-head .eng-start { white-space: nowrap; background: var(--brand, #e04a17); color: #fff; border: 0; border-radius: 12px; padding: 10px 18px; font-weight: 800; font-size: .85rem; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.eng-head .eng-start:disabled { opacity: .6; }
.eng-who { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .8rem; }
.eng-who.is-user { color: #2563eb; }
.eng-who.is-agent { color: #7c3aed; }
.eng-chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 4px 10px; font-size: .72rem; font-weight: 800; white-space: nowrap; }
.eng-chip.is-wait { background: #fdf1e7; color: #c2620a; }
.eng-chip.is-done { background: #eef1f7; color: #475569; }
.eng-chip.is-ok { background: #e9f7ee; color: #17954c; }
.eng-chip.is-bad { background: #fdeaea; color: #cf3a3a; }
.eng-time { white-space: nowrap; font-size: .78rem; }
.eng-time small { color: var(--ink2); }
