/* ═══════════════════════════════════════════════════════════════════════════
   تقویم اقتصادی ای باهوشم — استایل اختصاصی ابزار
   ▸ کاملاً هماهنگ با طراحی اصلی ibahoosham.ir (پالت زمرد + کهربایی روی زمینه گرم)
   ▸ CSS خالص، راست‌چین، واکنش‌گرا، با تم روشن/تاریک
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── ۱) فونت — همان وزیرمتن سایت اصلی ───────────────────────────────────── */
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2'),
       url('../../../../assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2'),
       url('../../../../assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2'),
       url('../../../../assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('/assets/fonts/Vazirmatn-Black.woff2') format('woff2'),
       url('../../../../assets/fonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}

/* ─── ۲) متغیرها — کپی دقیق از سایت اصلی ─────────────────────────────────── */
:root {
  --bg: #f7f5f0;
  --bg-soft: #f1eee5;
  --surface: #ffffff;
  --surface-2: #fbfaf6;
  --text: #17221e;
  --text-soft: #4c5a54;
  --muted: #7b8a83;
  --border: #e4e0d4;
  --border-strong: #d5d0bf;

  --primary: #047857;
  --primary-hover: #03664a;
  --primary-soft: #d9f2e5;
  --primary-softer: #eefaf2;
  --on-primary: #ffffff;

  --accent: #b45309;
  --accent-soft: #fdeecd;

  --teal: #0f766e;
  --violet: #7c3aed;
  --rose: #be185d;

  --danger: #b91c1c;
  --danger-soft: #fee2e2;

  --shadow-sm: 0 1px 2px rgb(23 34 30 / .06);
  --shadow-md: 0 6px 24px -8px rgb(23 34 30 / .12);
  --shadow-lg: 0 24px 60px -24px rgb(23 34 30 / .22);

  --radius: 14px;
  --radius-lg: 20px;
  --header-h: 72px;
  --font: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
}
[data-theme="dark"] {
  --bg: #0c1210;
  --bg-soft: #101815;
  --surface: #131c18;
  --surface-2: #17211d;
  --text: #e9f0ea;
  --text-soft: #b7c4bc;
  --muted: #83958b;
  --border: #233029;
  --border-strong: #31423a;

  --primary: #34d399;
  --primary-hover: #6ee7b7;
  --primary-soft: #11362a;
  --primary-softer: #0e2a21;
  --on-primary: #06231a;

  --accent: #fbbf24;
  --accent-soft: #3a2c10;

  --teal: #2dd4bf;
  --violet: #a78bfa;
  --rose: #f472b6;

  --danger: #f87171;
  --danger-soft: #3b1414;

  --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
  --shadow-md: 0 6px 24px -8px rgb(0 0 0 / .5);
  --shadow-lg: 0 24px 60px -24px rgb(0 0 0 / .65);
}

/* ─── ۳) پایه ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, button, input, textarea, select { font-family: var(--font); }
body {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }
::selection { background: var(--primary-soft); color: var(--text); }
.icon { flex-shrink: 0; vertical-align: -3px; }
.skip-link { position: absolute; right: -9999px; top: 8px; z-index: 200; background: var(--primary); color: var(--on-primary); padding: 10px 18px; border-radius: 10px; }
.skip-link:focus { right: 8px; color: var(--on-primary); }
.container { width: min(1160px, 100% - 40px); margin-inline: auto; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid var(--bg-soft); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ─── ۴) دکمه‌ها ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 12px; border: 1px solid transparent;
  font-family: var(--font); font-size: 15px; font-weight: 500; line-height: 1.6;
  cursor: pointer; transition: all .18s ease; text-decoration: none; white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); transform: translateY(-1px); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-sm { padding: 8px 16px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  cursor: pointer; transition: all .18s ease;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }

/* ─── ۵) چیپ ─────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; line-height: 1.9;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  cursor: default;
}
button.chip, a.chip { cursor: pointer; transition: all .15s ease; }
button.chip:hover, a.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip.is-on:hover { color: var(--on-primary); }
.status-ok { background: var(--primary-softer); border-color: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--primary); }
.status-warn { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); color: var(--accent); }
.status-mute { background: var(--bg-soft); color: var(--muted); }

/* ─── ۶) هدر — همان ساختار سایت اصلی ─────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--border); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; gap: 20px; height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.brand:hover { color: var(--text); }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 55%, var(--teal)));
  color: #fff;
  box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 60%, transparent);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-text strong { font-size: 17px; font-weight: 700; }
.brand-text small { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.main-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a {
  display: inline-block; padding: 8px 14px; border-radius: 10px;
  color: var(--text-soft); font-size: 14.5px; font-weight: 500; transition: all .15s ease;
}
.main-nav a:hover { color: var(--primary); background: var(--primary-softer); }
.main-nav a.is-active { color: var(--primary); background: var(--primary-softer); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.theme-icon-moon { display: none; }
[data-theme="dark"] .theme-icon-sun { display: none; }
[data-theme="dark"] .theme-icon-moon { display: inline-flex; }
.nav-toggle { display: none; }
.nav-open { display: inline-flex; }
.nav-close { display: none; }
.nav-toggle.is-open .nav-open { display: none; }
.nav-toggle.is-open .nav-close { display: inline-flex; }
.mobile-nav {
  display: none; position: absolute; inset-inline: 0; top: var(--header-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-md); padding: 12px 20px 20px;
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.mobile-nav a { display: block; padding: 12px 14px; border-radius: 12px; color: var(--text-soft); font-weight: 500; }
.mobile-nav a:hover, .mobile-nav a.is-active { background: var(--primary-softer); color: var(--primary); }

/* ─── ۷) صفحه و عنوان ────────────────────────────────────────────────────── */
.cal-page { padding: 34px 0 60px; }
.breadcrumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-bottom: 18px;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

.page-head { margin-bottom: 26px; }
.page-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  background: var(--surface); color: var(--primary);
  font-size: 13px; font-weight: 500; margin: 0 0 14px;
}
.page-title {
  font-size: clamp(1.5rem, 3.6vw, 2.3rem); font-weight: 900;
  line-height: 1.4; margin: 0 0 10px; letter-spacing: -.3px;
}
.page-desc { color: var(--text-soft); max-width: 760px; margin: 0; font-size: 15.5px; }

/* نوار وضعیت به‌روزرسانی */
.update-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: 22px 0 0; padding: 12px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); font-size: 13.5px; color: var(--text-soft);
}
.update-bar .dot { width: 9px; height: 9px; border-radius: 99px; background: var(--primary); display: inline-block; margin-inline-end: 7px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.update-bar .dot.warn { background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.update-actions { display: inline-flex; align-items: center; gap: 8px; }

/* ─── ۷ب) نوار بالای ابزار: تاریخ/ساعت زنده + کنترل‌ها (تک‌ردیفی چسبنده) ── */
.toolbar {
  position: sticky; top: calc(var(--header-h) + 8px); z-index: 70;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 16px 0 18px; padding: 9px 14px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .toolbar { background: color-mix(in srgb, var(--surface) 82%, transparent); }
}
/* تاریخ */
.tb-date { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tb-jalali { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text); white-space: nowrap; }
.tb-jalali b { font-weight: 800; }
.tb-jalali .icon { color: var(--primary); flex: none; }
.tb-greg { color: var(--muted); font-size: 10.5px; direction: ltr; text-align: right; white-space: nowrap; }
/* ساعت */
.tb-clock { display: flex; align-items: center; }
.tb-clock .t-main {
  font-weight: 900; font-size: 1.3rem;
  font-variant-numeric: tabular-nums; letter-spacing: .5px; color: var(--primary);
  line-height: 1.15;
}
/* جداکننده و فاصله‌ساز */
.tb-sep { width: 1px; align-self: stretch; margin: 3px 2px; background: var(--border); flex: none; }
.tb-spacer { flex: 1 1 12px; }
/* دکمه‌های نوار */
.tb-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 13px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  transition: all .15s ease; white-space: nowrap;
}
.tb-btn:hover { border-color: var(--primary); color: var(--primary); }
.tb-drop.is-open .tb-btn {
  border-color: var(--primary); background: var(--primary-softer); color: var(--primary);
}
.tb-drop.is-open .tb-btn .tb-caret { transform: rotate(180deg); }
.tb-caret { transition: transform .18s ease; opacity: .7; }
.tb-badge {
  background: var(--accent); color: #fff;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  font-size: 10.5px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
/* دکمه آیکونی جستجو */
.tb-icon-btn {
  width: 36px; height: 36px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  transition: all .15s ease;
}
.tb-icon-btn:hover { border-color: var(--primary); color: var(--primary); }
/* تاگل «فقط مهم» */
.tb-switch {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  padding: 6px 12px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); white-space: nowrap;
}
.tb-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tb-switch-track {
  width: 34px; height: 19px; border-radius: 99px; flex: none;
  background: var(--border); position: relative; transition: background .18s ease;
}
.tb-switch-thumb {
  position: absolute; top: 2.5px; inset-inline-start: 2.5px;
  width: 14px; height: 14px; border-radius: 99px; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease;
}
.tb-switch input:checked + .tb-switch-track { background: var(--accent); }
.tb-switch input:checked + .tb-switch-track .tb-switch-thumb { transform: translateX(-15px); }
.tb-switch input:focus-visible + .tb-switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
.tb-switch-label { font-size: 12.5px; font-weight: 800; color: var(--text-soft); }
.tb-switch input:checked ~ .tb-switch-label { color: var(--accent); }
.tb-switch:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }

