/* ═══════════════════════════════════════════════════════════
   LIQVA Journal — استایل اصلی (نسخهٔ ۰٫۳ — ارتقای بصری Premium)
   تم روشن: سفید + آبی | سود: سبز | ضرر: قرمز | RTL | واکنش‌گرا
   همهٔ تغییرات این نسخه صرفاً ظاهری است؛ ساختار کلاس‌ها دست‌نخورده.
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: #f2f6fc;
  --surface: #ffffff;
  --surface-2: #f7fafe;
  --surface-3: #edf2fa;
  --border: #e2eaf5;
  --border-light: #d2ddef;

  --text: #0f1b30;
  --muted: #4f5f7a;
  --faint: #8b99b3;

  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-2: #60a5fa;
  --indigo: #4f46e5;
  --accent-soft: #e9f0fe;
  --accent-ink: #ffffff;
  --grad-blue: linear-gradient(135deg, #2563eb, #4f46e5);

  --green: #16a34a;
  --green-strong: #15803d;
  --green-soft: #e7f7ee;
  --red: #dc2626;
  --red-strong: #b91c1c;
  --red-soft: #fdecec;
  --amber: #b45309;
  --amber-soft: #fdf3e3;

  --shadow-sm: 0 1px 2px rgba(15, 27, 48, 0.05), 0 4px 14px rgba(37, 99, 235, 0.05);
  --shadow-md: 0 2px 4px rgba(15, 27, 48, 0.04), 0 18px 40px rgba(37, 99, 235, 0.12);
  --glow-blue: 0 10px 30px rgba(37, 99, 235, 0.35);
  --glow-green: 0 10px 30px rgba(22, 163, 74, 0.3);

  --radius: 18px;
  --radius-sm: 11px;

  --font: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;

  color-scheme: light;
}

/* ── پایه ─────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scrollbar-color: #c2d2ec transparent; }

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 420px at 92% -8%, rgba(59, 130, 246, 0.14), transparent 60%),
    radial-gradient(800px 460px at -12% 108%, rgba(79, 70, 229, 0.1), transparent 55%),
    radial-gradient(rgba(37, 99, 235, 0.05) 1px, transparent 1.5px);
  background-size: auto, auto, 26px 26px;
  background-attachment: fixed;
}

/* هاله‌های نورانی شناور پس‌زمینه */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 0;
  pointer-events: none;
}
body::before {
  width: 460px; height: 460px;
  top: -160px; left: -120px;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.28), transparent 70%);
  animation: floatBlob 16s ease-in-out infinite alternate;
}
body::after {
  width: 520px; height: 520px;
  bottom: -200px; right: -140px;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.2), transparent 70%);
  animation: floatBlob 19s ease-in-out infinite alternate-reverse;
}
@keyframes floatBlob {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(50px, 36px) scale(1.12); }
}

.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.num { font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #b8cdf0, #9db9e6);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: #89a9dc; }
::-webkit-scrollbar-track { background: transparent; }

::selection { background: rgba(37, 99, 235, 0.18); }

/* ═══════════ سایدبار ═══════════ */
.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7ff 100%);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  z-index: 2;
}

/* نوار نور لبهٔ سایدبار */
.sidebar::after {
  content: "";
  position: absolute;
  inset-inline-end: -1px; top: 0;
  width: 2px; height: 100%;
  background: linear-gradient(180deg, transparent, rgba(37, 99, 235, 0.35), transparent);
  pointer-events: none;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 2px 8px 20px; }

.brand-mark {
  width: 44px; height: 44px;
  border-radius: 14px;
  background: var(--grad-blue);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--glow-blue), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
  position: relative;
  transition: transform 0.3s ease;
}
.brand-mark:hover { transform: rotate(-6deg) scale(1.05); }
.brand-mark svg { width: 22px; height: 22px; }

