/* ============================================================
   همایش نور — نگاشت تم تاریک روی پوستهٔ کانون
   فقط وقتی <html data-theme="dark"> باشد فعال می‌شود.
   ============================================================ */

html[data-theme="dark"] {
  color-scheme: dark;

  /* main.css */
  --primary: #4f7ec4;
  --primary-dark: #cfe0f7;
  --primary-soft: #16213a;
  --accent: #d9b361;
  --accent-soft: #2a2417;
  --ink: #e6eef7;
  --muted: #9db0c1;
  --line: #22324a;
  --bg: #0b1220;
  --card: #111a2c;

  /* admin.css */
  --p: #4f7ec4;
  --p-dark: #cfe0f7;
  --p-soft: #16213a;
  --gold: #d9b361;
}

html[data-theme="dark"] body {
  background: #0b1220;
  color: #e6eef7;
}

html[data-theme="dark"] a { color: #8fb6ea; }

html[data-theme="dark"] .site-header,
html[data-theme="dark"] .topbar { background: #0f1727; }
html[data-theme="dark"] .topbar { color: #9db0c1; }

html[data-theme="dark"] .card,
html[data-theme="dark"] .stat,
html[data-theme="dark"] .hero-kicker,
html[data-theme="dark"] .search-card,
html[data-theme="dark"] .filters,
html[data-theme="dark"] .empty-box,
html[data-theme="dark"] .book-box,
html[data-theme="dark"] .desc-box,
html[data-theme="dark"] .content-page,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .panel-box,
html[data-theme="dark"] .menu-item,
html[data-theme="dark"] .auth-tabs button.active {
  background: #111a2c;
  border-color: #22324a;
}

html[data-theme="dark"] .btn-outline {
  background: #16213a;
  border-color: #3c5f92;
  color: #cfe0f7;
}

html[data-theme="dark"] .input,
html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  background: #16213a;
  border-color: #22324a;
  color: #e6eef7;
}

html[data-theme="dark"] .cal-free { background: #16213a; }
html[data-theme="dark"] .hero-dot.active { background: #e6eef7; border-color: #e6eef7; }

html[data-theme="dark"] .badge-item.badge-light-card { background: #16213a; }
html[data-theme="dark"] .footer-brand img { background: #f7f2e7; }

@media (max-width: 760px) {
  html[data-theme="dark"] .nav {
    background: #111a2c;
    border-color: #22324a;
  }
}

/* ---------- پنل مدیریت ---------- */
html[data-theme="dark"] .admin-top {
  background: #111a2c;
  border-color: #22324a;
}
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .panel {
  background: #111a2c;
  border-color: #22324a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35);
}
html[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #0d1728, #070d18);
}
html[data-theme="dark"] .sidebar .brand img {
  background: #f7f2e7;
}
html[data-theme="dark"] .table th {
  background: #16213a;
  color: #cfe0f7;
}
html[data-theme="dark"] .table td { border-color: #1c2a40; }
html[data-theme="dark"] .login-page { background: #0b1220; }
html[data-theme="dark"] .login-card {
  background: #111a2c;
  color: #e6eef7;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55);
}
html[data-theme="dark"] .login-card .lgo { background: #f7f2e7; border-radius: 12px; padding: 6px 10px; }
html[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #3f6cb0, #2c4d80);
  color: #f2f7ff;
}
html[data-theme="dark"] .btn-danger { background: #3a1512; color: #f3b3ac; border-color: #5a2420; }
html[data-theme="dark"] .badge-green { background: #12332a; color: #9be3c2; }
html[data-theme="dark"] .badge-red { background: #3a1512; color: #f3b3ac; }
html[data-theme="dark"] .badge-gold { background: #2a2417; color: #e0be77; }
html[data-theme="dark"] .flash-ok { background: #12332a; border-color: #1d4b39; color: #9be3c2; }
html[data-theme="dark"] .flash-err { background: #3a1512; border-color: #5a2420; color: #f3b3ac; }
html[data-theme="dark"] .flash-info { border-color: #2b4570; }

/* دکمهٔ ورود در کارت ورود باید تمام‌عرض باشد (admin.css .btn-block ندارد) */
.login-card form .btn { width: 100%; justify-content: center; }
html[data-theme="dark"] .flash-success { background: #12332a; color: #9be3c2; }
html[data-theme="dark"] .flash-error { background: #3a1512; color: #f3b3ac; }