/* ─── ۸) فیلترها — پاپ‌آپ‌های نوار ابزار ─────────────────────────────────── */
.filter-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.filter-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 700; color: var(--muted);
  min-width: 76px; flex-shrink: 0; padding-top: 6px;
}
.filter-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-sep { height: 1px; background: var(--border); border: 0; margin: 14px 0; }

/* پاپ‌آپ‌های بازشو از نوار */
.tb-pop {
  position: absolute; top: calc(100% + 10px); inset-inline-start: 0; z-index: 90;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px;
  box-shadow: var(--shadow-lg);
  min-width: 320px; max-width: min(92vw, 480px);
  display: none; user-select: none;
  animation: tb-drop .16s ease;
}
.tb-drop { position: relative; }
.tb-drop.is-open .tb-pop { display: block; }
.tb-pop.tb-pop-end { inset-inline-start: auto; inset-inline-end: 0; }
@keyframes tb-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.tb-pop-title { font-size: 12.5px; font-weight: 800; color: var(--muted); margin-bottom: 10px; }
.tb-pop-hint { font-size: 11.5px; color: var(--muted); margin: 10px 0 0; }
.tb-pop-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* جستجوی بازشو */
.tb-search { position: relative; display: inline-flex; align-items: center; }
.tb-search .search-input {
  width: 0; padding: 10px 0; opacity: 0; border-radius: 12px;
  border: 1px solid transparent; background: var(--surface-2); color: var(--text);
  font-size: 13px; outline: none; font-family: var(--font);
  transition: width .22s ease, padding .22s ease, opacity .18s ease, border-color .15s ease;
}
.tb-search.is-open .search-input {
  width: min(300px, 44vw); padding: 8px 38px 8px 14px; opacity: 1; border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 14%, transparent);
}
.tb-search .tb-icon-btn { position: absolute; inset-inline-end: 0; z-index: 2; }
.tb-search.has-value .tb-icon-btn { border-color: var(--accent); color: var(--accent); }