.brand-name { font-size: 17px; font-weight: 800; letter-spacing: 0.4px; color: #12203a; }
.brand-name span {
  font-weight: 500;
  background: linear-gradient(90deg, var(--accent), var(--indigo));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-sub { font-size: 11px; color: var(--faint); margin-top: -2px; letter-spacing: 0.2px; }

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%;
  padding: 9.5px 14px;
  background: transparent;
  border: none; border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 13.5px; font-weight: 500;
  transition: background 0.16s, color 0.16s, transform 0.16s, box-shadow 0.16s;
  text-align: start;
  position: relative;
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; transition: transform 0.18s; }
.nav-item:hover { background: #fff; color: var(--accent-strong); box-shadow: var(--shadow-sm); }
.nav-item:hover svg { transform: scale(1.12); }
.nav-item.active {
  background: linear-gradient(120deg, #e8f0fe, #f0edfe);
  color: var(--accent-strong);
  font-weight: 700;
  box-shadow: inset 0 0 0 1px #dbe6fc, var(--shadow-sm);
}
/* نشانگر آیکون‌شکل کنار آیتم فعال */
.nav-item.active::before {
  content: "";
  position: absolute;
  inset-inline-start: -16px;
  width: 4px; height: 60%;
  top: 20%;
  border-radius: 0 4px 4px 0;
  background: var(--grad-blue);
  box-shadow: 2px 0 10px rgba(37, 99, 235, 0.5);
}

.nav-badge {
  margin-inline-start: auto;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px; font-weight: 700;
  border-radius: 999px;
  padding: 0 8px;
  min-width: 22px;
  text-align: center;
  line-height: 20px;
  border: 1px solid #dbe6fc;
}
.nav-item.active .nav-badge { background: #fff; }

.sidebar-footer { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--border); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 12px; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--grad-blue);
  border: 2px solid #dbe6fc;
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.3);
}
.user-name { font-size: 13px; font-weight: 600; }
.user-role { font-size: 11px; color: var(--faint); }

.version { font-size: 10.5px; color: var(--faint); line-height: 1.7; padding: 0 6px; }

/* ═══════════ نوار بالا ═══════════ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 20;
}
/* خط گرادیانی زیر نوار بالا */
.topbar::after {
  content: "";
  position: absolute;
  bottom: -1px; inset-inline: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, var(--accent-2) 30%, var(--indigo) 50%, var(--accent-2) 70%, transparent 95%);
  opacity: 0.55;
}
.topbar h1 {
  font-size: 17.5px; font-weight: 800; letter-spacing: 0.2px;
  background: linear-gradient(120deg, #16233c, #1e3a8a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.acc-switcher {
  width: auto;
  max-width: 210px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-strong);
  background: var(--surface);
  border-color: #cfe0fa;
  padding: 7px 12px;
  box-shadow: var(--shadow-sm);
}

.content { padding: 26px 28px 48px; max-width: 1180px; width: 100%; margin-inline: auto; }

/* ═══════════ بخش‌ها ═══════════ */
.section { display: none; }
.section.active { display: block; animation: fadeUp 0.32s cubic-bezier(0.22, 0.8, 0.4, 1); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════ کارت‌ها ═══════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}
/* نوار گرادیانی بالای هر کارت */
.card::before {
  content: "";
  position: absolute;
  top: 0; inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--indigo), var(--accent-2));
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.25s;
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d0ddf1;
  transform: translateY(-2px);
}
.card:hover::before { opacity: 0.75; }

.card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.card-head h3 {
  font-size: 14.5px; font-weight: 800; color: #16233c;
  position: relative;
  padding-inline-start: 12px;
}
/* نقطهٔ تزئینی کنار عنوان کارت */
.card-head h3::before {
  content: "";
  position: absolute;
  inset-inline-start: 0; top: 50%;
  transform: translateY(-50%);
  width: 6px; height: 6px;
  border-radius: 2px;
  background: var(--grad-blue);
  box-shadow: 0 0 8px rgba(37, 99, 235, 0.55);
}
.card-hint { font-size: 11.5px; color: var(--faint); }

/* ═══════════ کارت‌های آمار ═══════════ */
.kpi-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 14px;
}

.kpi { padding: 16px 18px; }

/* دایرهٔ تزئینی گوشهٔ کارت آمار */
.kpi::after {
  content: "";
  position: absolute;
  top: -34px; inset-inline-end: -34px;
  width: 110px; height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(96, 165, 250, 0.14), transparent 70%);
  pointer-events: none;
}