/* انتخاب بازه سفارشی (داخل پاپ‌آپ) */
.range-box { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-input {
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 13.5px; cursor: pointer;
  outline: none; font-family: var(--font); text-align: center; min-width: 118px;
}
.range-input:focus { border-color: var(--primary); }

/* تقویم شمسی — داخل پاپ‌آپ به‌صورت درج‌شدنی (نه شناور) */
.tb-pop .jalali-picker {
  position: static; width: 100%; max-width: 320px; margin: 12px auto 0;
  box-shadow: none; border-style: dashed;
  display: none;
}
.tb-pop .jalali-picker.is-open { display: block; }
.jalali-picker {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; user-select: none;
}
.jp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.jp-title { font-weight: 700; font-size: 14px; }
.jp-nav { display: inline-flex; gap: 4px; }
.jp-nav button {
  width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text-soft); cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center; transition: all .15s ease;
}
.jp-nav button:hover { border-color: var(--primary); color: var(--primary); }
.jp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.jp-dow { font-size: 10.5px; color: var(--muted); text-align: center; padding: 4px 0; font-weight: 700; }
.jp-day {
  aspect-ratio: 1; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 12.5px; cursor: pointer; border: 1px solid transparent;
  background: transparent; color: var(--text-soft); transition: all .12s ease; padding: 0;
  font-family: var(--font);
}
.jp-day:hover { background: var(--primary-softer); color: var(--primary); }
.jp-day.is-empty { visibility: hidden; }
.jp-day.is-today { border-color: var(--primary); color: var(--primary); font-weight: 700; }
.jp-day.is-selected { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.jp-day.is-inrange { background: var(--primary-soft); color: var(--primary-hover); border-radius: 0; }
.jp-day.is-range-end { background: var(--primary); color: var(--on-primary); }
.jp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.jp-hint { font-size: 11.5px; color: var(--muted); }

/* ─── ۹) جدول روزانه ─────────────────────────────────────────────────────── */
.day-block { margin-bottom: 22px; }
.day-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(to left, color-mix(in srgb, var(--primary) 8%, var(--surface)), var(--surface));
  border: 1px solid var(--border); border-bottom: 0;
}
.day-title { font-size: 15.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.day-title .icon { color: var(--primary); }
.day-greg { color: var(--muted); font-size: 12.5px; direction: ltr; }
.day-badge {
  font-size: 11.5px; padding: 2px 10px; border-radius: 999px;
  background: var(--primary-softer); color: var(--primary); font-weight: 700;
}
.day-badge.is-today { background: var(--accent-soft); color: var(--accent); }
.impact-dots-summary { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.impact-dot { width: 10px; height: 10px; border-radius: 99px; display: inline-block; }
.impact-dot.high { background: var(--danger); }
.impact-dot.medium { background: var(--accent); }
.impact-dot.low { background: var(--border-strong); }
.impact-dot.holiday { background: var(--violet); }

.cal-table-wrap {
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  overflow-x: auto; background: var(--surface); box-shadow: var(--shadow-sm);
}
table.cal {
  width: 100%; border-collapse: collapse; min-width: 720px; font-size: 13.5px;
}
table.cal thead th {
  text-align: right; padding: 10px 14px; font-size: 12px; font-weight: 700;
  color: var(--muted); background: var(--surface-2);
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.cal tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.cal tbody tr:last-child td { border-bottom: 0; }
table.cal tbody tr { transition: background .12s ease; cursor: pointer; }
table.cal tbody tr:hover { background: var(--primary-softer); }
td.c-time { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* ساعت اصلی به وقت تهران — GMT با هاور/لمس روی تولتیپ */
.t-wrap { position: relative; display: inline-flex; align-items: center; cursor: help; outline: none; }
.t-wrap .t-main { font-weight: 800; font-size: 14px; }
.t-wrap .t-tip {
  position: absolute; bottom: calc(100% + 7px); right: 50%; transform: translateX(50%) translateY(4px);
  background: var(--text); color: var(--surface);
  padding: 5px 11px; border-radius: 8px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; opacity: 0; pointer-events: none;
  transition: opacity .14s ease, transform .14s ease; z-index: 60; box-shadow: var(--shadow-md);
}
.t-wrap .t-tip::after {
  content: ''; position: absolute; top: 100%; right: 50%; transform: translateX(50%);
  border: 5px solid transparent; border-top-color: var(--text);
}
.t-wrap:hover .t-tip, .t-wrap:focus-visible .t-tip, .t-wrap:focus .t-tip { opacity: 1; transform: translateX(50%) translateY(0); }
/* در جدول: تولتیپ از لبه راست ساعت به سمت چپ باز می‌شود تا توسط overflow بریده نشود */
td.c-time .t-tip { right: -8px; left: auto; transform: translateY(4px); }
td.c-time .t-tip::after { right: 16px; transform: none; }
td.c-time .t-wrap:hover .t-tip, td.c-time .t-wrap:focus-visible .t-tip, td.c-time .t-wrap:focus .t-tip { transform: translateY(0); }
/* چیپ وضعیت انتشار (تایمر / منتشر شد) */
.ev-state { display: block; margin-top: 3px; }
.ev-timer, .ev-pub {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
  font-variant-numeric: tabular-nums; line-height: 1.6;
}
.ev-timer { background: var(--bg-soft); color: var(--text-soft); border: 1px solid var(--border); }
.ev-timer.is-soon { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.ev-timer.is-crit { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); animation: fcPulse 1.4s ease-in-out infinite; }
.ev-timer b { font-weight: 800; direction: ltr; unicode-bidi: embed; }
.ev-pub { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); border: 1px solid color-mix(in srgb, var(--primary) 28%, transparent); }
.ev-pub.is-big, .ev-timer.is-big { font-size: 12.5px; padding: 5px 14px; }
@keyframes fcPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
/* ردیف خبر منتشرشده — حالت آرام‌تر */
tr.is-published td.c-time .t-main { color: var(--muted); font-weight: 600; }
tr.is-published .ev-title { color: var(--text-soft); }
/* جعبه وضعیت در صفحه جزئیات رویداد */
.ev-state-box { margin: 10px 0 4px; }
/* پرچم‌های SVG داخلی — جایگزین ایموجی (سازگار با ویندوز و ایران) */
.fc-flag {
  width: 19px; height: 13.3px; border-radius: 2.5px; flex: none;
  clip-path: inset(0 round 2.5px); display: inline-block; vertical-align: -2px;
  color: var(--muted);
}
td.c-cur { white-space: nowrap; }
.cur-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700;
  background: var(--bg-soft); border: 1px solid var(--border); color: var(--text-soft);
}
td.c-impact { white-space: nowrap; }
td.c-title { min-width: 240px; }
/* عنوان انگلیسی اصلی + ترجمه فارسی زیر آن */
.ev-title { font-weight: 650; display: block; }
.ev-title-fa { color: var(--primary); font-size: 12px; display: block; margin-top: 2px; font-weight: 500; }
.ev-title-en { color: var(--muted); font-size: 11.5px; direction: ltr; display: block; text-align: right; }
td.c-val { white-space: nowrap; font-variant-numeric: tabular-nums; direction: ltr; text-align: right; }
td.c-val .lab { display: block; font-size: 10px; color: var(--muted); direction: rtl; text-align: right; font-weight: 500; }
.val-actual { color: var(--primary); font-weight: 800; }
.val-empty { color: var(--muted); }
tr.is-holiday td { background: color-mix(in srgb, var(--violet) 5%, transparent); }

/* ── ستون و دکمه آلارم در جدول ── */
th.c-alarm { width: 44px; text-align: center !important; }
td.c-alarm { text-align: center; white-space: nowrap; }
.ev-bell {
  width: 30px; height: 30px; border-radius: 9px;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease; padding: 0;
}
.ev-bell:hover { color: var(--primary); background: var(--primary-softer); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.ev-bell.is-on { color: var(--primary); }
.ev-bell.is-on svg { fill: color-mix(in srgb, var(--primary) 25%, transparent); }
.ev-bell-big { cursor: pointer; }
.ev-bell-big.is-on { border-color: var(--primary); color: var(--primary); background: var(--primary-softer); }

/* ── نشان تعداد روی چیپ‌ها ── */
.chip-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: var(--primary); color: var(--on-primary);
  font-size: 10.5px; font-weight: 800; margin-inline-start: 2px;
}

/* ─── ۱۰) حالت‌های خالی/بارگذاری ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 56px 20px; color: var(--muted);
  border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface);
}
.empty-state .icon-lg { color: var(--border-strong); margin-bottom: 12px; }
.empty-state h3 { color: var(--text-soft); font-size: 16.5px; margin: 0 0 6px; }
.empty-state p { margin: 0 0 18px; font-size: 14px; }

.skeleton { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.sk-row { height: 44px; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; }
.sk-row::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--border) 60%, transparent), transparent);
  animation: sk-wave 1.4s infinite;
}
@keyframes sk-wave { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }

/* هشدار داده نمونه */
.demo-banner {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 20px;
  font-size: 14px;
}

/* ─── ۱۱) صفحه جزئیات رویداد ─────────────────────────────────────────────── */
.event-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 26px; margin-top: 18px;
}
.event-card .ev-currency { margin-bottom: 14px; }
.event-title-fa { color: var(--primary); font-size: clamp(1.05rem, 2.6vw, 1.35rem); font-weight: 700; margin: 0 0 4px; line-height: 1.7; }
.event-title-en { font-size: clamp(1.25rem, 2.8vw, 1.7rem); font-weight: 900; direction: ltr; text-align: right; margin: 0 0 10px; line-height: 1.45; }
.event-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 22px 0; }
.event-stat {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; text-align: center;
}
.event-stat .lab { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.event-stat .val { font-size: 20px; font-weight: 900; direction: ltr; font-variant-numeric: tabular-nums; }
.event-stat.is-actual .val { color: var(--primary); }
.event-meta-list { display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--text-soft); }
.event-meta-list .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.event-meta-list .row .icon { color: var(--primary); }

/* ─── ۱۲) ناوبری بین روزها/دوره‌ها ──────────────────────────────────────── */
.period-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 26px 0 8px; }
.results-summary { color: var(--muted); font-size: 13px; }

/* ─── ۱۳) بخش SSEO / محتوا ──────────────────────────────────────────────── */
.info-section { margin: 44px 0 0; }
.info-section h2 { font-size: 20px; font-weight: 800; margin: 0 0 12px; padding-inline-start: 14px; border-inline-start: 4px solid var(--primary); }
.info-section p { color: var(--text-soft); font-size: 15px; margin: 0 0 12px; }
.info-section ul { color: var(--text-soft); font-size: 15px; padding-inline-start: 22px; margin: 0 0 12px; }
.info-section li { margin-bottom: 7px; }
.info-section li::marker { color: var(--primary); font-weight: 700; }

/* ─── ۱۴) فوتر — همان ساختار سایت اصلی ──────────────────────────────────── */
.site-footer { margin-top: auto; background: var(--surface); border-top: 1px solid var(--border); padding: 54px 0 0; }
.footer-grid { display: grid; grid-template-columns: 2.2fr 1fr 1fr 1.3fr; gap: 36px; padding-bottom: 40px; }
.footer-brand .brand { margin-bottom: 14px; }
.footer-about { color: var(--text-soft); font-size: 13.5px; margin: 0 0 18px; }
.footer-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.footer-socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  transition: all .18s ease;
}
.footer-socials a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.footer-col h3 { font-size: 14.5px; font-weight: 700; margin: 0 0 14px; color: var(--text); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer-col a { color: var(--text-soft); font-size: 13.5px; transition: color .15s ease; }
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 18px 0; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px;
}
.footer-bottom p { margin: 0; }
.footer-love { display: inline-flex; align-items: center; gap: 5px; }
.footer-love .icon { color: var(--rose); }
.footer-version { background: var(--bg-soft); padding: 1px 8px; border-radius: 99px; font-size: 11px; }