.kpi-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; position: relative; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.kpi-icon {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: var(--grad-blue);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: rotate(-4deg);
  transition: transform 0.25s ease;
}
.kpi:hover .kpi-icon { transform: rotate(4deg) scale(1.06); }
.kpi-icon svg { width: 16px; height: 16px; }
.kpi-icon.win {
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 8px 18px rgba(22, 163, 74, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: 0.2px; color: #16233c; position: relative; }
.kpi-value.win {
  background: linear-gradient(120deg, #16a34a, #0c7a38);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.kpi-value.loss {
  background: linear-gradient(120deg, #ef4444, #b91c1c);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.kpi-sub { font-size: 11.5px; color: var(--faint); margin-top: 3px; position: relative; }

/* ═══════════ چیدمان داشبورد ═══════════ */
.dash-grid { display: grid; grid-template-columns: 2.1fr 1fr; gap: 14px; margin-bottom: 14px; }
.dash-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }
.chart-donut { max-width: 210px; margin: 4px auto 0; }

/* حالت خالی با اشکال تزئینی */
.chart-empty {
  padding: 46px 16px;
  text-align: center;
  color: var(--faint);
  font-size: 13px;
  position: relative;
}
.chart-empty::before {
  content: "";
  display: block;
  width: 52px; height: 52px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(96, 165, 250, 0.35), transparent 60%),
    repeating-conic-gradient(from 0deg, rgba(37, 99, 235, 0.12) 0deg 12deg, transparent 12deg 24deg);
  border: 1.5px dashed #bfd4f2;
}

/* نمودار خطی */
.eq-grid { stroke: #e6edf8; stroke-width: 1; stroke-dasharray: 3 5; }
.eq-label { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }
.eq-zero { stroke: #c9d5e8; stroke-width: 1; stroke-dasharray: 5 5; }
.eq-line {
  fill: none; stroke: var(--green); stroke-width: 2.4;
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 5px 7px rgba(22, 163, 74, 0.35));
}
.eq-dot { fill: var(--green); stroke: #fff; stroke-width: 1.4; }
.eq-dot:hover { fill: var(--green-strong); r: 4.5; }

/* دونات */
.donut-svg .donut-num { fill: #16233c; font-size: 21px; font-weight: 800; font-family: var(--font); }
.donut-svg .donut-label { fill: var(--faint); font-size: 10.5px; font-family: var(--font); }

.donut-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin-top: 10px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 6px rgba(15, 27, 48, 0.15); }
.legend-item b { color: var(--text); font-weight: 600; }

/* نمودار نمادها */
.sym-list { display: flex; flex-direction: column; gap: 12px; }

.sym-row { display: grid; grid-template-columns: 76px 1fr 84px; align-items: center; gap: 12px; }
.sym-name { font-size: 12.5px; font-weight: 700; letter-spacing: 0.3px; color: var(--text); direction: ltr; text-align: end; }

.sym-track {
  height: 10px;
  background: linear-gradient(90deg, #eef3fb, #e6edf8);
  border-radius: 99px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(15, 27, 48, 0.06);
}
.sym-bar { height: 100%; border-radius: 99px; min-width: 6px; transition: width 0.4s ease; }
.sym-bar.win { background: linear-gradient(90deg, #a7e8bf, var(--green)); box-shadow: 0 0 8px rgba(22, 163, 74, 0.35); }
.sym-bar.loss { background: linear-gradient(90deg, #f6b9b9, var(--red)); box-shadow: 0 0 8px rgba(220, 38, 38, 0.3); }

.sym-val { font-size: 12px; font-weight: 700; text-align: start; }
.sym-val.win { color: var(--green); }
.sym-val.loss { color: var(--red); }

/* ═══════════ جدول‌ها ═══════════ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: 13px;
  overflow-x: auto;
  background: var(--surface);
  transition: box-shadow 0.2s;
}
.table-wrap:hover { box-shadow: var(--shadow-sm); }
.table-wrap.slim { border: none; background: transparent; border-radius: 0; box-shadow: none; }

.tbl { width: 100%; border-collapse: collapse; min-width: 880px; }
.tbl.mini { min-width: 0; }

.tbl th {
  font-size: 11.5px; font-weight: 700;
  color: var(--muted);
  text-align: start;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f6f9fe, #eef3fb);
  white-space: nowrap;
}
.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid #eef2f9;
  font-size: 13px;
  white-space: nowrap;
}
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background 0.12s, box-shadow 0.12s; }
.tbl tbody tr:hover {
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.06), transparent 60%);
  box-shadow: inset 3px 0 0 var(--accent-2);
}
.tbl .num { direction: ltr; text-align: end; }

.cell-symbol { font-weight: 700; letter-spacing: 0.4px; direction: ltr; text-align: start; }
.cell-acc { display: block; font-size: 10px; font-weight: 500; color: var(--faint); direction: rtl; }
.cell-actions { text-align: center; width: 116px; }
.th-actions { text-align: center; }

.pnl { font-weight: 700; }
.pnl.win { color: var(--green); }
.pnl.loss { color: var(--red); }

.row-new { animation: rowFlash 2.4s ease-out; }
@keyframes rowFlash {
  0% { background: var(--green-soft); box-shadow: inset 3px 0 0 var(--green); }
  100% { background: transparent; box-shadow: none; }
}

.mini td { padding: 9px 10px; font-size: 12.5px; }
.mini tr { cursor: pointer; }

.empty-row td {
  text-align: center;
  color: var(--faint);
  padding: 38px 16px;
  font-size: 13px;
}

/* ═══════════ نشان‌ها (با نقطهٔ رنگی) ═══════════ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2.5px 11px;
  border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
  line-height: 1.9;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  flex-shrink: 0;
}
.badge.buy { color: var(--accent-strong); background: var(--accent-soft); border-color: #d5e3fc; }
.badge.sell { color: var(--amber); background: var(--amber-soft); border-color: #f3e0bd; }
.badge.win { color: var(--green-strong); background: var(--green-soft); border-color: #c4ead1; }
.badge.loss { color: var(--red-strong); background: var(--red-soft); border-color: #f6cccc; }
.badge.be { color: var(--muted); background: var(--surface-3); border-color: #dde5f1; }
.badge.open { color: var(--accent-strong); background: var(--accent-soft); border-color: #d5e3fc; }

/* ═══════════ نوار ابزار معاملات ═══════════ */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }

.search-box { position: relative; flex: 1; min-width: 200px; max-width: 330px; }
.search-box svg {
  position: absolute; inset-inline-start: 12px; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--faint);
  pointer-events: none;
  transition: color 0.15s;
}
.search-box:focus-within svg { color: var(--accent); }
.search-box input { padding-inline-start: 37px; }

.toolbar select { width: auto; }

.toolbar-count { font-size: 12px; color: var(--faint); margin-inline-start: auto; }

/* ═══════════ فرم‌ها ═══════════ */
input, select, textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13.5px;
  padding: 9.5px 12px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: #b6c8e6; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
  background: #fff;
}
textarea { resize: vertical; min-height: 74px; }
select option { background: var(--surface); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.field label em { color: var(--accent); font-style: normal; }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1); }

.field-error { font-size: 11px; color: var(--red); min-height: 0; display: none; }
.field.invalid .field-error { display: block; }

.form-card { max-width: 780px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; }
.field.full { grid-column: 1 / -1; }

.form-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ── گروه‌های جمع‌شوندهٔ فرم ── */
.fgroup {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-2);
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.fgroup:hover { border-color: #cfdcf2; }
.fgroup[open] { box-shadow: var(--shadow-sm); border-color: #cfdcf2; }
.fgroup summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  transition: background 0.14s;
}
.fgroup summary::-webkit-details-marker { display: none; }
.fgroup summary::before {
  content: "";
  width: 7px; height: 7px;
  border-inline-start: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
  transition: transform 0.18s;
  flex-shrink: 0;
  margin-inline-start: 3px;
}
.fgroup[open] summary::before { transform: rotate(135deg); }
.fgroup summary:hover { background: var(--surface-3); }
.fgroup .form-grid, .fgroup .img-field { padding: 14px 16px 16px; border-top: 1px solid var(--border); }

/* ── جعبهٔ محاسبات زندهٔ ریسک ── */
.live-box {
  border: 1px dashed #b9cdf0;
  border-radius: 12px;
  padding: 11px 15px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 2.1;
  background: linear-gradient(135deg, #f5f9ff, #f2f1fe);
}
.live-box b { color: var(--text); font-weight: 700; }
.live-box .win { color: var(--green); }
.live-box .loss { color: var(--red); }
.live-box .warn { color: var(--amber); }

/* ── تصویر چارت ── */
.img-field { padding: 14px 16px 16px; }
.img-box { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-hint { font-size: 11.5px; color: var(--faint); }
.img-preview { margin-top: 12px; }
.img-preview img {
  width: 100%;
  max-width: 460px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  display: block;
  transition: transform 0.2s, box-shadow 0.2s;
}
.img-preview img:hover { transform: scale(1.012); box-shadow: var(--shadow-md); }
.img-actions { display: flex; gap: 8px; margin-top: 8px; }

.lightbox {
  position: fixed; inset: 0;
  background: rgba(10, 16, 30, 0.88);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  cursor: zoom-out;
}
/* بدون این قانون، display:flex مشخصهٔ hidden را خنثی می‌کرد */
.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 94vw;
  max-height: 90vh;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
  animation: pop 0.22s ease;
}

/* ── تقویم ── */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-title { font-size: 15.5px; font-weight: 800; flex: 1; text-align: center; color: #16233c; }
.cal-today { margin-inline-start: auto; }

.cal-wrap { border-radius: 14px; }
table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.cal th {
  font-size: 10.5px; font-weight: 700; color: var(--muted);
  padding: 8px 2px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f6f9fe, #eef3fb);
  text-align: center; white-space: nowrap;
}
table.cal td {
  border: 1px solid #edf2f9;
  vertical-align: top;
  height: 64px;
  padding: 4px 5px;
  transition: background 0.12s, box-shadow 0.12s;
}
.cal-cell { cursor: default; }
.cal-cell.has { cursor: pointer; }
.cal-cell.has:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1.5px #cfe0fa; }
.cal-cell.out .cal-day { color: var(--faint); opacity: 0.38; }
.cal-cell.out { background: #fafcff; }
.cal-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -3px;
  border-radius: 8px;
  background: linear-gradient(160deg, #eef4ff, #fff);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.16);
}
.cal-cell.selected { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent-2); border-radius: 8px; }
.cal-day { display: block; font-size: 12px; font-weight: 600; color: var(--muted); }
.cal-cell.has .cal-day { color: var(--text); }
.cal-pnl { display: block; font-size: 10.5px; font-weight: 800; margin-top: 3px; direction: ltr; text-align: right; }
.cal-pnl.win { color: var(--green); text-shadow: 0 0 12px rgba(22, 163, 74, 0.25); }
.cal-pnl.loss { color: var(--red); }
.cal-count { display: block; font-size: 9.5px; color: var(--faint); }
.cal-open { display: block; font-size: 10px; color: var(--accent-strong); margin-top: 4px; }
.cal-legend { display: flex; gap: 14px; margin-top: 10px; flex-wrap: wrap; }
.cal-day-card { margin-top: 14px; }

@media (max-width: 560px) {
  table.cal td { height: 52px; padding: 2px 2px; }
  .cal-day { font-size: 10.5px; }
  .cal-pnl { font-size: 9px; }
  .cal-count { display: none; }
  table.cal th { font-size: 9px; padding: 5px 1px; }
}

/* ── گزارش‌ها ── */
.rep-card { margin-bottom: 14px; }
.rep-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.rep-title { font-size: 14.5px; font-weight: 800; flex: 1; min-width: 140px; color: #16233c; }
.rep-range { display: block; font-size: 11.5px; color: var(--faint); font-weight: 400; margin-top: 1px; }
.rep-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.rep-chip {
  background: linear-gradient(160deg, #ffffff, #f4f8fe);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex; flex-direction: column; gap: 1px;
  min-width: 110px;
  box-shadow: 0 1px 2px rgba(15, 27, 48, 0.04);
  transition: transform 0.18s, box-shadow 0.18s;
}
.rep-chip:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.rep-chip .k { font-size: 10.5px; color: var(--faint); }
.rep-chip .v { font-size: 14px; font-weight: 700; color: var(--text); }
.rep-chip .v.win { color: var(--green); }
.rep-chip .v.loss { color: var(--red); }
.rep-sub { font-size: 12px; color: var(--muted); font-weight: 700; margin: 14px 0 8px; }
.wd-row { display: flex; flex-wrap: wrap; gap: 8px; }
.wd-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 11.5px;
  color: var(--muted);
}
.wd-pill.win { border-color: #b9e5c8; background: var(--green-soft); color: var(--green-strong); }
.wd-pill.loss { border-color: #f3c6c6; background: var(--red-soft); color: var(--red-strong); }
.wd-pill i { font-style: normal; color: var(--faint); font-size: 10.5px; }
.rep-best { font-size: 12px; color: var(--muted); margin-top: 10px; }
.rep-compare { margin-top: 4px; }
.cmp-row { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); }
.cmp .up { color: var(--green); font-weight: 700; }
.cmp .down { color: var(--red); font-weight: 700; }
.cmp .dim, .dim { color: var(--faint); font-size: 11.5px; }
.rep-note { font-size: 11px; color: var(--faint); margin-top: 14px; line-height: 1.9; }
.bar-rect.win { fill: var(--green); filter: drop-shadow(0 3px 4px rgba(22, 163, 74, 0.25)); }
.bar-rect.loss { fill: var(--red); filter: drop-shadow(0 3px 4px rgba(220, 38, 38, 0.22)); }
.bar-rect:hover { opacity: 0.82; }

/* ── تحلیل ── */
.an-block { margin-bottom: 14px; }
.an-tbl { min-width: 0; }
.an-key { font-weight: 700; max-width: 200px; white-space: normal; }
.win-t { color: var(--green); }
.loss-t { color: var(--red); }
.tag-low {
  display: inline-block;
  margin-inline-start: 7px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid #f1dcba;
  border-radius: 999px;
  padding: 0 7px;
  vertical-align: middle;
}
.mis-row { display: flex; flex-wrap: wrap; gap: 8px; }
.mis-pill {
  background: var(--red-soft);
  border: 1px solid #f3c6c6;
  color: var(--red-strong);
  border-radius: 999px;
  padding: 4px 13px;
  font-size: 12px;
}
.mis-pill b { color: var(--text); }
.an-final { margin-top: 4px; }

/* ── بخش حساب‌ها ── */
.acc-overview { margin-bottom: 14px; }
.acc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.acc-card { display: flex; flex-direction: column; gap: 13px; }
.acc-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), var(--shadow-md);
}

.acc-head { display: flex; align-items: center; gap: 12px; }
.acc-icn {
  width: 42px; height: 42px;
  border-radius: 13px;
  background: var(--grad-blue);
  color: #fff;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.acc-icn svg { width: 20px; height: 20px; }
.acc-meta { flex: 1; min-width: 0; }
.acc-name { font-size: 14.5px; font-weight: 800; color: #16233c; }
.acc-note { font-size: 11.5px; color: var(--faint); }

.acc-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.acc-kpi {
  background: linear-gradient(170deg, #fbfcff, #f2f6fd);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 9px;
  display: flex; flex-direction: column;
}
.acc-kpi .k { font-size: 10px; color: var(--faint); }
.acc-kpi .v { font-size: 12.5px; font-weight: 700; color: var(--text); }
.acc-kpi .v.loss { color: var(--red); }

.acc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ── مدیریت ستاپ/تریگر در تنظیمات ── */
.opt-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.opt-row { display: flex; gap: 8px; align-items: center; }
.opt-row input { flex: 1; }
.opt-row .icon-btn { flex-shrink: 0; }
.opt-add { display: flex; gap: 8px; }
.opt-add input { flex: 1; }
.storage-info { font-size: 11px; color: var(--faint); margin-top: 12px; line-height: 1.9; }

/* ── تنظیمات ── */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }

.muted-p { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; line-height: 1.9; }

.btn-col { display: flex; flex-direction: column; gap: 9px; }
.btn-col .btn { justify-content: flex-start; }

.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; cursor: pointer;
}
.switch-text { display: flex; flex-direction: column; gap: 2px; }
.switch-title { font-size: 13px; font-weight: 700; }
.switch-sub { font-size: 11.5px; color: var(--faint); }

.switch { position: relative; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.switch i {
  display: block;
  width: 44px; height: 24px;
  background: #e2eaf5;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.switch i::after {
  content: "";
  position: absolute;
  top: 2px; inset-inline-start: 2.5px;
  width: 17.5px; height: 17.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(15, 27, 48, 0.3);
  transition: transform 0.2s;
}
.switch input:checked + i {
  background: var(--grad-blue);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}
.switch input:checked + i::after { transform: translateX(-20px); }

/* ═══════════ دکمه‌ها ═══════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9.5px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 700;
  border: 1px solid transparent;
  transition: filter 0.15s, background 0.15s, border-color 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  position: relative;
}
.btn svg { width: 15px; height: 15px; }
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #fff;
  box-shadow: var(--glow-blue), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { filter: brightness(1.07); transform: translateY(-1px); box-shadow: 0 14px 34px rgba(37, 99, 235, 0.42); }

.btn-ghost { background: var(--surface); border-color: var(--border-light); color: var(--text); box-shadow: 0 1px 2px rgba(15, 27, 48, 0.04); }
.btn-ghost:hover { background: var(--surface-2); border-color: #a9bedf; color: var(--accent-strong); }

.btn-danger { background: var(--red-soft); border-color: #f3c6c6; color: var(--red-strong); }
.btn-danger:hover { background: #fbd9d9; }

.btn-sm { padding: 7px 14px; font-size: 12.5px; }
.btn-xs { padding: 4.5px 11px; font-size: 11.5px; }

.icon-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  background: transparent;
  border: none; border-radius: 9px;
  color: var(--faint);
  transition: background 0.13s, color 0.13s, transform 0.13s;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: var(--accent-soft); color: var(--accent-strong); transform: translateY(-1px); }
.icon-btn.danger:hover { background: var(--red-soft); color: var(--red); }

/* ═══════════ مودال‌ها ═══════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 27, 48, 0.4);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 100;
  padding: 18px;
}
.modal-overlay.open { display: flex; }

.modal {
  width: min(520px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: 0 30px 80px rgba(15, 27, 48, 0.28);
  animation: pop 0.22s cubic-bezier(0.22, 0.8, 0.4, 1);
  position: relative;
  overflow: hidden;
}
/* نوار گرادیانی بالای مودال */
.modal::before {
  content: "";
  position: absolute;
  top: 0; inset-inline: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--indigo), var(--accent-2));
}
.modal-sm { width: min(410px, 100%); }

@keyframes pop {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: none; }
}

.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 15px; font-weight: 800; color: #16233c; }

.tm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.tm-head .sym { font-size: 19px; font-weight: 800; letter-spacing: 0.6px; direction: ltr; color: #12203a; }

.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 13px 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.detail-item .k { font-size: 11.5px; color: var(--faint); margin-bottom: 2px; }
.detail-item .v { font-size: 14px; font-weight: 700; color: var(--text); }
.detail-item .v.win { color: var(--green); }
.detail-item .v.loss { color: var(--red); }
.detail-item .v .dim { color: var(--faint); font-weight: 400; font-size: 11.5px; }

.tm-note { margin-top: 14px; }
.tm-note .k { font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.tm-note > div:last-child { font-size: 13px; color: var(--text); line-height: 1.95; }

.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }

.confirm-text { font-size: 13.5px; color: var(--muted); line-height: 1.95; }

.modal-lg { width: min(600px, 100%); max-height: 88vh; overflow-y: auto; }
.tm-section { margin-top: 14px; }
.tm-section-title {
  font-size: 11.5px; font-weight: 800; color: var(--accent-strong);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 8px;
}
.tm-section-title::after { content: ""; flex: 1; height: 1.5px; background: linear-gradient(90deg, #cfe0fa, transparent); border-radius: 2px; }
.yes { color: var(--green); font-weight: 700; }
.no { color: var(--red); font-weight: 700; }
.tm-img { margin-top: 12px; }
.tm-img img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  display: block;
}
.tm-empty-img { font-size: 12px; color: var(--faint); }

/* ═══════════ توست ═══════════ */
.toast-stack {
  position: fixed;
  bottom: 22px; inset-inline-start: 22px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
}

.toast {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 11px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.28s, transform 0.28s;
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(6px); }

.toast::before {
  content: "";
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.toast.success { border-inline-start: 3px solid var(--green); }
.toast.success::before { background: var(--green); box-shadow: 0 0 10px rgba(22, 163, 74, 0.5); }
.toast.danger { border-inline-start: 3px solid var(--red); }
.toast.danger::before { background: var(--red); box-shadow: 0 0 10px rgba(220, 38, 38, 0.45); }
.toast.info { border-inline-start: 3px solid var(--accent); }
.toast.info::before { background: var(--accent); box-shadow: 0 0 10px rgba(37, 99, 235, 0.45); }

/* ═══════════ حالت خالی داشبورد ═══════════ */
.dash-empty { text-align: center; padding: 68px 24px; }
.dash-empty svg {
  width: 52px; height: 52px;
  color: var(--accent-2);
  margin-bottom: 14px;
  filter: drop-shadow(0 8px 14px rgba(37, 99, 235, 0.25));
}
.dash-empty h3 { font-size: 16px; margin-bottom: 6px; color: #16233c; font-weight: 800; }
.dash-empty p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

/* ═══════════ گروه‌بندی معاملات ═══════════ */
.tgroup { margin-bottom: 12px; background: var(--surface); }
.tgroup summary { justify-content: flex-start; gap: 14px; font-size: 13.5px; padding: 12px 16px; }
.tgroup[open] summary { background: linear-gradient(90deg, #f0f5ff, transparent); }
.tg-label { font-weight: 800; color: #16233c; min-width: 150px; }
.tg-stats { display: flex; align-items: center; gap: 8px; margin-inline-start: auto; flex-wrap: wrap; }
.tg-stats span {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 2px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
}
.tg-stats span.win { color: var(--green-strong); background: var(--green-soft); border-color: #c4ead1; }
.tg-stats span.loss { color: var(--red-strong); background: var(--red-soft); border-color: #f6cccc; }
.tg-body { padding: 0 10px 10px; border-top: 1px solid var(--border); }
.tg-body .table-wrap { border: 1px solid var(--border); }

/* ── فیلتر بازهٔ تاریخ تحلیل ── */
.an-filters { margin-bottom: 14px; padding: 13px 16px; }
.an-filters .toolbar { margin-bottom: 0; }
.af-field { display: flex; align-items: center; gap: 8px; }
.af-field label { font-size: 12px; color: var(--muted); font-weight: 700; white-space: nowrap; }
.af-field input { width: 150px; }

/* ── حساب آنلاین و همگام‌سازی ── */
.auth-slot { display: flex; flex-direction: column; gap: 7px; padding: 0 2px 12px; }
.sync-chip {
  font-size: 11px; font-weight: 700;
  border-radius: 9px;
  padding: 5px 10px;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.sync-chip.sync-ok { color: var(--green-strong); background: var(--green-soft); border-color: #c4ead1; }
.sync-chip.sync-err { color: var(--red-strong); background: var(--red-soft); border-color: #f6cccc; }
.sync-chip.sync-busy { color: var(--accent-strong); background: var(--accent-soft); border-color: #d5e3fc; }
.auth-note { font-size: 11px; color: var(--faint); line-height: 1.9; margin-top: 12px; }
#authForm .field { margin-bottom: 10px; }

/* ── دروازهٔ ورود اجباری ── */
.auth-gate {
  position: fixed; inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background:
    radial-gradient(700px 400px at 15% 0%, rgba(96, 165, 250, 0.22), transparent 60%),
    radial-gradient(700px 450px at 90% 100%, rgba(129, 140, 248, 0.18), transparent 60%),
    linear-gradient(160deg, #f4f8ff, #eef1fb);
}
.auth-gate[hidden] { display: none; }

.gate-card {
  width: min(400px, 100%);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid #dbe6f7;
  border-radius: 24px;
  padding: 34px 32px 26px;
  box-shadow: 0 30px 80px rgba(30, 58, 138, 0.16);
  text-align: center;
  animation: gateIn 0.4s cubic-bezier(0.22, 0.8, 0.4, 1);
  position: relative;
  overflow: hidden;
}
.gate-card::before {
  content: "";
  position: absolute;
  top: 0; inset-inline: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-2), var(--indigo), var(--accent-2));
}
@keyframes gateIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.gate-logo {
  width: 62px; height: 62px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: var(--grad-blue);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: var(--glow-blue), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.gate-logo svg { width: 30px; height: 30px; }

.gate-title { font-size: 24px; font-weight: 800; color: #12203a; letter-spacing: 0.4px; }
.gate-title span {
  background: linear-gradient(90deg, var(--accent), var(--indigo));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.gate-slogan { font-size: 11.5px; color: var(--faint); margin-top: 2px; letter-spacing: 0.4px; }
.gate-note { font-size: 12.5px; color: var(--muted); margin: 14px 0 18px; line-height: 1.9; }

.gate-card form { text-align: start; }
.gate-actions { display: flex; gap: 9px; margin-top: 14px; }
.gate-actions .btn { flex: 1; }
.gate-foot { font-size: 10.5px; color: var(--faint); margin-top: 16px; line-height: 1.8; }
.code-input {
  text-align: center;
  font-size: 22px;
  letter-spacing: 12px;
  font-weight: 800;
  padding: 10px 12px;
}
.gate-forgot {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: none;
  border: none;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  padding: 4px;
}
.gate-forgot:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .gate-card { padding: 26px 20px 20px; }
  .gate-actions { flex-direction: column-reverse; }
}

/* ── پنل مدیریت ── */
.adm-tabs { display: flex; gap: 7px; margin-bottom: 14px; flex-wrap: wrap; }
.adm-tab {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px; font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.adm-tab:hover { color: var(--accent-strong); border-color: #b9cdf0; }
.adm-tab.active {
  background: var(--grad-blue);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-blue);
}
.adm-list { display: flex; flex-direction: column; gap: 10px; }
.adm-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  flex-wrap: wrap;
}
.adm-row-title { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.adm-row-sub { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.8; }
.adm-row-meta { font-size: 10.5px; color: var(--faint); margin-top: 3px; }
.adm-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

.log-list { display: flex; flex-direction: column; gap: 7px; max-height: 480px; overflow-y: auto; }
.log-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 12px;
  flex-wrap: wrap;
}
.log-ts { color: var(--faint); font-size: 11px; direction: ltr; }
.log-email { color: var(--accent-strong); font-size: 11px; direction: ltr; }
.log-msg { color: var(--text); font-weight: 500; flex: 1; min-width: 180px; }

/* نوار اطلاعیه برای همهٔ کاربران */
#annBanner { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.ann-banner {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #c9ddf8;
  background: linear-gradient(120deg, #eef5ff, #f6f9ff);
  border-radius: 13px;
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
}
.ann-banner.important {
  border-color: #f3c6c6;
  background: linear-gradient(120deg, #fdefef, #fff7f7);
}
.ann-banner .ann-body { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.ann-banner b { font-size: 13px; color: #16233c; }
.ann-banner span { font-size: 12px; color: var(--muted); line-height: 1.8; }
.ann-banner.important b { color: var(--red-strong); }
.ann-close { flex-shrink: 0; color: var(--faint); }

/* ═══════════ ناوبری موبایل ═══════════ */
.bottom-nav { display: none; }

/* ═══════════ واکنش‌گرایی ═══════════ */
@media (max-width: 1080px) {
  .dash-grid, .dash-grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .acc-grid { grid-template-columns: 1fr; }
}

@media (max-width: 920px) {
  .sidebar { display: none; }
  .main { padding-bottom: 74px; }
  .topbar { padding: 12px 16px; }
  .content { padding: 18px 16px 40px; }
  .acc-switcher { max-width: 140px; font-size: 11.5px; }

  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; inset-inline: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    z-index: 50;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(15, 27, 48, 0.06);
  }
  .bottom-nav .nav-item {
    flex: 1;
    flex-direction: column;
    gap: 2px;
    font-size: 9px;
    padding: 6px 2px;
    border-radius: 11px;
  }
  .bottom-nav .nav-item svg { width: 18px; height: 18px; }
  .bottom-nav .nav-item.active {
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px #dbe6fc;
  }
  .bottom-nav .nav-badge { display: none; }
}

@media (max-width: 560px) {
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-value { font-size: 19px; }
  .kpi { padding: 13px 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { max-width: none; }
  .toolbar-count { margin-inline-start: 0; }
  .card { padding: 15px 16px; }
  .toast-stack { inset-inline: 16px; bottom: 86px; }
  .detail-grid { grid-template-columns: 1fr; }
  .topbar h1 { font-size: 15px; }
  .acc-kpis { grid-template-columns: 1fr 1fr; }
  .opt-add { flex-direction: column; }
  .af-field input { width: 100%; }
  .af-field { flex: 1; }
  .tg-label { min-width: 0; font-size: 12.5px; }
  .tg-stats { gap: 6px; }
  .tg-stats span { font-size: 10px; padding: 1px 8px; }
}