/* ─── ۱۵) بازگشت به بالا ─────────────────────────────────────────────────── */
.back-to-top {
  position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 90;
  width: 46px; height: 46px; border-radius: 13px; border: 1px solid var(--border);
  background: var(--surface); color: var(--primary); cursor: pointer;
  box-shadow: var(--shadow-md); opacity: 0; visibility: hidden;
  transform: translateY(10px); transition: all .25s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { border-color: var(--primary); transform: translateY(-2px); }

/* ─── ۱۶) ادمین ──────────────────────────────────────────────────────────── */
.admin-shell { display: flex; gap: 24px; align-items: flex-start; padding: 30px 0 60px; }
.admin-side {
  width: 250px; flex-shrink: 0; position: sticky; top: calc(var(--header-h) + 16px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-sm);
}
.admin-side h2 { font-size: 15px; margin: 0 0 12px; padding: 4px 10px; }
.admin-nav { display: flex; flex-direction: column; gap: 3px; }
.admin-nav a {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 11px;
  color: var(--text-soft); font-size: 14px; font-weight: 500; transition: all .14s ease;
}
.admin-nav a:hover { background: var(--primary-softer); color: var(--primary); }
.admin-nav a.is-active { background: var(--primary); color: var(--on-primary); }
.admin-main { flex: 1; min-width: 0; }
.admin-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.admin-card h3 { font-size: 16px; font-weight: 800; margin: 0 0 16px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat-box { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat-box .lab { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-box .val { font-size: 24px; font-weight: 900; color: var(--primary); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--text-soft); }
.form-field input[type=text], .form-field input[type=password], .form-field input[type=number],
.form-field input[type=url], .form-field select {
  padding: 10px 13px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font-size: 14px; outline: none;
  transition: border-color .15s ease; font-family: var(--font); width: 100%;
}
.form-field input:focus, .form-field select:focus { border-color: var(--primary); }
.form-hint { font-size: 11.5px; color: var(--muted); }
.login-box { max-width: 420px; margin: 48px auto; }
.alert {
  padding: 13px 17px; border-radius: var(--radius); font-size: 14px; margin-bottom: 16px;
  border: 1px solid var(--border);
}
.alert-ok { background: var(--primary-softer); border-color: color-mix(in srgb, var(--primary) 35%, transparent); color: var(--primary); }
.alert-err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); }
.alert-info { background: color-mix(in srgb, #2563eb 8%, transparent); border-color: color-mix(in srgb, #2563eb 35%, transparent); color: #1d4ed8; }
[data-theme="dark"] .alert-info { color: #93c5fd; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle-row:last-child { border-bottom: 0; }
.switch { position: relative; width: 46px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 99px; background: var(--border-strong);
  transition: background .2s ease; cursor: pointer;
}
.switch .track::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 20px; height: 20px; border-radius: 99px; background: #fff; transition: transform .2s ease;
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(-20px); }

/* ─── مودال آلارم ─────────────────────────────────────────────────────── */
.fc-modal { position: fixed; inset: 0; z-index: 200; display: none; }
.fc-modal.is-open { display: block; }
.fc-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(8, 12, 10, .55); backdrop-filter: blur(3px);
}
.fc-modal-card {
  position: relative;
  margin: min(7vh, 72px) auto 24px;
  width: min(580px, calc(100% - 28px));
  max-height: 84vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow-lg);
  animation: modal-pop .2s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes modal-pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.fc-modal-close {
  position: absolute; top: 14px; inset-inline-start: 14px;
  width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s ease; z-index: 2;
}
.fc-modal-close:hover { color: var(--danger); border-color: var(--danger); }

.al-title { font-size: 16.5px; font-weight: 800; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.al-title .icon { color: var(--primary); }
.al-event-head {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 16px;
}
.al-event-head .cur { font-size: 20px; line-height: 1; padding-top: 2px; }
.al-event-head .t { font-weight: 700; font-size: 14px; }
.al-event-head .en { color: var(--muted); font-size: 11.5px; direction: ltr; text-align: right; display: block; margin-top: 2px; }
.al-event-head .meta { color: var(--text-soft); font-size: 12px; margin-top: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.al-sec { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 16px 0 8px; }
.al-leads { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.al-lead {
  padding: 9px 6px; border-radius: 10px; cursor: pointer; text-align: center;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-soft);
  font-family: var(--font); font-size: 12px; font-weight: 600; transition: all .13s ease;
}
.al-lead:hover { border-color: var(--primary); color: var(--primary); }
.al-lead.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.al-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.al-switch-row:last-of-type { border-bottom: 0; }
.al-switch-row .lab { font-size: 13.5px; font-weight: 700; }
.al-switch-row .hint { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.al-chat-box { margin-top: 10px; display: none; }
.al-chat-box.is-visible { display: block; }
.al-chat-input {
  width: 100%; padding: 10px 13px; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 14px; direction: ltr; text-align: left; outline: none; font-family: var(--font);
}
.al-chat-input:focus { border-color: var(--primary); }
.al-series { display: flex; align-items: flex-start; gap: 9px; padding: 12px 14px; margin-top: 14px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 12px; cursor: pointer; }
.al-series input { margin-top: 3px; accent-color: var(--accent); }
.al-series .t { font-size: 13px; font-weight: 700; color: var(--accent); }
.al-series .h { font-size: 11.5px; color: var(--accent); opacity: .85; margin-top: 3px; }
.al-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.al-error { background: var(--danger-soft); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: 10px; padding: 10px 14px; font-size: 13px; margin-top: 12px; display: none; }
.al-error.is-visible { display: block; }

/* فهرست آلارم‌های من */
.al-row { display: flex; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.al-row:last-child { border-bottom: 0; }
.al-row .cur { font-size: 18px; }
.al-row .info { flex: 1; min-width: 0; }
.al-row .t { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.al-row .m { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.al-row .m .sep { opacity: .5; }
.al-tag { font-size: 10px; font-weight: 800; padding: 1px 7px; border-radius: 99px; }
.al-tag.series { background: var(--accent-soft); color: var(--accent); }
.al-tag.browser { background: var(--primary-softer); color: var(--primary); }
.al-tag.bale { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.al-del {
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all .14s ease; flex-shrink: 0;
}
.al-del:hover { color: var(--danger); border-color: var(--danger); }
.al-empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 13.5px; }

/* ─── توست‌ها ─────────────────────────────────────────────────────────── */
.fc-toasts {
  position: fixed; bottom: 20px; inset-inline-start: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100vw - 40px));
}
.fc-toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-inline-start: 4px solid var(--primary);
  border-radius: 13px; padding: 12px 14px;
  box-shadow: var(--shadow-lg); font-size: 13px; color: var(--text);
  animation: toast-in .28s cubic-bezier(.2,.9,.3,1.15);
}
.fc-toast.is-out { animation: toast-out .25s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
.fc-toast .ico { flex-shrink: 0; color: var(--primary); margin-top: 1px; }
.fc-toast.warn { border-inline-start-color: var(--accent); } .fc-toast.warn .ico { color: var(--accent); }
.fc-toast.err { border-inline-start-color: var(--danger); } .fc-toast.err .ico { color: var(--danger); }
.fc-toast .body { flex: 1; min-width: 0; }
.fc-toast .body b { display: block; font-size: 13px; margin-bottom: 2px; }
.fc-toast .body span { color: var(--text-soft); font-size: 12.5px; line-height: 1.7; display: block; }
.fc-toast .x {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  width: 22px; height: 22px; border-radius: 7px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.fc-toast .x:hover { background: var(--bg-soft); color: var(--text); }


/* ─── ۱۸) ادمین — تب‌ها، ربات بله، کرون ──────────────────────────────────── */
[hidden] { display: none !important; }
.admin-nav button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; border-radius: 12px; border: 0; cursor: pointer;
  background: transparent; color: var(--text-soft); font-family: var(--font);
  font-size: 14px; font-weight: 600; text-align: start; transition: all .15s ease;
}
.admin-nav button:hover { background: var(--primary-softer); color: var(--primary); }
.admin-nav button.is-active { background: var(--primary); color: var(--on-primary); }
.nav-badge {
  margin-inline-start: auto; background: var(--accent); color: #fff;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
}
.admin-nav button.is-active .nav-badge { background: rgba(255,255,255,.25); }

/* وضعیت ربات */
.bot-status {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2);
}
.bot-status-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.bot-avatar {
  width: 46px; height: 46px; border-radius: 14px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border); color: var(--muted);
  border: 1px solid var(--border-strong);
}
.bot-avatar.is-ok { background: var(--primary-softer); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); }
.bot-status-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* دستورهای کرون */
.cron-cmd-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.cron-cmd-row input {
  flex: 1 1 300px; min-width: 0; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.cron-cmd-row .copy-btn { flex: none; }

/* هشدار اطلاعی */
.alert-warn {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
.alert-warn code {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 1px 6px; border-radius: 6px; font-size: 12px;
}

/* ─── ۱۷) واکنش‌گرا ──────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root { --header-h: 64px; }
  .main-nav, .header-cta { display: none; }
  .nav-toggle { display: inline-flex; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { justify-content: center; text-align: center; }
  .event-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .admin-shell { flex-direction: column; }
  .admin-side { width: 100%; position: static; }
  .admin-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .admin-nav a { white-space: nowrap; }
  .cal-page { padding: 24px 0 44px; }
  .toolbar { top: var(--header-h); gap: 8px; padding: 8px 12px; }
  .tb-pop { min-width: min(92vw, 420px); }
  .tb-search.is-open .search-input { width: min(240px, 52vw); }
  .fc-modal-card { margin-top: 4vh; padding: 18px; }
  .al-leads { grid-template-columns: repeat(2, 1fr); }
  .fc-toasts { inset-inline: 14px; bottom: 14px; max-width: none; }
}
@media (max-width: 480px) {
  .container { width: calc(100% - 32px); }
  .event-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .event-stat .val { font-size: 16px; }
  .filter-label { min-width: 100%; padding-top: 0; }
  .tb-greg { display: none; }
  .tb-sep { display: none; }
  .tb-switch-label { font-size: 12px; }
  .tb-btn { padding: 7px 10px; font-size: 12.5px; }
  .tb-clock .t-main { font-size: 1.12rem; }
  .tb-jalali { font-size: 12.5px; }
}

@media print {
  .site-header, .site-footer, .toolbar, .back-to-top, .update-actions, .period-nav,
  .ev-bell, td.c-alarm, th.c-alarm, .fc-toasts, .fc-modal { display: none !important; }
  body { background: #fff; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   نمودار تاریخی + آرشیو داده‌ها (صفحه‌ی جزئیات خبر) — v1.5
   ═══════════════════════════════════════════════════════════════════════════ */
.ev-chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.ev-chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ev-chart-head h2 { margin: 0; font-size: 17px; }
.ev-chart-unit { font-size: 12px; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.ev-chart-sub { color: var(--text-soft); font-size: 12.5px; margin: 8px 0 4px; }
.ev-chart-src { color: var(--muted); font-size: 11.5px; margin: 10px 0 0; }
.ev-chart-wrap { width: 100%; margin-top: 8px; }
.ev-chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.ev-chart-svg .ev-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 4; }
.ev-chart-svg .ev-tick { font-size: 10.5px; fill: var(--muted); font-family: inherit; }
.ev-chart-svg .ev-area { fill: var(--primary); opacity: 0.10; }
.ev-chart-svg .ev-line { stroke: var(--primary); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ev-chart-svg .ev-line-fc { stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 4; opacity: .8; }
.ev-chart-svg .ev-dot { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.ev-chart-svg .ev-dot-last { fill: var(--primary); stroke: var(--primary); }
.ev-chart-svg .ev-hit { cursor: pointer; }
.ev-chart-tip {
  display: none; position: absolute; z-index: 30; pointer-events: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  box-shadow: var(--shadow-md); padding: 8px 12px; font-size: 12px; line-height: 1.7;
  min-width: 130px; text-align: center;
}
.ev-chart-tip b { color: var(--primary); font-size: 14px; display: block; }
.ev-chart-tip span { display: block; color: var(--text-soft); }
.ev-chart-tip em { display: block; color: var(--muted); font-style: normal; font-size: 11px; margin-top: 3px; }

/* ── آرشیو ── */
.ev-archive-sub { color: var(--text-soft); font-size: 13px; margin: 6px 0 14px; }
.ev-archive-wrap { border-radius: var(--radius); }
.ev-archive th, .ev-archive td { white-space: nowrap; }
.ev-archive .c-date a { color: var(--text); text-decoration: none; border-bottom: 1px dashed var(--border-strong); }
.ev-archive .c-date a:hover { color: var(--primary); border-color: var(--primary); }
.ev-archive .is-current-row { background: var(--primary-softer); }
.ev-archive .is-current-row td { border-top: 1px solid var(--primary-soft); border-bottom: 1px solid var(--primary-soft); }
.chip-xs { font-size: 10.5px; padding: 1px 7px; margin-inline-start: 6px; vertical-align: middle; }
.diff { font-variant-numeric: tabular-nums; font-weight: 600; }
.diff.up { color: #15803d; }
.diff.down { color: var(--danger); }

[data-theme="dark"] .ev-chart-svg .ev-grid { stroke: rgba(255,255,255,.09); }
[data-theme="dark"] .diff.up { color: #4ade80; }
[data-theme="dark"] .ev-archive .is-current-row { background: rgba(4, 120, 87, .16); }

@media (max-width: 640px) {
  .ev-chart-card { padding: 16px; }
  .ev-chart-tip { min-width: 110px; font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   اثر انتشار + درباره‌ی خبر — v1.6
   ═══════════════════════════════════════════════════════════════════════════ */
.impact-box {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
}
.impact-box .ib-head { display: flex; align-items: center; gap: 8px; }
.impact-box .ib-title {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700; font-size: .9rem; color: var(--text-soft);
}
.impact-box .ib-title svg { color: var(--muted); }
.impact-box .ib-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-top: 8px; font-weight: 700; font-size: 1.05rem;
}
.impact-box .ib-arrow { font-size: 1.15rem; line-height: 1; }
.impact-box .ib-sep { color: var(--muted); font-weight: 400; }
.impact-box .ib-effect { padding: 3px 12px; border-radius: 999px; font-size: .88rem; font-weight: 700; }
.impact-box .ib-rule { margin: 10px 0 0; color: var(--text-soft); font-size: 12.5px; line-height: 1.9; }

.impact-box.is-positive { border-color: color-mix(in srgb, var(--primary) 38%, transparent); background: color-mix(in srgb, var(--primary) 6%, var(--surface-2)); }
.impact-box.is-positive .ib-arrow { color: var(--primary); }
.impact-box.is-positive .ib-effect { background: var(--primary-soft); color: var(--primary); }
.impact-box.is-negative { border-color: color-mix(in srgb, var(--danger) 38%, transparent); background: color-mix(in srgb, var(--danger) 6%, var(--surface-2)); }
.impact-box.is-negative .ib-arrow { color: var(--danger); }
.impact-box.is-negative .ib-effect { background: var(--danger-soft); color: var(--danger); }
.impact-box.is-neutral .ib-arrow { color: var(--muted); }
.impact-box.is-neutral .ib-effect { background: var(--bg-soft); color: var(--text-soft); }
.impact-box.is-pending { border-style: dashed; }
.impact-box.is-pending .ib-row { font-weight: 500; font-size: .95rem; color: var(--text-soft); }

/* چیپ فشرده‌ی اثر انتشار در ردیف‌های جدول */
.impact-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 700; padding: 2px 9px;
  border-radius: 999px; margin-inline-start: 6px; vertical-align: middle;
  white-space: nowrap;
}
.impact-chip .ic-arrow { font-size: .72rem; line-height: 1; }
.impact-chip.is-positive { background: var(--primary-soft); color: var(--primary); }
.impact-chip.is-negative { background: var(--danger-soft); color: var(--danger); }

/* درباره‌ی خبر */
.ev-about-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 22px 24px; display: grid; gap: 16px;
}
.ev-about-block h3 {
  margin: 0 0 6px; font-size: 14px; color: var(--primary);
  display: flex; align-items: center; gap: 6px;
}
.ev-about-block h3::before {
  content: ''; width: 7px; height: 7px; border-radius: 2px;
  background: var(--primary); transform: rotate(45deg); flex: none;
}
.ev-about-block p { margin: 0; line-height: 2; color: var(--text); font-size: 14.5px; }
.ev-about-note {
  margin: 2px 0 0; padding-top: 12px; border-top: 1px dashed var(--border);
  color: var(--muted); font-size: 12px; line-height: 1.9;
}
.ev-chart-hint {
  margin: 10px 0 0; padding: 10px 12px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; line-height: 1.9;
}

@media (max-width: 640px) {
  .ev-about-card { padding: 16px; }
  .impact-box { padding: 12px 14px; }
  .impact-box .ib-row { font-size: .98rem; }
  .impact-chip { display: none; } /* جدول موبایل فشرده است — اثر در صفحه‌ی خبر دیده می‌شود */
}

/* ═══════════════════════════════════════════════════════════════════════════
   ۲.۰ — PWA + اعلان‌ها + سئو (پنل و فرانت)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── دکمه نصب اپ در هدر ── */
.fc-install-btn { position: relative; color: var(--primary); }
.fc-install-btn:hover { background: var(--primary-softer); }

/* ── پنل: بخش‌های تب PWA ── */
.admin-card .sec-title {
  font-size: 14px; font-weight: 800; color: var(--text);
  margin: 26px 0 10px; padding-bottom: 8px; border-bottom: 1px dashed var(--border);
}
.admin-card .sec-title:first-of-type { margin-top: 18px; }

.mini-chart {
  display: flex; align-items: flex-end; gap: 6px;
  height: 110px; padding: 12px 12px 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto;
}
.mini-col { flex: 1 1 0; min-width: 22px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.mini-bar {
  width: 100%; max-width: 26px; min-height: 4px;
  background: linear-gradient(180deg, var(--primary), color-mix(in srgb, var(--primary) 70%, #000));
  border-radius: 4px 4px 0 0; transition: height .3s ease;
}
.mini-lab { font-size: 9.5px; color: var(--muted); margin-top: 6px; white-space: nowrap; direction: ltr; }

.ok-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: rgba(5, 150, 105, .12); color: #059669;
}
.err-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  background: rgba(220, 38, 38, .1); color: var(--danger);
}

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }

.push-compose .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.seo-checklist { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.seo-checklist li { font-size: 13px; color: var(--text-soft); line-height: 1.7; }
.seo-checklist code { font-size: 11.5px; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }

/* ── فرم‌های ادمین (اگر نبود) ── */
.admin-card .form-row { margin-bottom: 14px; }
.admin-card .form-row label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.admin-card .form-row input[type="text"],
.admin-card .form-row input:not([type]),
.admin-card .form-row textarea,
.admin-card .form-row select {
  width: 100%; max-width: 560px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 13px; font-family: inherit;
}
.admin-card .form-row input:focus, .admin-card .form-row textarea:focus, .admin-card .form-row select:focus {
  outline: 2px solid var(--primary-softer); border-color: var(--primary);
}
.admin-card .btn-xs { padding: 3px 9px; font-size: 11.5px; border-radius: 6px; }

/* ── حالت تاریک ── */
[data-theme="dark"] .mini-chart { background: var(--surface-2); }
[data-theme="dark"] .mini-bar { opacity: .9; }
[data-theme="dark"] .seo-checklist code { background: var(--surface-2); }

/* ── موبایل ── */
@media (max-width: 640px) {
  .push-compose .two-col { grid-template-columns: 1fr; }
  .seo-checklist { grid-template-columns: 1fr; }
  .mini-chart { height: 90px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ۲.۱ — باکس شناور نصب (موبایل) + باکس اعلان خودکار
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── باکس شناور «نصب اپ» — بیضی پایین صفحه (فقط موبایل) ── */
.fc-install-pill {
  position: fixed; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  left: 50%; transform: translate(-50%, 20px);
  display: flex; align-items: center; gap: 10px;
  max-width: min(430px, calc(100vw - 24px));
  padding: 10px 12px 10px 14px;
  background: linear-gradient(135deg, #059669, #047857 55%, #065f46);
  color: #fff; border-radius: 999px;
  box-shadow: 0 10px 30px rgba(4, 120, 87, .45), 0 2px 8px rgba(0,0,0,.18);
  z-index: 150; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.fc-install-pill.is-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.fc-install-pill .fip-icon {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.16);
}
.fc-install-pill .fip-texts { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.fc-install-pill .fip-texts b { font-size: 13.5px; font-weight: 800; line-height: 1.4; white-space: nowrap; }
.fc-install-pill .fip-texts span { font-size: 11px; opacity: .85; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-install-pill .fip-install {
  flex: 0 0 auto; border: 0; cursor: pointer;
  padding: 8px 20px; border-radius: 999px;
  background: #fff; color: #047857;
  font-family: inherit; font-size: 13.5px; font-weight: 900;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
  transition: transform .15s ease;
}
.fc-install-pill .fip-install:active { transform: scale(.96); }
.fc-install-pill .fip-close {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 26px; height: 26px; margin-left: -2px;
  border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.14); color: #fff;
}
@media (max-width: 480px) {
  .fc-install-pill .fip-texts span { max-width: 170px; }
}
/* دکمه نصب هدر فقط در دسکتاپ (موبایل باکس شناور دارد) */
@media (max-width: 768px) {
  .fc-install-btn { display: none !important; }
}

/* ── باکس «دریافت خودکار اخبار اقتصادی» ── */
.fc-notif-banner {
  position: relative; overflow: hidden;
  margin: 14px 0 6px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
  border-radius: var(--radius);
  background:
    radial-gradient(1200px 200px at 85% -60%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 60%),
    linear-gradient(180deg, color-mix(in srgb, var(--primary) 5%, var(--surface)), var(--surface));
  opacity: 0; transform: translateY(-6px);
  transition: opacity .35s ease, transform .35s ease;
}
.fc-notif-banner.is-show { opacity: 1; transform: none; }
.fc-notif-banner.is-done { border-color: var(--ok, #059669); }
.fc-notif-banner .fnb-glow {
  position: absolute; inset-inline-start: -30px; top: -30px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 20%, transparent), transparent 70%);
  pointer-events: none;
}
.fc-notif-banner .fnb-close {
  position: absolute; top: 10px; inset-inline-end: 10px;
  display: grid; place-items: center;
  width: 26px; height: 26px; border: 0; border-radius: 50%;
  background: transparent; color: var(--muted); cursor: pointer;
}
.fc-notif-banner .fnb-close:hover { background: var(--primary-softer); color: var(--text); }
.fc-notif-banner .fnb-main { display: flex; align-items: center; gap: 12px; }
.fc-notif-banner .fnb-bell {
  position: relative; display: grid; place-items: center; flex: 0 0 auto;
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #065f46);
  color: #fff; box-shadow: 0 6px 14px rgba(4, 120, 87, .35);
}
.fc-notif-banner .fnb-ping {
  position: absolute; top: 6px; inset-inline-end: 7px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #fbbf24;
  animation: fcPing 1.8s ease-out infinite;
}
@keyframes fcPing {
  0% { box-shadow: 0 0 0 0 rgba(251, 191, 36, .55); }
  70% { box-shadow: 0 0 0 9px rgba(251, 191, 36, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}
.fc-notif-banner .fnb-texts b { display: block; font-size: 15px; font-weight: 900; color: var(--text); }
.fc-notif-banner .fnb-texts span { display: block; font-size: 12.5px; color: var(--text-soft); line-height: 1.7; margin-top: 3px; }
.fc-notif-banner .fnb-config {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed var(--border);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
}
.fc-notif-banner .fnb-lab { font-size: 12px; font-weight: 700; color: var(--muted); }
.fc-notif-banner .fnb-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.fc-notif-banner .fnb-chip {
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-soft); font-family: inherit;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all .15s ease;
}
.fc-notif-banner .fnb-chip:hover { border-color: var(--primary); color: var(--primary); }
.fc-notif-banner .fnb-chip.is-on {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 2px 8px rgba(4, 120, 87, .3);
}
.fc-notif-banner .fnb-activate { margin-inline-start: auto; }
.fc-notif-banner .fnb-error {
  display: none; width: 100%;
  font-size: 12px; color: var(--danger); font-weight: 700;
}
.fc-notif-banner .fnb-error.is-visible { display: block; }

@media (max-width: 640px) {
  .fc-notif-banner .fnb-main { align-items: flex-start; }
  .fc-notif-banner .fnb-bell { width: 40px; height: 40px; }
  .fc-notif-banner .fnb-activate { margin-inline-start: 0; width: 100%; }
}

/* ── بخش «اعلان خودکار» در مودال آلارم ── */
.al-auto {
  margin-top: 14px; padding: 12px 14px;
  border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--primary) 4%, var(--surface-2));
}
.al-auto .aa-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.al-auto .aa-title { font-size: 13px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 7px; }
.al-auto .aa-hint { font-size: 11.5px; color: var(--muted); line-height: 1.7; margin-top: 5px; }
.al-auto .aa-config { display: none; margin-top: 10px; }
.al-auto .aa-config.is-visible { display: block; }
.al-auto .aa-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.al-auto .aa-lab { font-size: 11.5px; font-weight: 700; color: var(--muted); min-width: 92px; }
.al-auto .aa-chip {
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); font-family: inherit;
  padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; cursor: pointer;
}
.al-auto .aa-chip.is-on {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
.al-auto .aa-save {
  margin-top: 10px; width: 100%;
  border: 0; border-radius: 8px; cursor: pointer;
  padding: 8px 12px; font-family: inherit; font-size: 12.5px; font-weight: 800;
  background: var(--primary); color: #fff;
}
.al-auto .aa-status { font-size: 11px; font-weight: 800; color: var(--ok, #059669); }
