/* ==========================================================================
   KAI Planner - Cosmic Dark Mode (Inspired by Windscribe Cosmic Starry UI)
   High-Performance, Zero-Lag, Crisp Contrast & Editorial Aesthetics
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Theme Variables & Base Color System (High Specificity)
   -------------------------------------------------------------------------- */
:root[data-theme="dark"],
html[data-theme="dark"],
body.dark-theme,
[data-theme="dark"] {
  --bg: #060913;
  --surface: #0d1527;
  --surface-2: #141f38;
  --surface-solid: #0d1527;
  --surface-input: #090f1d;
  --ink: #f8fafc;
  --ink-secondary: #cbd5e1;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.18);

  /* Cosmic Windscribe Emerald Accents */
  --accent: #10b981;
  --accent-2: #00dc82;
  --accent-hover: #059669;
  --accent-glow: 0 0 24px rgba(0, 220, 130, 0.40);
  --accent-glow-subtle: 0 0 16px rgba(0, 220, 130, 0.22);
  --cyan-accent: #38bdf8;
  --cyan-glow: 0 0 20px rgba(56, 189, 248, 0.35);

  --danger: #f87171;
  --danger-bg: rgba(239, 68, 68, 0.18);
  --danger-line: rgba(239, 68, 68, 0.35);

  --shadow: 0 16px 40px -6px rgba(0, 0, 0, 0.70), 0 0 0 1px rgba(255, 255, 255, 0.06);
  --shadow-lg: 0 24px 50px -10px rgba(0, 0, 0, 0.85), 0 0 25px rgba(0, 220, 130, 0.08);

  /* Schedule Table Variables */
  --schedule-outer: rgba(255, 255, 255, 0.14);
  --schedule-surface: #0a1122;
  --schedule-grid: rgba(255, 255, 255, 0.08);
  --schedule-topic-text: #f1f5f9;
  --schedule-subject-bg: rgba(26, 38, 72, 0.88);
  --schedule-subject-text: #38bdf8;
  --schedule-topic-bg: rgba(13, 20, 36, 0.72);
  --schedule-time-bg: rgba(18, 28, 52, 0.88);
  --schedule-time-text: #00dc82;
  --schedule-guide-bg: rgba(22, 33, 58, 0.95);
  --schedule-guide-text: #cbd5e1;

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   2. Cosmic Deep Space Background with Stars & Nebulae
   -------------------------------------------------------------------------- */
[data-theme="dark"] body {
  color: var(--ink) !important;
  background-color: #060913 !important;
  background-image:
    /* Glowing Nebulae */
    radial-gradient(1200px 650px at 95% -10%, rgba(14, 165, 233, 0.18) 0%, transparent 60%),
    radial-gradient(900px 550px at -10% 20%, rgba(0, 220, 130, 0.14) 0%, transparent 55%),
    radial-gradient(850px 750px at 50% 100%, rgba(99, 102, 241, 0.10) 0%, transparent 60%),
    /* Embedded Starfield SVG with Diamond 4-point Sparkles & Clusters */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='500' height='500' viewBox='0 0 500 500'%3E%3Cdefs%3E%3CradialGradient id='starGlow' cx='50%25' cy='50%25' r='50%25'%3E%3Cstop offset='0%25' stop-color='%23ffffff' stop-opacity='1'/%3E%3Cstop offset='40%25' stop-color='%2338bdf8' stop-opacity='0.6'/%3E%3Cstop offset='100%25' stop-color='%2300dc82' stop-opacity='0'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cg fill='%23ffffff'%3E%3Ccircle cx='32' cy='45' r='0.9' opacity='0.75'/%3E%3Ccircle cx='145' cy='82' r='1.3' opacity='0.9' fill='%23bae6fd'/%3E%3Ccircle cx='210' cy='35' r='0.8' opacity='0.5'/%3E%3Ccircle cx='380' cy='65' r='1.1' opacity='0.85' fill='%23bbf7d0'/%3E%3Ccircle cx='460' cy='120' r='0.7' opacity='0.6'/%3E%3Ccircle cx='75' cy='190' r='1.2' opacity='0.8'/%3E%3Ccircle cx='180' cy='240' r='0.8' opacity='0.5'/%3E%3Ccircle cx='290' cy='170' r='1.4' opacity='0.9' fill='%23bae6fd'/%3E%3Ccircle cx='410' cy='230' r='0.7' opacity='0.65'/%3E%3Ccircle cx='50' cy='360' r='1.2' opacity='0.85' fill='%23bbf7d0'/%3E%3Ccircle cx='130' cy='420' r='0.7' opacity='0.5'/%3E%3Ccircle cx='240' cy='370' r='1.3' opacity='0.85'/%3E%3Ccircle cx='360' cy='410' r='0.8' opacity='0.6'/%3E%3Ccircle cx='450' cy='380' r='1.1' opacity='0.75' fill='%23bae6fd'/%3E%3Ccircle cx='485' cy='475' r='0.7' opacity='0.5'/%3E%3Ccircle cx='315' cy='485' r='1.2' opacity='0.8'/%3E%3Ccircle cx='95' cy='470' r='0.9' opacity='0.65'/%3E%3C/g%3E%3C!-- 4-Point Diamond Sparkles --%3E%3Cg fill='url(%23starGlow)' opacity='0.85'%3E%3Cpath d='M 110,95 Q 110,105 120,105 Q 110,105 110,115 Q 110,105 100,105 Q 110,105 110,95 Z'/%3E%3Ccircle cx='110' cy='105' r='1.6' fill='%23ffffff'/%3E%3Cpath d='M 350,140 Q 350,148 358,148 Q 350,148 350,156 Q 350,148 342,148 Q 350,148 350,140 Z'/%3E%3Ccircle cx='350' cy='148' r='1.4' fill='%23ffffff'/%3E%3Cpath d='M 260,310 Q 260,320 270,320 Q 260,320 260,330 Q 260,320 250,320 Q 260,320 260,310 Z'/%3E%3Ccircle cx='260' cy='320' r='1.5' fill='%23ffffff'/%3E%3Cpath d='M 430,430 Q 430,437 437,437 Q 430,437 430,444 Q 430,437 423,437 Q 430,437 430,430 Z'/%3E%3Ccircle cx='430' cy='437' r='1.2' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E") !important;
  background-size: 100% 100%, 100% 100%, 100% 100%, 500px 500px !important;
  background-attachment: fixed !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* --------------------------------------------------------------------------
   3. Cards, Fieldsets & Containers (Zero-Lag Solid Dark Surfaces)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .card,
[data-theme="dark"] fieldset,
[data-theme="dark"] .student-header,
[data-theme="dark"] .modal-card,
[data-theme="dark"] .confirm-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .messages-card,
[data-theme="dark"] .auth-card {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
  color: var(--ink) !important;
  animation: none !important; /* Disable laggy floatIn animation */
}

[data-theme="dark"] fieldset:hover {
  border-color: rgba(255, 255, 255, 0.20) !important;
}

[data-theme="dark"] .legend-title {
  background: var(--surface-2) !important;
  border: 1px solid var(--line-strong) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .legend-title * {
  color: #ffffff !important;
}

[data-theme="dark"] .legend-title .inline-note,
[data-theme="dark"] .legend-title .desktop-inline-note {
  color: var(--cyan-accent) !important;
}

[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] .section-title {
  color: #ffffff !important;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] label {
  color: var(--ink-secondary) !important;
}

/* --------------------------------------------------------------------------
   4. The Header Theme Switch Button
   -------------------------------------------------------------------------- */
.theme-toggle-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  color: #d97706;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.16);
  user-select: none;
  touch-action: manipulation;
  flex-shrink: 0;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-toggle-btn:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.26);
}

.theme-toggle-btn:active {
  transform: translateY(0) scale(0.96);
}

.auth-theme-toggle {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 10;
}

.theme-toggle-inner {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-svg {
  width: 22px;
  height: 22px;
  position: absolute;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
}

/* Light mode state: Sun visible, Moon hidden */
.sun-svg {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  stroke: #d97706;
}

.moon-svg {
  opacity: 0;
  transform: rotate(90deg) scale(0.4);
  fill: #00dc82;
}

.theme-sparkle {
  position: absolute;
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
  font-size: 10px;
  color: #38bdf8;
  transition: opacity 0.2s ease, transform 0.3s ease;
}

.sparkle-1 { top: -6px; right: -4px; color: #00dc82; font-size: 8px; }
.sparkle-2 { bottom: -6px; left: -4px; color: #38bdf8; font-size: 9px; }

/* Dark mode state on the button */
[data-theme="dark"] .theme-toggle-btn {
  background: #141f38 !important;
  border: 1px solid rgba(0, 220, 130, 0.35) !important;
  color: #00dc82 !important;
  box-shadow: 0 0 20px rgba(0, 220, 130, 0.28), 0 4px 16px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .theme-toggle-btn:hover {
  border-color: #00dc82 !important;
  box-shadow: 0 0 28px rgba(0, 220, 130, 0.45), 0 6px 22px rgba(0, 0, 0, 0.7) !important;
}

[data-theme="dark"] .sun-svg {
  opacity: 0;
  transform: rotate(-90deg) scale(0.4);
}

[data-theme="dark"] .moon-svg {
  opacity: 1;
  transform: rotate(0deg) scale(1);
  fill: #00dc82;
  filter: drop-shadow(0 0 6px rgba(0, 220, 130, 0.6));
}

[data-theme="dark"] .theme-sparkle {
  opacity: 1;
  transform: scale(1);
}

/* --------------------------------------------------------------------------
   5. Header & Navigation (User-Bar)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .user-bar,
[data-theme="dark"] #user-bar {
  background: #0d1527 !important;
  border: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
  padding: 6px 14px !important;
  margin-bottom: 12px !important;
}

[data-theme="dark"] .brand-area {
  gap: 0 !important;
}

[data-theme="dark"] .brand-meta {
  margin-top: -6px !important;
}

[data-theme="dark"] .brand-version {
  font-size: 10px !important;
  line-height: 1 !important;
  color: var(--muted) !important;
}

[data-theme="dark"] .user-hello {
  color: #ffffff !important;
  font-weight: 700;
}

[data-theme="dark"] .user-plan {
  background: rgba(0, 220, 130, 0.18) !important;
  color: #00dc82 !important;
  border: 1px solid rgba(0, 220, 130, 0.35) !important;
  box-shadow: 0 0 10px rgba(0, 220, 130, 0.2) !important;
}

[data-theme="dark"] .messages-avatar-btn,
[data-theme="dark"] .user-avatar-btn,
[data-theme="dark"] .user-avatar {
  background: #141f38 !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--cyan-accent) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .messages-avatar-btn:hover,
[data-theme="dark"] .user-avatar-btn:hover,
[data-theme="dark"] .user-avatar:hover {
  background: #1a2a4c !important;
  border-color: var(--cyan-accent) !important;
  box-shadow: var(--cyan-glow) !important;
}

[data-theme="dark"] .admin-preview-tools .nav-link {
  background: #10192d !important;
  border-color: var(--line) !important;
  color: var(--ink-secondary) !important;
}

[data-theme="dark"] .admin-preview-tools .nav-link:hover {
  background: #182644 !important;
  border-color: var(--cyan-accent) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .admin-preview-tools .nav-link.active {
  background: rgba(0, 220, 130, 0.16) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
  box-shadow: 0 0 14px rgba(0, 220, 130, 0.25) !important;
}

/* Logout Button Visibility */
[data-theme="dark"] #logout-btn,
[data-theme="dark"] #admin-preview-logout-btn {
  background: #1a1420 !important;
  border-color: rgba(248, 113, 113, 0.3) !important;
}

[data-theme="dark"] #logout-btn svg,
[data-theme="dark"] #admin-preview-logout-btn svg {
  stroke: #f87171 !important;
}

[data-theme="dark"] #logout-btn:hover,
[data-theme="dark"] #admin-preview-logout-btn:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  border-color: #f87171 !important;
}

[data-theme="dark"] #logout-btn:hover svg,
[data-theme="dark"] #admin-preview-logout-btn:hover svg {
  stroke: #ffffff !important;
}

/* --------------------------------------------------------------------------
   6. Buttons (Windscribe Hero Neon & Translucent Surfaces)
   -------------------------------------------------------------------------- */
[data-theme="dark"] #generate,
[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #00dc82 0%, #10b981 100%) !important;
  color: #032b1d !important;
  font-weight: 800 !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  box-shadow: 0 0 24px rgba(0, 220, 130, 0.45), 0 4px 14px rgba(0, 0, 0, 0.5) !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease !important;
}

[data-theme="dark"] #generate:hover,
[data-theme="dark"] .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 35px rgba(0, 220, 130, 0.65), 0 6px 20px rgba(0, 0, 0, 0.6) !important;
  filter: brightness(1.06);
}

[data-theme="dark"] .btn-secondary {
  background: #141f38 !important;
  border: 1px solid var(--line-strong) !important;
  color: #e2e8f0 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

[data-theme="dark"] .btn-secondary:hover {
  background: #1c2b4c !important;
  border-color: rgba(0, 220, 130, 0.4) !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(0, 220, 130, 0.2) !important;
}

[data-theme="dark"] .icon-btn {
  background: #121c32 !important;
  border: 1px solid var(--line) !important;
  color: var(--ink-secondary) !important;
}

[data-theme="dark"] .icon-btn svg {
  stroke: #cbd5e1 !important;
}

[data-theme="dark"] .icon-btn:hover {
  background: #1a2848 !important;
  border-color: var(--line-strong) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .icon-btn:hover svg {
  stroke: #ffffff !important;
}

/* --------------------------------------------------------------------------
   7. Form Controls (Inputs, Selects, Dropdowns)
   -------------------------------------------------------------------------- */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: var(--surface-input) !important;
  border: 1px solid var(--line-strong) !important;
  color: var(--ink) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #64748b !important;
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  border-color: #00dc82 !important;
  box-shadow: 0 0 0 3px rgba(0, 220, 130, 0.22), inset 0 2px 4px rgba(0, 0, 0, 0.4) !important;
  outline: none;
}

/* Custom Dropdown Menus (.bio-custom-select) */
[data-theme="dark"] .bio-custom-select-trigger {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .bio-custom-select-trigger::before {
  border-left-color: #00dc82 !important;
  border-bottom-color: #00dc82 !important;
}

[data-theme="dark"] .bio-custom-select-trigger:focus,
[data-theme="dark"] .bio-custom-select-open .bio-custom-select-trigger {
  border-color: #00dc82 !important;
  box-shadow: 0 0 0 2px rgba(0, 220, 130, 0.25) !important;
}

[data-theme="dark"] .bio-custom-select-menu {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85) !important;
  scrollbar-color: #334155 #0d1527 !important;
}

[data-theme="dark"] .bio-custom-select-option {
  color: #cbd5e1 !important;
  background: transparent !important;
}

[data-theme="dark"] .bio-custom-select-option:hover,
[data-theme="dark"] .bio-custom-select-option:focus {
  background: rgba(0, 220, 130, 0.15) !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .bio-custom-select-option.active,
[data-theme="dark"] .bio-custom-select-option[aria-selected="true"],
[data-theme="dark"] .bio-custom-select-option.is-selected {
  background: rgba(0, 220, 130, 0.22) !important;
  color: #00dc82 !important;
  font-weight: 800 !important;
}

/* Native select options */
[data-theme="dark"] select option {
  background: #0d1527 !important;
  color: #f8fafc !important;
}

/* --------------------------------------------------------------------------
   8. Student Header, Student List & Previous Plans
   -------------------------------------------------------------------------- */
[data-theme="dark"] .student-options {
  background: #090f1e !important;
  border: 1px solid var(--line) !important;
  scrollbar-color: #334155 #0a101c !important;
}

[data-theme="dark"] .student-option {
  background: #10192d !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .student-option:hover {
  background: #182644 !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .student-option.active {
  background: rgba(0, 220, 130, 0.16) !important;
  border-color: #00dc82 !important;
  box-shadow: 0 0 16px rgba(0, 220, 130, 0.25) !important;
}

[data-theme="dark"] .student-option-name {
  color: #ffffff !important;
}

[data-theme="dark"] .student-option-inst {
  color: var(--muted) !important;
}

[data-theme="dark"] .student-label {
  color: #cbd5e1 !important;
  font-weight: 700;
}

/* Inline Student Edit (Item 1) */
[data-theme="dark"] .student-inline-edit {
  background: #090e1a !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .student-inline-edit .student-inline-name,
[data-theme="dark"] .student-inline-edit .student-inline-grade,
[data-theme="dark"] .student-inline-edit .student-inline-inst {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .student-inline-edit .student-inline-name:focus,
[data-theme="dark"] .student-inline-edit .student-inline-grade:focus,
[data-theme="dark"] .student-inline-edit .student-inline-inst:focus {
  border-color: #00dc82 !important;
  box-shadow: 0 0 0 2px rgba(0, 220, 130, 0.25) !important;
}

[data-theme="dark"] .student-inline-edit .student-inline-save {
  background: rgba(0, 220, 130, 0.18) !important;
  border: 1px solid #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .student-inline-edit .student-inline-save:hover {
  background: #00dc82 !important;
  color: #060913 !important;
}

[data-theme="dark"] .student-inline-edit .student-inline-save svg {
  stroke: currentColor !important;
}

[data-theme="dark"] .student-inline-toggle,
[data-theme="dark"] .student-inline-delete {
  color: #94a3b8 !important;
}

[data-theme="dark"] .student-inline-toggle:hover {
  color: #00dc82 !important;
  background: rgba(0, 220, 130, 0.15) !important;
}

[data-theme="dark"] .student-inline-delete:hover {
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.15) !important;
}

/* Previous Plans List & Items */
[data-theme="dark"] .plans-list {
  background: #090e1a !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  scrollbar-color: #334155 #090e1a !important;
}

[data-theme="dark"] .plan-item {
  background: #10192e !important;
  border-color: rgba(255, 255, 255, 0.10) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .plan-item:hover {
  background: #182646 !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .plan-item.active {
  background: rgba(0, 220, 130, 0.18) !important;
  border-color: #00dc82 !important;
  box-shadow: 0 0 16px rgba(0, 220, 130, 0.25) !important;
}

[data-theme="dark"] .plan-item.active > span {
  color: #00dc82 !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .plan-item small {
  color: #94a3b8 !important;
}

[data-theme="dark"] .admin-plan-filter .btn {
  background: #10192e !important;
  color: #cbd5e1 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .admin-plan-filter .btn.active {
  background: rgba(0, 220, 130, 0.2) !important;
  color: #00dc82 !important;
  border-color: #00dc82 !important;
}

/* --------------------------------------------------------------------------
   9. Section 2: Date Range & Planner Mode Switch
   -------------------------------------------------------------------------- */
[data-theme="dark"] .planner-mode-switch {
  background: #090e1a !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .planner-mode-btn {
  color: #94a3b8 !important;
}

[data-theme="dark"] .planner-mode-btn.active {
  background: #0ea5e9 !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.45) !important;
}

[data-theme="dark"] .range-separator {
  color: #94a3b8 !important;
}

/* --------------------------------------------------------------------------
   10. Section 3: Daily Study Hours
   -------------------------------------------------------------------------- */
[data-theme="dark"] .daily-target-inputs label {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .day-card {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .day-label {
  color: #f8fafc !important;
}

[data-theme="dark"] .day-date {
  color: #94a3b8 !important;
}

[data-theme="dark"] .day-input {
  background: #080d18 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #00dc82 !important;
  font-weight: 700 !important;
}

/* --------------------------------------------------------------------------
   11. Section 4: Study Allocations & Quick Divide & Exam
   -------------------------------------------------------------------------- */
[data-theme="dark"] .allocation-card {
  background: transparent !important;
}

[data-theme="dark"] .allocation-summary {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .allocation-summary span {
  color: #00dc82 !important;
  font-weight: 800 !important;
}

[data-theme="dark"] .allocation-progress {
  background: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .allocation-tools {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* Quick Divide Button & Gear Button */
[data-theme="dark"] .alloc-auto-btn,
[data-theme="dark"] .alloc-gear-btn {
  background: #121c34 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .alloc-auto-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  padding: 0 14px !important;
}

[data-theme="dark"] .alloc-auto-btn:hover,
[data-theme="dark"] .alloc-gear-btn:hover {
  background: #1a2a4c !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.25) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .alloc-gear-btn svg {
  stroke: var(--ink-secondary) !important;
}

/* Exam, Routine, and Compensatory Inputs */
[data-theme="dark"] .alloc-special-box label,
[data-theme="dark"] #alloc-routine-label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] #alloc-exam-time,
[data-theme="dark"] #alloc-routine-minutes,
[data-theme="dark"] #alloc-compensatory-time,
[data-theme="dark"] .alloc-duration-control input {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .allocation-item {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .allocation-item label {
  color: #f8fafc !important;
}

[data-theme="dark"] .allocation-item input {
  background: #080d18 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .alloc-weights {
  background: #080d18 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .alloc-weight-item {
  color: var(--ink-secondary) !important;
}

[data-theme="dark"] .alloc-weight-item input {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .alloc-weight-note {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--muted) !important;
}

[data-theme="dark"] .alloc-weight-save-label {
  color: #94a3b8 !important;
}

[data-theme="dark"] .alloc-weight-save-btn {
  background: #101c34 !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  color: #f8fafc !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .alloc-weight-save-btn:hover {
  background: #18284c !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

/* --------------------------------------------------------------------------
   12. Section 5: Lessons, Lesson Card Headers & Subject Accordions
   -------------------------------------------------------------------------- */
[data-theme="dark"] .item-group {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 18px !important;
  box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .group-title {
  color: #ffffff !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  letter-spacing: 0.2px !important;
}

/* Lesson Card Stats Header (Calm, Sophisticated Telemetry Pill) */
[data-theme="dark"] .group-header-stats {
  background: rgba(10, 16, 30, 0.7) !important;
  border: 1px solid rgba(255, 255, 255, 0.07) !important;
  border-radius: 12px !important;
  padding: 6px 12px !important;
  color: var(--ink) !important;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .group-header-stats span {
  color: #94a3b8 !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
}

[data-theme="dark"] .group-header-stats b {
  color: #38bdf8 !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .group-target-input {
  background: #090f1d !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  color: #38bdf8 !important;
  border-radius: 8px !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .group-items {
  gap: 10px !important;
}

[data-theme="dark"] .note-btn {
  background: #121c32 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: var(--ink-secondary) !important;
}

[data-theme="dark"] .note-btn svg {
  stroke: var(--ink-secondary) !important;
}

[data-theme="dark"] .note-btn.has-note {
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.14) !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.22) !important;
}

[data-theme="dark"] .note-btn.has-note svg {
  stroke: #38bdf8 !important;
}

/* Card Notes Panel (Point 5) */
[data-theme="dark"] .group-note-panel {
  background: #0b1325 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
  border-radius: 12px !important;
  padding: 8px !important;
}

[data-theme="dark"] .group-note-panel textarea {
  background: #060a14 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f1f5f9 !important;
  font-family: inherit !important;
}

[data-theme="dark"] .group-note-panel textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

/* Distance to Target Progress Bar - Empty & Active (Point 2) */
[data-theme="dark"] .group-progress {
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.06) !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .group-progress span {
  background: linear-gradient(90deg, #10b981, #00dc82) !important;
  box-shadow: 0 0 8px rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .group-bottom-progress {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .general-subject-accordion {
  background: #111a2f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  overflow: hidden !important;
}

[data-theme="dark"] .general-subject-toggle {
  background: #14203a !important;
  color: #f1f5f9 !important;
  font-weight: 700 !important;
  padding: 10px 14px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .general-subject-toggle:hover {
  background: #1a2a4c !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .general-subject-toggle::after {
  border-left-color: #94a3b8 !important;
  border-bottom-color: #94a3b8 !important;
}

[data-theme="dark"] .general-subject-accordion.active .general-subject-toggle {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .general-subject-panel {
  background: #0d1527 !important;
  border-top-color: rgba(255, 255, 255, 0.06) !important;
  padding: 8px 10px !important;
}

[data-theme="dark"] .general-subject-accordion:not(.active):has(.bio-box-summary-row) .general-subject-panel {
  background: #0d1527 !important;
}

/* Activity Cards for Routine, Compensatory, Exams & General items (Image 3 - Compact & Stable) */
[data-theme="dark"] .item-card {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
  color: var(--ink) !important;
  padding: 8px !important;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease !important;
}

[data-theme="dark"] .item-card:hover,
[data-theme="dark"] .item-card:focus-within {
  border-color: rgba(56, 189, 248, 0.35) !important;
  background: #0f1930 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .item-row input,
[data-theme="dark"] .item-row select,
[data-theme="dark"] .item-card input,
[data-theme="dark"] .item-card select {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .item-row input:focus,
[data-theme="dark"] .item-row select:focus,
[data-theme="dark"] .item-card input:focus,
[data-theme="dark"] .item-card select:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
}

[data-theme="dark"] .item-card .duration-step-btn {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .item-card .duration-step-btn:hover {
  background: #1b2a4c !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .item-actions .icon-btn {
  background: #101a2e !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .item-actions .icon-btn:hover {
  background: #162440 !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .item-actions .icon-btn[data-action="delete"]:hover {
  border-color: #f87171 !important;
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.15) !important;
}

/* ==========================================================================
   Structured Topic Builder & Summary Cards (Image 2 - Full Coverage)
   ========================================================================== */

/* 1. Collapsed Topic Card (حالت خلاصه مباحث - Elevated, Calm, Restful on the Eyes) */
[data-theme="dark"] .bio-builder-card:not(.bio-box-active) {
  background: #111a2f !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
  padding: 0 !important;
  overflow: hidden !important;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
}

[data-theme="dark"] .bio-builder-card:not(.bio-box-active):hover {
  background: #14203a !important;
  border-color: rgba(56, 189, 248, 0.3) !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .bio-builder-card,
[data-theme="dark"] .bio-box-collapsed-summary,
[data-theme="dark"] .bio-sections,
[data-theme="dark"] .bio-section,
[data-theme="dark"] .general-structured-builder,
[data-theme="dark"] .item-group,
[data-theme="dark"] .item-card {
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  text-rendering: optimizeLegibility !important;
}

[data-theme="dark"] .bio-box-collapsed-summary {
  color: var(--ink) !important;
  padding: 0 !important;
}

/* Dedicated Topic Card Header Bar */
[data-theme="dark"] .bio-box-summary-head {
  background: rgba(255, 255, 255, 0.035) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 8px 12px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  min-height: 36px !important;
  gap: 8px !important;
}

[data-theme="dark"] .bio-box-summary-head strong {
  color: #f8fafc !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  line-height: 1.4 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
}

[data-theme="dark"] .bio-box-summary-head strong::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.7);
  flex-shrink: 0;
}

[data-theme="dark"] .bio-box-summary-items {
  padding: 4px 10px 8px !important;
  display: flex !important;
  flex-direction: column !important;
  min-width: 0 !important;
}

/* Activity & Topic Rows - Modeled directly on Light Mode Layout */
[data-theme="dark"] .bio-activity-summary-line,
[data-theme="dark"] .bio-section-summary-row,
[data-theme="dark"] .bio-box-summary-row {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 8px !important;
  direction: rtl !important;
  min-width: 0 !important;
}

[data-theme="dark"] .bio-box-summary-row,
[data-theme="dark"] .bio-section-summary-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding: 5px 4px !important;
  min-height: 28px !important;
  background: transparent !important;
  border-radius: 0 !important;
  transition: background 0.15s ease !important;
}

[data-theme="dark"] .bio-box-summary-row:first-child,
[data-theme="dark"] .bio-section-summary-row:first-child {
  border-top: none !important;
}

[data-theme="dark"] .bio-box-summary-row:hover,
[data-theme="dark"] .bio-section-summary-row:hover {
  background: rgba(255, 255, 255, 0.035) !important;
  border-radius: 6px !important;
}

/* Topic Titles in Summaries */
[data-theme="dark"] .bio-box-summary-topic {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  color: #e2e8f0 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.35 !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow-wrap: anywhere !important;
}

[data-theme="dark"] .bio-section-summary-topic {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  color: #cbd5e1 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.45 !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow-wrap: anywhere !important;
}

[data-theme="dark"] .bio-activity-summary-topic {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  color: #f1f5f9 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.4 !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow-wrap: anywhere !important;
}

/* Constraints (Plain text matching Light Mode - NO badges/pills) */
[data-theme="dark"] .bio-box-summary-constraint,
[data-theme="dark"] .bio-section-summary-constraint,
[data-theme="dark"] .bio-activity-summary-constraint {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 400 !important;
  line-height: 1.35 !important;
  display: inline-flex !important;
  align-items: center !important;
  overflow-wrap: anywhere !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

/* Durations (Plain text matching Light Mode with clean bullet dot - NO green buttons/pills) */
[data-theme="dark"] .bio-box-summary-duration,
[data-theme="dark"] .bio-activity-summary-duration,
[data-theme="dark"] .bio-section-summary-row > em {
  flex: 0 0 72px !important;
  width: 72px !important;
  min-width: 72px !important;
  max-width: 72px !important;
  box-sizing: border-box !important;
  text-align: center !important;
  justify-content: center !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  font-style: normal !important;
  line-height: 1.35 !important;
  font-variant-numeric: tabular-nums !important;
  white-space: nowrap !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}

[data-theme="dark"] .bio-box-summary-duration::before,
[data-theme="dark"] .bio-activity-summary-duration::before,
[data-theme="dark"] .bio-section-summary-row > em::before {
  content: "" !important;
  display: inline-block !important;
  width: 3px !important;
  height: 3px !important;
  border-radius: 50% !important;
  background: #64748b !important;
  flex-shrink: 0 !important;
}

/* Missing Duration Warning (Subtle amber matching Light Mode) */
[data-theme="dark"] .bio-box-summary-duration.bio-summary-missing-duration,
[data-theme="dark"] .bio-activity-summary-duration.bio-summary-missing-duration,
[data-theme="dark"] .bio-section-summary-row em.bio-summary-missing-duration {
  background: rgba(245, 158, 11, 0.14) !important;
  color: #fbbf24 !important;
  border: 1px dashed rgba(245, 158, 11, 0.5) !important;
  border-radius: 4px !important;
  padding: 1px 4px !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .bio-box-summary-duration.bio-summary-missing-duration::before,
[data-theme="dark"] .bio-activity-summary-duration.bio-summary-missing-duration::before,
[data-theme="dark"] .bio-section-summary-row em.bio-summary-missing-duration::before {
  display: none !important;
}

[data-theme="dark"] .bio-box-summary-empty {
  border-top: none !important;
  color: #64748b !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 36px !important;
  font-size: 12px !important;
  font-style: italic !important;
  padding: 8px !important;
}

/* 2. Active / Open Topic Builder Card */
[data-theme="dark"] .bio-builder-card {
  background: #0b1325 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .bio-builder-card.bio-box-active {
  border-color: #00dc82 !important;
  box-shadow: 0 0 0 1px rgba(0, 220, 130, 0.35), 0 8px 24px rgba(0, 0, 0, 0.5) !important;
}

/* ==========================================================================
   Open/Collapse Logic strictly synchronized with Light Mode
   ========================================================================== */

/* 1. Topic Builder Cards */
[data-theme="dark"] .bio-builder-card:not(.bio-box-active) > .bio-builder-toolbar,
[data-theme="dark"] .bio-builder-card:not(.bio-box-active) > .bio-empty-frame {
  display: none !important;
}

[data-theme="dark"] .bio-builder-card:not(.bio-box-active) > .bio-box-collapsed-summary {
  display: block !important;
}

[data-theme="dark"] .bio-builder-card:not(.bio-box-active) > .bio-collapsed-hit-surface {
  display: block !important;
}

[data-theme="dark"] .bio-builder-card.bio-box-active > .bio-builder-toolbar {
  display: flex !important;
}

[data-theme="dark"] .bio-builder-card.bio-box-active > .bio-empty-frame {
  display: flex !important;
}

[data-theme="dark"] .bio-builder-card.bio-box-active > .bio-box-collapsed-summary {
  display: none !important;
}

[data-theme="dark"] .bio-builder-card.bio-box-active > .bio-collapsed-hit-surface {
  display: none !important;
}

/* 2. Class Mode & Card Controls */
[data-theme="dark"] .bio-class-mode .bio-self-controls,
[data-theme="dark"] .bio-class-mode .bio-subtopics {
  display: none !important;
}

[data-theme="dark"] .bio-builder-card:has([data-bio-section]) .bio-self-controls {
  min-height: auto;
}

[data-theme="dark"] .bio-class-mode [data-bio-owner-mode="class"] > .bio-section-head > .bio-section-actions {
  display: none !important;
}

/* 3. Sections within Topic */
[data-theme="dark"] .bio-section:not(.bio-section-active) > .bio-activity-list,
[data-theme="dark"] .bio-section:not(.bio-section-active) > .bio-action-palette,
[data-theme="dark"] .bio-section:not(.bio-section-active) .bio-section-head > .bio-custom-select,
[data-theme="dark"] .bio-section:not(.bio-section-active) .bio-section-head > [data-bio-section-title],
[data-theme="dark"] .bio-section:not(.bio-section-active) .bio-section-actions {
  display: none !important;
}

[data-theme="dark"] .bio-section:not(.bio-section-active) .bio-section-collapsed-summary {
  display: flex !important;
}

[data-theme="dark"] .bio-section:not(.bio-section-active) > .bio-collapsed-hit-surface {
  display: block !important;
}

[data-theme="dark"] .bio-section.bio-section-active .bio-section-collapsed-summary {
  display: none !important;
}

[data-theme="dark"] .bio-section.bio-section-active > .bio-collapsed-hit-surface {
  display: none !important;
}

[data-theme="dark"] .bio-section.bio-section-active > .bio-activity-list {
  display: flex !important;
}

[data-theme="dark"] .bio-section.bio-section-active > .bio-action-palette {
  display: flex !important;
}

/* 4. Activity Rows */
[data-theme="dark"] .bio-activity-row:not(.bio-activity-active) > .bio-activity-main,
[data-theme="dark"] .bio-activity-row:not(.bio-activity-active) > .bio-row-edit,
[data-theme="dark"] .bio-activity-row:not(.bio-activity-active) > .bio-activity-controls,
[data-theme="dark"] .bio-activity-row:not(.bio-activity-active) > .item-sub {
  display: none !important;
}

[data-theme="dark"] .bio-activity-row:not(.bio-activity-active) > .bio-activity-collapsed-summary {
  display: block !important;
}

[data-theme="dark"] .bio-activity-row:not(.bio-activity-active) > .bio-collapsed-hit-surface {
  display: block !important;
}

[data-theme="dark"] .bio-activity-row.bio-activity-active > .bio-activity-collapsed-summary {
  display: none !important;
}

[data-theme="dark"] .bio-activity-row.bio-activity-active > .bio-collapsed-hit-surface {
  display: none !important;
}

/* 5. General Structured Builder in Accordions */
[data-theme="dark"] .general-subject-panel,
[data-theme="dark"] .general-subject-accordion:not(.active):has(.bio-box-summary-row) .general-subject-panel,
[data-theme="dark"] .general-subject-accordion.active .general-subject-panel {
  background: #0d1527 !important;
}

[data-theme="dark"] .general-subject-accordion .general-structured-builder .bio-builder-card,
[data-theme="dark"] .general-subject-accordion .general-structured-builder .bio-builder-card.bio-box-active,
[data-theme="dark"] .general-subject-accordion:not(.active) .general-structured-builder .bio-builder-card,
[data-theme="dark"] .general-subject-accordion:not(.active) .general-structured-builder .bio-builder-card.bio-box-active {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
}

[data-theme="dark"] .general-subject-accordion:not(.active) .general-structured-builder .bio-builder-card > .bio-builder-toolbar,
[data-theme="dark"] .general-subject-accordion:not(.active) .general-structured-builder .bio-builder-card > .bio-empty-frame {
  display: none !important;
}

[data-theme="dark"] .general-subject-accordion:not(.active) .general-structured-builder .bio-builder-card > .bio-box-collapsed-summary {
  display: block !important;
  background: transparent !important;
  padding: 0 5px !important;
}

[data-theme="dark"] .general-subject-accordion:not(.active) .general-structured-builder .bio-box-summary-head,
[data-theme="dark"] .general-subject-accordion:not(.active) .general-structured-builder .bio-box-summary-empty {
  display: none !important;
}

/* Frame internals without conflicting display:flex !important */
[data-theme="dark"] .bio-empty-frame {
  background: #070c17 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  min-height: auto !important;
  flex-direction: column !important;
  justify-content: center !important;
  gap: 10px !important;
}

[data-theme="dark"] .bio-self-controls {
  flex-direction: column !important;
  justify-content: center !important;
  gap: 8px !important;
}

[data-theme="dark"] .bio-picker-row {
  align-items: center !important;
  gap: 8px !important;
}

[data-theme="dark"] .bio-subtopics {
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 2px 0 !important;
}

[data-theme="dark"] .bio-mode-toggle,
[data-theme="dark"] .bio-class-session-toggle {
  background: #080d19 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .bio-mode-toggle button,
[data-theme="dark"] .bio-class-session-toggle button {
  color: #94a3b8 !important;
}

[data-theme="dark"] .bio-mode-toggle button:hover,
[data-theme="dark"] .bio-class-session-toggle button:hover {
  color: #ffffff !important;
  background: #141f38 !important;
}

[data-theme="dark"] .bio-mode-toggle button.active,
[data-theme="dark"] .bio-class-session-toggle button.active {
  background: rgba(0, 220, 130, 0.2) !important;
  color: #00dc82 !important;
  border: 1px solid rgba(0, 220, 130, 0.4) !important;
}

[data-theme="dark"] .bio-class-title-label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .bio-class-anchor-row {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .bio-picker-row select,
[data-theme="dark"] .bio-class-controls input,
[data-theme="dark"] .bio-activity-row input,
[data-theme="dark"] .bio-activity-row select,
[data-theme="dark"] .bio-action-select,
[data-theme="dark"] .bio-section-subtopic-select,
[data-theme="dark"] .bio-duration-wrap input,
[data-theme="dark"] .bio-count-wrap input {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .bio-picker-row select:focus,
[data-theme="dark"] .bio-class-controls input:focus,
[data-theme="dark"] .bio-activity-row input:focus,
[data-theme="dark"] .bio-activity-row select:focus,
[data-theme="dark"] .bio-action-select:focus,
[data-theme="dark"] .bio-section-subtopic-select:focus,
[data-theme="dark"] .bio-duration-wrap input:focus,
[data-theme="dark"] .bio-count-wrap input:focus {
  border-color: #00dc82 !important;
  box-shadow: 0 0 0 2px rgba(0, 220, 130, 0.25) !important;
}

/* 3. Subtopic Sections & Palettes */
[data-theme="dark"] .bio-sections {
  gap: 6px;
}

[data-theme="dark"] .bio-section {
  background: #0a1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .bio-section-active {
  background: #0e172c !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}

[data-theme="dark"] .bio-section:not(.bio-section-active) {
  background: #080d19 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .bio-section:not(.bio-section-active):hover {
  background: #0e172a !important;
  border-color: rgba(0, 220, 130, 0.3) !important;
}

[data-theme="dark"] .bio-section-summary-row {
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  color: #cbd5e1 !important;
  font-size: 11px !important;
  line-height: 1.65 !important;
  min-height: 28px !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
  direction: rtl !important;
  padding: 5px 4px !important;
  background: transparent !important;
  border-radius: 0 !important;
  transition: background 0.15s ease !important;
}

[data-theme="dark"] .bio-section-summary-row:first-child {
  border-top: none !important;
}

[data-theme="dark"] .bio-section-summary-row:hover {
  background: rgba(255, 255, 255, 0.035) !important;
  border-radius: 6px !important;
}

[data-theme="dark"] .bio-chip,
[data-theme="dark"] .bio-action-btn {
  background: #121c32 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #38bdf8 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 32px !important;
  line-height: 1 !important;
  padding: 6px 12px 5px !important;
  border-radius: 8px !important;
  text-align: center !important;
  vertical-align: middle !important;
}

[data-theme="dark"] .bio-chip:hover,
[data-theme="dark"] .bio-action-btn:hover {
  background: rgba(0, 220, 130, 0.18) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .bio-chip.active {
  background: rgba(0, 220, 130, 0.22) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .bio-custom-select-trigger {
  min-height: 34px !important;
  height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  padding: 5px 12px 4px 24px !important;
}

[data-theme="dark"] .bio-custom-select-option {
  display: flex !important;
  align-items: center !important;
  line-height: 1 !important;
  min-height: var(--bio-dropdown-option-height, 32px) !important;
  padding: 6px 10px 5px !important;
}

/* 4. Activity Rows & Action Controls */
[data-theme="dark"] .bio-activity-row {
  background: #0c1424 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .bio-activity-row:hover,
[data-theme="dark"] .bio-activity-row:focus-within {
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .bio-activity-collapsed-summary {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .bio-activity-summary-topic {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .bio-activity-summary-constraint {
  color: #94a3b8 !important;
}

[data-theme="dark"] .bio-stepper button {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .bio-stepper button:hover {
  background: #1c2b4e !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .bio-activity-controls .icon-btn,
[data-theme="dark"] .bio-box-actions .icon-btn,
[data-theme="dark"] .bio-section-actions .icon-btn {
  background: #101a2e !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .bio-activity-controls .icon-btn:hover,
[data-theme="dark"] .bio-box-actions .icon-btn:hover,
[data-theme="dark"] .bio-section-actions .icon-btn:hover {
  background: #162440 !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .bio-activity-controls .icon-btn[data-action="bio-delete-row"]:hover,
[data-theme="dark"] .bio-box-actions .icon-btn[data-action="bio-delete-box"]:hover,
[data-theme="dark"] .bio-section-actions .icon-btn[data-action="bio-delete-section"]:hover {
  border-color: #f87171 !important;
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.15) !important;
}

/* 5. Math Parts & Other Subtopic Rows */
[data-theme="dark"] .math-parts-row {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .math-parts-row [data-bio-kind="math-parts-input"] {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .math-other-inline-row .math-parts-row,
[data-theme="dark"] .math-other-inline-row .bio-subtopics {
  background: #0a1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .math-add-subtopic-btn {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .math-add-subtopic-btn:hover {
  background: rgba(0, 220, 130, 0.2) !important;
  border-color: #00dc82 !important;
}

/* 6. Special Settings (تنظیمات خاص و دراپ‌داون‌های مربوطه) */
[data-theme="dark"] .item-sub {
  border-top: 1px dashed rgba(255, 255, 255, 0.12) !important;
  background: rgba(8, 13, 24, 0.6) !important;
  border-radius: 8px;
  padding: 6px;
}

[data-theme="dark"] .item-sub label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .item-constraint-label {
  color: #94a3b8 !important;
}

[data-theme="dark"] .item-sub select {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .item-sub select:focus {
  border-color: #00dc82 !important;
  box-shadow: 0 0 0 2px rgba(0, 220, 130, 0.25) !important;
}

[data-theme="dark"] .item-sub .item-analysis-next-day-toggle {
  background: #090e1a !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .item-split-controls {
  background: #090e1a !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .item-split-controls label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .item-split-max select {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .split-help-btn {
  background: #141f38 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .split-help-btn:hover {
  background: rgba(0, 220, 130, 0.2) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

/* 7. Recall Modal & Items (فراخوانی از برنامه‌های قبلی) */
[data-theme="dark"] .group-recall-menu {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85) !important;
}

[data-theme="dark"] .group-recall-empty {
  color: var(--muted) !important;
}

[data-theme="dark"] .recall-item {
  background: #090e1a !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: var(--ink) !important;
  direction: rtl !important;
  text-align: right !important;
}

[data-theme="dark"] .recall-item:hover,
[data-theme="dark"] .recall-item:focus-visible,
[data-theme="dark"] .recall-item:active {
  background: #101a2e !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .recall-card-title,
[data-theme="dark"] .recall-box-summary-head strong,
[data-theme="dark"] .recall-box-summary-topic,
[data-theme="dark"] .bio-recall-collapsed-summary .bio-section-summary-topic {
  color: #ffffff !important;
}

[data-theme="dark"] .recall-card-duration,
[data-theme="dark"] .recall-box-summary-duration {
  color: #00dc82 !important;
}

[data-theme="dark"] .recall-card-missing-duration,
[data-theme="dark"] .bio-recall-collapsed-summary .bio-section-summary-row em.bio-summary-missing-duration {
  color: #f87171 !important;
}

[data-theme="dark"] .recall-card-settings,
[data-theme="dark"] .bio-recall-collapsed-summary .bio-section-summary-row em {
  color: #94a3b8 !important;
}

[data-theme="dark"] .recall-box-summary-row,
[data-theme="dark"] .bio-recall-collapsed-summary .bio-section-summary-row {
  border-top-color: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .recall-sep {
  color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .group-recall-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding-top: 6px !important;
}

[data-theme="dark"] .group-recall-nav {
  background: #141f38 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .group-recall-nav:hover:not(:disabled) {
  background: #1b294c !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .group-recall-nav:disabled {
  opacity: 0.35 !important;
  background: #090e1a !important;
  color: #64748b !important;
}

[data-theme="dark"] .group-recall-range {
  color: #94a3b8 !important;
}

/* 8. Group Progress & Add/Recall Row Buttons */
[data-theme="dark"] .group-bottom-progress-head {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .group-bottom-progress-head b {
  color: #00dc82 !important;
}

[data-theme="dark"] .group-add-row .icon-btn,
[data-theme="dark"] .group-add-row .recall-btn,
[data-theme="dark"] .recall-btn {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
  border-radius: 12px !important;
  transition: all 0.2s ease !important;
}

[data-theme="dark"] .group-add-row .icon-btn:hover,
[data-theme="dark"] .group-add-row .recall-btn:hover,
[data-theme="dark"] .recall-btn:hover {
  background: rgba(0, 220, 130, 0.16) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
  box-shadow: 0 0 12px rgba(0, 220, 130, 0.2) !important;
  transform: translateY(-1px);
}

[data-theme="dark"] .group-add-row .recall-btn.active,
[data-theme="dark"] .recall-btn.active {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
}

/* 9. Brand Logo & Header Meta */
[data-theme="dark"] .brand-logo,
[data-theme="dark"] .auth-logo {
  background: transparent !important;
  filter: drop-shadow(0 0 14px rgba(0, 220, 130, 0.22));
}

[data-theme="dark"] .brand-area {
  background: transparent !important;
}

[data-theme="dark"] .brand-version {
  color: var(--muted) !important;
}

/* --------------------------------------------------------------------------
   13. Section 6: Template and Generation Panels
   -------------------------------------------------------------------------- */
[data-theme="dark"] #sec-generate #generate-controls {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

/* Advanced Generation Settings Panel (Item 6) */
[data-theme="dark"] #split-settings-panel,
[data-theme="dark"] .split-settings-panel {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .split-settings-tabs {
  background: #090e1a !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .split-settings-tab {
  background: #121c34 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--muted) !important;
}

[data-theme="dark"] .split-settings-tab:hover {
  background: #182646 !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .split-settings-tab.active {
  background: rgba(0, 220, 130, 0.18) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
  box-shadow: 0 0 12px rgba(0, 220, 130, 0.22) !important;
}

[data-theme="dark"] .split-master-toggle {
  color: var(--ink) !important;
}

[data-theme="dark"] .split-ratio-note {
  color: #94a3b8 !important;
}

[data-theme="dark"] .split-ratio-hint {
  color: #64748b !important;
}

[data-theme="dark"] .split-ratio-group {
  background: #090e1a !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .split-ratio-title {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .split-ratio-chip {
  background: #121c34 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .split-ratio-chip:hover {
  background: #182646 !important;
  border-color: rgba(0, 220, 130, 0.3) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .split-ratio-chip.is-on {
  background: rgba(0, 220, 130, 0.18) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .split-ratio-chip:not(.is-on) {
  background: #090e1a !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #64748b !important;
}

[data-theme="dark"] .split-warning-note {
  background: rgba(30, 20, 10, 0.94) !important;
  border-color: rgba(249, 115, 22, 0.45) !important;
  color: #fed7aa !important;
}

[data-theme="dark"] .schedule-display-option {
  background: #090e1a !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .schedule-display-option:has(input:checked) {
  border-color: #00dc82 !important;
  box-shadow: 0 0 0 2px rgba(0, 220, 130, 0.22) !important;
}

[data-theme="dark"] .schedule-display-title {
  color: var(--ink) !important;
}

[data-theme="dark"] .schedule-display-mini {
  background: #060913 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .split-settings-toggle {
  background: #141f38 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .split-settings-toggle:hover {
  background: #1c2b4e !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .split-settings-toggle.active {
  background: rgba(0, 220, 130, 0.2) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
  box-shadow: 0 0 12px rgba(0, 220, 130, 0.3) !important;
}

[data-theme="dark"] .program-note-panel {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .program-note-toggle,
[data-theme="dark"] .feedback-toggle {
  background: #121c34 !important;
  color: #f8fafc !important;
  border-color: transparent !important;
}

[data-theme="dark"] .program-note-toggle:hover,
[data-theme="dark"] .feedback-toggle:hover {
  background: #182646 !important;
}

[data-theme="dark"] .program-note-toggle.open,
[data-theme="dark"] .feedback-toggle.open {
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

/* Advisor Note Emoji Picker (Item 7) */
[data-theme="dark"] .program-note-emoji-menu {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85) !important;
}

[data-theme="dark"] .program-note-emoji:hover {
  background: rgba(0, 220, 130, 0.2) !important;
}

[data-theme="dark"] .program-note-emoji-toggle {
  color: var(--muted) !important;
}

[data-theme="dark"] .program-note-emoji-toggle:hover,
[data-theme="dark"] .program-note-emoji-toggle[aria-expanded="true"] {
  border-color: #00dc82 !important;
  background: rgba(0, 220, 130, 0.2) !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .program-note-hint {
  background: #0a101c !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .program-note-textarea,
[data-theme="dark"] #program-note-panel .program-note-textarea,
[data-theme="dark"] .feedback-textarea {
  background: #080d18 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

/* Feedback & Problem Report Section (Item 8) */
[data-theme="dark"] .feedback-panel,
[data-theme="dark"] #feedback-panel {
  background: #0e1628 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .feedback-topic-label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] #feedback-topic,
[data-theme="dark"] .feedback-body select {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .feedback-help {
  background: #0a101c !important;
  border: 1px dashed rgba(255, 255, 255, 0.16) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .feedback-help a {
  color: #38bdf8 !important;
}

[data-theme="dark"] .feedback-help a:hover {
  color: #00dc82 !important;
}

/* --------------------------------------------------------------------------
   14. Suggestion Popovers (Duration, Count, Study Hours)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .bio-input-suggestions,
[data-theme="dark"] .study-hour-suggestions {
  background: #0b1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(0, 220, 130, 0.08) !important;
}

[data-theme="dark"] .bio-input-suggestions button,
[data-theme="dark"] .study-hour-suggestions button {
  background: #14203a !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .bio-input-suggestions button:hover,
[data-theme="dark"] .study-hour-suggestions button:hover {
  background: rgba(0, 220, 130, 0.22) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .bio-suggestion-pill {
  background: #121e36 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .bio-suggestion-pill button {
  color: #94a3b8 !important;
}

[data-theme="dark"] .bio-suggestion-editor-add input {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #00dc82 !important;
}

/* --------------------------------------------------------------------------
   15. Alerts, Banners, Toasts & Hints
   -------------------------------------------------------------------------- */
[data-theme="dark"] .planner-attention-hint {
  background: rgba(30, 20, 10, 0.94) !important;
  border: 1px solid rgba(249, 115, 22, 0.5) !important;
  color: #fed7aa !important;
  box-shadow: 0 4px 20px rgba(249, 115, 22, 0.15) !important;
}

[data-theme="dark"] .student-grade-required-notice {
  background: rgba(30, 20, 10, 0.94) !important;
  border: 1px solid rgba(245, 158, 11, 0.5) !important;
  color: #fde68a !important;
}

[data-theme="dark"] .subscription-expiry-banner {
  background: rgba(45, 26, 6, 0.95) !important;
  border: 1px solid rgba(245, 158, 11, 0.4) !important;
  color: #fef08a !important;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .subscription-expiry-text,
[data-theme="dark"] #subscription-expiry-text {
  color: #fef3c7 !important;
}

[data-theme="dark"] .subscription-expiry-btn,
[data-theme="dark"] #subscription-expiry-btn {
  background: #f59e0b !important;
  border: 1px solid #fbbf24 !important;
  color: #0f172a !important;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3) !important;
}

[data-theme="dark"] .subscription-expiry-btn:hover,
[data-theme="dark"] #subscription-expiry-btn:hover {
  background: #fbbf24 !important;
  color: #000000 !important;
}

/* Profile Subscription Card */
[data-theme="dark"] .profile-subscription-card {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #0b1222 0%, #0d1527 100%) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .profile-subscription-mainline {
  color: #f8fafc !important;
}

[data-theme="dark"] .profile-subscription-badge {
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  background: rgba(14, 165, 233, 0.16) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .profile-subscription-remaining-inline {
  color: #94a3b8 !important;
}

[data-theme="dark"] .profile-subscription-remaining-inline b,
[data-theme="dark"] #profile-subscription-remaining {
  color: #38bdf8 !important;
}

[data-theme="dark"] .btn-sub-upgrade {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 6px 14px rgba(14, 165, 233, 0.25) !important;
}

[data-theme="dark"] .btn-sub-upgrade:hover {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9) !important;
  border-color: #7dd3fc !important;
  color: #ffffff !important;
}

[data-theme="dark"] .btn-sub-renew {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #34d399 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .btn-sub-renew:hover {
  background: #1e2d4e !important;
  border-color: #34d399 !important;
  color: #6ee7b7 !important;
}

[data-theme="dark"] .profile-subscription-reserved,
[data-theme="dark"] #profile-reserved-subscription {
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
  background: rgba(245, 158, 11, 0.12) !important;
  color: #fbbf24 !important;
}

[data-theme="dark"] .confirm-card,
[data-theme="dark"] #confirm-modal .modal-card,
[data-theme="dark"] #planner-help-modal .modal-card {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] #planner-help-modal {
  color: var(--ink) !important;
}

/* --------------------------------------------------------------------------
   16. Messages Inbox Modal
   -------------------------------------------------------------------------- */
[data-theme="dark"] .inbox-modal-card {
  background: #0b1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .inbox-modal-head {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .inbox-modal-head .modal-title {
  color: #ffffff !important;
}

[data-theme="dark"] .inbox-threads,
[data-theme="dark"] .inbox-chat {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .inbox-thread-item {
  background: #121c34 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .inbox-thread-item.active {
  background: rgba(0, 220, 130, 0.16) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
  box-shadow: 0 0 14px rgba(0, 220, 130, 0.25) !important;
}

[data-theme="dark"] .inbox-thread-line {
  color: #f8fafc !important;
}

[data-theme="dark"] .inbox-thread-date {
  color: #94a3b8 !important;
}

[data-theme="dark"] .inbox-message {
  background: #121c34 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .inbox-message-item.user .inbox-message {
  background: #142646 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

[data-theme="dark"] .inbox-message-item.admin .inbox-message {
  background: #10261e !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .inbox-message-body {
  color: #f8fafc !important;
}

[data-theme="dark"] .inbox-message-head {
  color: #94a3b8 !important;
}

[data-theme="dark"] .inbox-reply {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .inbox-reply textarea,
[data-theme="dark"] .composer-box textarea {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .composer-box {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .composer-send-btn,
[data-theme="dark"] #feedback-send {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35) !important;
}

[data-theme="dark"] .composer-send-btn:hover,
[data-theme="dark"] #feedback-send:hover {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border-color: #00dc82 !important;
  color: #ffffff !important;
  box-shadow: 0 6px 18px rgba(0, 220, 130, 0.35) !important;
  transform: translateY(-1px);
}

[data-theme="dark"] .composer-attach-btn,
[data-theme="dark"] #feedback-attach-btn {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .composer-attach-btn:hover,
[data-theme="dark"] #feedback-attach-btn:hover {
  background: #1e2d4e !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.25) !important;
  transform: translateY(-1px);
}

[data-theme="dark"] .attach-preview-item {
  background: #090f1d !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}

/* --------------------------------------------------------------------------
   17. Profile View (profile.html)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .profile-card,
[data-theme="dark"] .profile-view {
  background: #0d1527 !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .profile-title {
  color: #ffffff !important;
}

[data-theme="dark"] .profile-avatar-lg,
[data-theme="dark"] .profile-logo-preview {
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: #141f38 !important;
}

[data-theme="dark"] .profile-institutions-tabs {
  border-bottom-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .profile-tab {
  color: var(--muted) !important;
}

[data-theme="dark"] .profile-tab.active {
  color: #00dc82 !important;
  border-bottom-color: #00dc82 !important;
}

[data-theme="dark"] .btn-sub-upgrade {
  background: #0e1c34 !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

[data-theme="dark"] .btn-sub-renew {
  background: #0e261c !important;
  color: #00dc82 !important;
  border-color: rgba(0, 220, 130, 0.4) !important;
}

[data-theme="dark"] .profile-view input[type="file"] {
  background: #080d18 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .profile-view input[type="file"]::file-selector-button {
  background: #16223c !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

/* Institution Form & Tabs (Image 1 - Item 2) */
[data-theme="dark"] .institution-form {
  background: #0e1628 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .institution-tab {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .institution-tab:hover {
  background: #1b294a !important;
  color: #ffffff !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .institution-tab.active {
  background: rgba(0, 220, 130, 0.18) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .institution-tab-delete {
  color: #94a3b8 !important;
}

[data-theme="dark"] .institution-tab-delete:hover {
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.15) !important;
}

[data-theme="dark"] .institution-empty {
  background: #0a101c !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .profile-referral-card {
  background: #0e1628 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .profile-referral-title {
  color: #ffffff !important;
}

[data-theme="dark"] .profile-referral-row input {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .profile-referral-meta {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .preview-box {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .upload-picker,
[data-theme="dark"] .upload-remove {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .upload-picker:hover,
[data-theme="dark"] .upload-remove:hover {
  background: #1d2c4e !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .profile-password-row {
  background: #0a1120 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .profile-password-toggle {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .profile-password-toggle:hover {
  background: #1a2a4c !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

/* --------------------------------------------------------------------------
   18. Hover States (Prevent White Flashes on Hover)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .help-btn:hover,
[data-theme="dark"] .duration-step-btn:hover,
[data-theme="dark"] .alloc-step-btn:hover,
[data-theme="dark"] .alloc-weight-save-btn:hover,
[data-theme="dark"] .plan-quality-btn:hover,
[data-theme="dark"] .composer-attach-btn:hover,
[data-theme="dark"] .general-subject-toggle:hover,
[data-theme="dark"] .feedback-toggle:hover,
[data-theme="dark"] .program-note-toggle:hover,
[data-theme="dark"] .split-settings-tab:hover,
[data-theme="dark"] .group-recall-nav:hover,
[data-theme="dark"] .schedule-manual-subject-option:hover,
[data-theme="dark"] .schedule-manual-duration-btn:hover,
[data-theme="dark"] .inbox-thread-item:hover,
[data-theme="dark"] .admin-plan-filter .btn:hover {
  background: #1a2a4a !important;
  color: #00dc82 !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .help-btn {
  background: #121c34 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .duration-step-btn,
[data-theme="dark"] .alloc-step-btn {
  background: #121c34 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: var(--ink) !important;
}

/* --------------------------------------------------------------------------
   19. Schedule Preview Table & Modern Timetable
   -------------------------------------------------------------------------- */
[data-theme="dark"] #student-plan-preview {
  background: #0a1020 !important;
  border: 1px solid var(--line-strong) !important;
  box-shadow: var(--shadow-lg) !important;
}

[data-theme="dark"] .schedule-table {
  border: 1.5px solid var(--schedule-outer) !important;
  background: var(--schedule-surface) !important;
}

[data-theme="dark"] .schedule-table td {
  border: 1px solid var(--schedule-grid) !important;
  color: var(--schedule-topic-text) !important;
}

[data-theme="dark"] .schedule-table td.schedule-subject {
  background: var(--schedule-subject-bg) !important;
  color: var(--schedule-subject-text) !important;
  border-bottom: 1.5px solid rgba(56, 189, 248, 0.35) !important;
}

[data-theme="dark"] .schedule-table td.schedule-topic {
  background: var(--schedule-topic-bg) !important;
  color: var(--schedule-topic-text) !important;
}

[data-theme="dark"] .schedule-table td.schedule-time {
  background: var(--schedule-time-bg) !important;
  color: var(--schedule-time-text) !important;
  text-shadow: 0 0 8px rgba(0, 220, 130, 0.3) !important;
}

[data-theme="dark"] .schedule-table td.schedule-guide {
  background: var(--schedule-guide-bg) !important;
  color: var(--schedule-guide-text) !important;
}

/* --------------------------------------------------------------------------
   19.5 Schedule Mobile Layout & Preview (حالت موبایلی پیش‌نمایش برنامه‌ها)
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --schedule-focus-bg: #142240;
  --schedule-focus-ring: #38bdf8;
  --schedule-input-bg: #0a1122;
  --schedule-input-border: rgba(255, 255, 255, 0.16);
  --schedule-input-text: #f8fafc;
  --schedule-menu-bg: #0d1527;
  --schedule-hover-bg: #142240;
  --schedule-hover-text: #38bdf8;
  --schedule-mobile-border: rgba(255, 255, 255, 0.09);
  --schedule-mobile-card: #0b1222;
  --schedule-mobile-head-start: #111a2f;
  --schedule-mobile-head-end: #0e1628;
  --schedule-mobile-text: #f8fafc;
  --schedule-mobile-topic: #cbd5e1;
  --schedule-mobile-surface: #070c18;
  --schedule-mobile-time-text: #38bdf8;
  --schedule-mobile-time-border: rgba(56, 189, 248, 0.28);
  --schedule-mobile-time-bg: rgba(56, 189, 248, 0.12);
  --schedule-mobile-total-text: #34d399;
  --schedule-mobile-total-bg: rgba(16, 185, 129, 0.14);
  --schedule-mobile-total-border: rgba(16, 185, 129, 0.28);
}

[data-theme="dark"] .schedule-mobile {
  margin-top: 10px !important;
  display: grid !important;
  gap: 12px !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .schedule-mobile-day {
  background: #0b1222 !important;
  border: 1px solid rgba(255, 255, 255, 0.09) !important;
  border-radius: 14px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
  overflow: hidden !important;
}

[data-theme="dark"] .schedule-mobile-day-head {
  background: linear-gradient(180deg, #111a2f 0%, #0d1527 100%) !important;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08) !important;
  padding: 10px 12px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 8px !important;
}

[data-theme="dark"] .schedule-mobile-day-name {
  color: #f8fafc !important;
  font-size: 14px !important;
  font-weight: 800 !important;
}

[data-theme="dark"] .schedule-mobile-day-date {
  color: #94a3b8 !important;
  font-size: 11.5px !important;
  font-variant-numeric: tabular-nums !important;
}

[data-theme="dark"] .schedule-mobile-day-total-head {
  background: rgba(16, 185, 129, 0.14) !important;
  color: #34d399 !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 3px 9px !important;
}

[data-theme="dark"] .schedule-mobile-items {
  background: #070c18 !important;
  padding: 8px 10px !important;
  display: grid !important;
  gap: 6px !important;
}

/* Non-manual mobile items: 2 columns (main text + duration badge) */
[data-theme="dark"] .schedule-mobile:not(.schedule-mobile-manual) .schedule-mobile-item {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  padding: 8px 10px !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 8px !important;
  align-items: center !important;
  transition: border-color 0.15s ease, background-color 0.15s ease !important;
}

[data-theme="dark"] .schedule-mobile:not(.schedule-mobile-manual) .schedule-mobile-item:hover {
  background: #111c34 !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
}

/* Manual mobile items: 4 columns in 1 single row (Subject + Topic + Duration + Delete) */
[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-items {
  background: #070c18 !important;
  padding: 8px 6px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-item {
  display: grid !important;
  grid-template-columns: minmax(70px, 0.95fr) minmax(104px, 1.62fr) minmax(92px, 1fr) 24px !important;
  gap: 6px !important;
  align-items: center !important;
  padding: 7px 8px !important;
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  transition: border-color 0.15s ease, background-color 0.15s ease !important;
}

[data-theme="dark"] .schedule-mobile-manual[data-sarv-manual-count="1"] .schedule-mobile-item {
  grid-template-columns: minmax(66px, 0.9fr) minmax(98px, 1.45fr) minmax(132px, 1.15fr) 24px !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-item:hover {
  border-color: rgba(56, 189, 248, 0.25) !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-select,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-input,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-duration-input,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-count-input {
  background: #0a1122 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
  font-family: inherit !important;
  font-size: 12px !important;
  min-height: 36px !important;
  border-radius: 10px !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-select:focus,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-input:focus,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-duration-input:focus,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-count-input:focus {
  background: #101c36 !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35) !important;
  outline: none !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-select {
  color: #38bdf8 !important;
  font-weight: 700 !important;
  text-align: center !important;
  text-align-last: center !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-duration-input {
  color: #38bdf8 !important;
  font-weight: 700 !important;
  text-align: center !important;
}

[data-theme="dark"] .schedule-manual-topic-input,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-input {
  text-align: center !important;
}

[data-theme="dark"] .schedule-manual-topic-input::placeholder,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-select::placeholder,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-input::placeholder,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-duration-input::placeholder,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-count-input::placeholder {
  color: #64748b !important;
  text-align: center !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-duration-stepper .schedule-manual-duration-btn {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
  border-radius: 5px !important;
  width: 17px !important;
  height: 14px !important;
  font-size: 10px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-duration-stepper .schedule-manual-duration-btn:hover {
  background: #1c2e54 !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-menu {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85) !important;
  max-height: 200px !important;
  padding: 4px !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-option {
  color: #e2e8f0 !important;
  font-family: inherit !important;
  border-radius: 7px !important;
  padding: 7px 10px !important;
  font-size: 12px !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-option:hover {
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-empty {
  color: #64748b !important;
  font-size: 11px !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-wrap .topic-num-step {
  color: #94a3b8 !important;
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 5px !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-wrap .topic-num-step:hover {
  color: #38bdf8 !important;
  background: #1c2e54 !important;
  border-color: #38bdf8 !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-row-delete {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.28) !important;
  border-radius: 8px !important;
  width: 24px !important;
  height: 24px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-row-delete svg {
  width: 14px !important;
  height: 14px !important;
  stroke: currentColor !important;
  fill: none !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-row-delete:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  color: #ef4444 !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-add-wrap {
  margin: 10px 0 8px !important;
  min-height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-add {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px dashed rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
  border-radius: 10px !important;
  min-width: 80px !important;
  height: 32px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-add:hover {
  background: rgba(16, 185, 129, 0.24) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
}

[data-theme="dark"] .schedule-mobile-subject {
  color: #38bdf8 !important;
  font-weight: 800 !important;
  font-size: 13.5px !important;
}

[data-theme="dark"] .schedule-mobile-sep {
  color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="dark"] .schedule-mobile-topic {
  color: #e2e8f0 !important;
  font-size: 12.5px !important;
}

[data-theme="dark"] .schedule-mobile-time {
  background: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.28) !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 3px 9px !important;
  min-width: 52px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-variant-numeric: tabular-nums !important;
}

[data-theme="dark"] .schedule-mobile-empty {
  background: #080d19 !important;
  border: 1px dashed rgba(255, 255, 255, 0.1) !important;
  border-radius: 10px !important;
  color: #94a3b8 !important;
  padding: 12px !important;
  text-align: center !important;
  font-size: 12px !important;
}

[data-theme="dark"] .schedule-mobile-total {
  background: rgba(16, 185, 129, 0.1) !important;
  border-top: 1px dashed rgba(16, 185, 129, 0.2) !important;
  color: #34d399 !important;
}

[data-theme="dark"] .schedule-mobile-row-delete {
  background: rgba(239, 68, 68, 0.14) !important;
  color: #f87171 !important;
  border: 1px solid rgba(239, 68, 68, 0.28) !important;
  border-radius: 8px !important;
}

[data-theme="dark"] .schedule-mobile-row-delete:hover {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #ef4444 !important;
}

[data-theme="dark"] .schedule-mobile-add {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px dashed rgba(16, 185, 129, 0.35) !important;
  color: #34d399 !important;
  border-radius: 10px !important;
}

[data-theme="dark"] .schedule-mobile-add:hover {
  background: rgba(16, 185, 129, 0.22) !important;
  border-color: #10b981 !important;
  color: #10b981 !important;
}

/* Editable cell focus states - Never turn white in dark mode */
[data-theme="dark"] .schedule-mobile-editable .schedule-editable-cell:focus,
[data-theme="dark"] .schedule-mobile [contenteditable="true"]:focus,
[data-theme="dark"] .schedule-mobile-editable [contenteditable="true"]:focus,
[data-theme="dark"] .schedule-editable-cell:focus,
[data-theme="dark"] [contenteditable="true"]:focus {
  background: #142240 !important;
  color: #f8fafc !important;
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.45) !important;
  border-radius: 6px !important;
}

[data-theme="dark"] .schedule-mobile-editable .schedule-mobile-subject.schedule-editable-cell:focus {
  background: #142240 !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .schedule-mobile-editable .schedule-mobile-topic.schedule-editable-cell:focus {
  background: #142240 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .schedule-mobile-editable .schedule-mobile-time.schedule-editable-cell:focus {
  background: #142240 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.5) !important;
}

[data-theme="dark"] .schedule-mobile-editable .schedule-mobile-day-name.schedule-editable-cell:focus,
[data-theme="dark"] .schedule-mobile-editable .schedule-mobile-day-date.schedule-editable-cell:focus {
  background: #142240 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .schedule-mobile-manual .schedule-mobile-field.schedule-editable-cell:focus {
  background: #101c36 !important;
  color: #f8fafc !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.35) !important;
}

/* Schedule Preview Container in Dark Mode */
[data-theme="dark"] .student-preview {
  background: #080d1a !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5) !important;
  padding: 10px !important;
}

[data-theme="dark"] .student-preview-head-row .student-preview-reset {
  background: #111a2f !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
  border-radius: 10px !important;
}

[data-theme="dark"] .student-preview-head-row .student-preview-reset:hover {
  background: #182646 !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

/* Modern Timetable Schedule (.schedule-dashboard-wrap) */
[data-theme="dark"] .schedule-dashboard-wrap {
  --dash-bg: #060913;
  --dash-surface: #0d1527;
  --dash-border: rgba(255, 255, 255, 0.12);
  --dash-border-subtle: rgba(255, 255, 255, 0.08);
  --dash-border-hover: rgba(0, 220, 130, 0.35);
  --dash-ink-main: #f8fafc;
  --dash-ink-muted: #94a3b8;
  --dash-shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --dash-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .schedule-day-pillar {
  background: #121c34 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .day-pillar-name {
  color: #ffffff !important;
}

[data-theme="dark"] .day-pillar-date {
  color: #94a3b8 !important;
}

[data-theme="dark"] .day-pillar-total {
  background: rgba(0, 220, 130, 0.16) !important;
  color: #00dc82 !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .schedule-slot-card {
  background: #0e1628 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .schedule-slot-card:hover {
  background: #14203a !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .slot-topic-text {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .slot-time-chip {
  background: #16223c !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .slot-count-chip {
  background: #121c34 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .schedule-slot-empty {
  background: rgba(10, 16, 30, 0.4) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .schedule-slot-empty-card {
  background: rgba(10, 16, 30, 0.5) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .schedule-slot-empty-card:hover,
[data-theme="dark"] .schedule-slot-empty-card:focus-within {
  background: #101a30 !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

@media (max-width: 860px) {
  [data-theme="dark"] .schedule-day-row {
    background: #0d1527 !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
  }
}

/* Manual Schedule Toolbar & Input Cells (Image 2 - Item 3) */
[data-theme="dark"] .schedule-toolbar-island {
  background: #0d1527 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .toolbar-label {
  color: #94a3b8 !important;
}

[data-theme="dark"] .toolbar-pill {
  background: #101a2e !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .toolbar-pill:hover {
  background: #182646 !important;
  border-color: rgba(0, 220, 130, 0.4) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .toolbar-pill.active {
  background: rgba(0, 220, 130, 0.18) !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
  box-shadow: 0 0 12px rgba(0, 220, 130, 0.25) !important;
}

[data-theme="dark"] .schedule-table-manual .schedule-manual-cell {
  background: #080d19 !important;
}

[data-theme="dark"] .schedule-manual-subject-select,
[data-theme="dark"] .schedule-manual-topic-input,
[data-theme="dark"] .schedule-manual-duration-input,
[data-theme="dark"] .schedule-manual-count-input,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-subject-select,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-input,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-duration-input,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-count-input {
  background: #0a1122 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .schedule-manual-subject-select:focus,
[data-theme="dark"] .schedule-manual-topic-input:focus,
[data-theme="dark"] .schedule-manual-duration-input:focus,
[data-theme="dark"] .schedule-manual-count-input:focus {
  border-color: #00dc82 !important;
  background: #0f1a30 !important;
  box-shadow: 0 0 0 2px rgba(0, 220, 130, 0.22) !important;
}

[data-theme="dark"] .schedule-manual-duration-btn {
  background: #141f38 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .schedule-manual-duration-btn:hover {
  background: #1c2b4e !important;
  border-color: #00dc82 !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .schedule-manual-subject-menu {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8) !important;
}

[data-theme="dark"] .schedule-manual-subject-option {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .schedule-manual-subject-option:hover {
  background: rgba(0, 220, 130, 0.15) !important;
  color: #00dc82 !important;
}

[data-theme="dark"] .schedule-manual-subject-empty {
  color: #64748b !important;
}

[data-theme="dark"] .schedule-table-manual .schedule-manual-topic-wrap .topic-num-step,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-wrap .topic-num-step {
  color: #94a3b8 !important;
  background: #141f38 !important;
}

[data-theme="dark"] .schedule-table-manual .schedule-manual-topic-wrap .topic-num-step:hover,
[data-theme="dark"] .schedule-mobile-manual .schedule-manual-topic-wrap .topic-num-step:hover {
  color: #00dc82 !important;
  background: #1e2d4e !important;
}

/* --------------------------------------------------------------------------
   20. Scrollbars & Highlight Selection
   -------------------------------------------------------------------------- */
[data-theme="dark"] html,
[data-theme="dark"] * {
  scrollbar-color: #334155 #0b1122;
}

[data-theme="dark"] *::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

[data-theme="dark"] *::-webkit-scrollbar-track {
  background: #0b1122;
}

[data-theme="dark"] *::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #334155, #1e293b);
  border: 2px solid #0b1122;
  border-radius: 999px;
}

[data-theme="dark"] *::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #475569, #334155);
}

[data-theme="dark"] ::selection {
  background: rgba(0, 220, 130, 0.35);
  color: #ffffff;
}

/* --------------------------------------------------------------------------
   21. Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  .theme-toggle-btn .theme-svg {
    width: 19px;
    height: 19px;
  }
  .theme-sparkle {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   22. Plan Delete Trash Button & Action Icon Centering (Point 2)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .plan-delete-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  padding: 0 !important;
  align-self: center !important;
  margin-block: auto !important;
  color: #94a3b8 !important;
  border-radius: 8px !important;
}

[data-theme="dark"] .plan-delete-btn:hover {
  color: #f87171 !important;
  background: rgba(248, 113, 113, 0.15) !important;
}

[data-theme="dark"] .plan-delete-btn svg {
  display: block !important;
  margin: auto !important;
  width: 14px !important;
  height: 14px !important;
}

/* --------------------------------------------------------------------------
   23. Schedule Display Preference Modal & Mini Preview (Image 1 Fix)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .schedule-display-preference-card,
[data-theme="dark"] #schedule-display-preference-modal .modal-card,
[data-theme="dark"] #split-settings-panel {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  box-shadow: var(--shadow-lg) !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .schedule-display-preference-title {
  color: #ffffff !important;
  font-weight: 800 !important;
}

[data-theme="dark"] .schedule-display-option {
  background: #090f1d !important;
  border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4) !important;
  color: var(--ink) !important;
  transition: all 0.2s ease !important;
}

[data-theme="dark"] .schedule-display-option:hover {
  background: #0f1930 !important;
  border-color: rgba(0, 220, 130, 0.35) !important;
}

[data-theme="dark"] .schedule-display-option:has(input:checked) {
  border-color: #00dc82 !important;
  box-shadow: 0 0 0 1px #00dc82, 0 0 18px rgba(0, 220, 130, 0.25) !important;
  background: #0d1a33 !important;
}

[data-theme="dark"] .schedule-display-title {
  color: #ffffff !important;
  font-weight: 800 !important;
  font-size: 13px !important;
}

[data-theme="dark"] .schedule-display-mini {
  background: #060913 !important;
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  border-radius: 8px !important;
  color: var(--ink) !important;
}

[data-theme="dark"] .schedule-display-cell {
  background: #0a1122 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .schedule-display-cell b {
  background: rgba(26, 38, 72, 0.95) !important;
  color: #38bdf8 !important;
  border-top: none !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-weight: 800 !important;
  font-size: 12px !important;
}

[data-theme="dark"] .schedule-display-cell em {
  background: rgba(13, 20, 36, 0.95) !important;
  color: #f1f5f9 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

[data-theme="dark"] .schedule-display-cell small {
  background: rgba(18, 28, 52, 0.9) !important;
  color: #00dc82 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  font-weight: 700 !important;
  font-size: 11px !important;
}

/* --------------------------------------------------------------------------
   23. Login, Signup, Upgrade (اشتراک), Welcome & Info Pages
   -------------------------------------------------------------------------- */

[data-theme="dark"] body {
  background-color: #030712 !important;
  color: var(--ink) !important;
}

[data-theme="dark"] body::before {
  border-color: rgba(255, 255, 255, 0.07) !important;
}

[data-theme="dark"] .card {
  background: #0b1222 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6) !important;
  color: #f8fafc !important;
}

/* Logo Styling - Dark Mode: Clean transparent original logo */
[data-theme="dark"] img.brand-logo:not(#org-admin-user-logo),
[data-theme="dark"] img.auth-logo,
[data-theme="dark"] #signup-brand-logo,
[data-theme="dark"] .brand img,
[data-theme="dark"] .logo-only img,
[data-theme="dark"] .hero img,
[data-theme="dark"] .head img,
[data-theme="dark"] img[src*="logo.png"],
[data-theme="dark"] img[src*="logo-dark.png"] {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  filter: drop-shadow(0 2px 10px rgba(0, 220, 130, 0.22)) !important;
}

/* Login Page Specifics */

[data-theme="dark"] .field span {
  color: #cbd5e1 !important;
}

[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="tel"],
[data-theme="dark"] input[type="password"] {
  background: #070c18 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] input[type="text"]:focus,
[data-theme="dark"] input[type="tel"]:focus,
[data-theme="dark"] input[type="password"]:focus {
  border-color: #38bdf8 !important;
  background: #0d1527 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
  outline: none !important;
}

[data-theme="dark"] input::placeholder {
  color: #64748b !important;
}

[data-theme="dark"] .remember {
  color: #94a3b8 !important;
}

[data-theme="dark"] #login-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35) !important;
}

[data-theme="dark"] #signup-btn {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] #signup-btn:hover {
  background: #1e2d4e !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
}

[data-theme="dark"] .link-muted {
  color: #94a3b8 !important;
}

[data-theme="dark"] .link-muted:hover {
  color: #38bdf8 !important;
}

[data-theme="dark"] .forgot-hint {
  color: #94a3b8 !important;
}

[data-theme="dark"] .text-btn {
  color: #38bdf8 !important;
}

[data-theme="dark"] .text-btn:disabled {
  color: #64748b !important;
}

[data-theme="dark"] .countdown {
  color: #94a3b8 !important;
}

[data-theme="dark"] .btn-secondary,
[data-theme="dark"] #forgot-back-btn,
[data-theme="dark"] button.btn-secondary {
  background: #141f38 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] #forgot-verify-btn,
[data-theme="dark"] #forgot-send-code-btn,
[data-theme="dark"] #forgot-reset-password-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
}

[data-theme="dark"] #forgot-verify-btn:disabled {
  background: #141f38 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #64748b !important;
}

[data-theme="dark"] #login-status {
  color: #cbd5e1 !important;
}

/* Signup Page Specifics */
[data-theme="dark"] .head h1 {
  color: #ffffff !important;
}

[data-theme="dark"] .head img {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

[data-theme="dark"] .step {
  background: #070c18 !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: #64748b !important;
}

[data-theme="dark"] .step.active {
  background: rgba(14, 165, 233, 0.18) !important;
  border-color: #0ea5e9 !important;
  color: #38bdf8 !important;
  opacity: 1 !important;
}

[data-theme="dark"] .verify-note {
  background: rgba(14, 165, 233, 0.12) !important;
  border-color: rgba(56, 189, 248, 0.28) !important;
  color: #e0f2fe !important;
}

[data-theme="dark"] .otp-cell {
  background: #070c18 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .otp-cell.filled {
  background: #0f1c34 !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .otp-grid:focus-within .otp-cell {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
}

[data-theme="dark"] .verify-phone {
  color: #38bdf8 !important;
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
}

/* Signup Step 1 - Bottom action */
[data-theme="dark"] .signup-step1-actions .signup-login-btn,
[data-theme="dark"] .signup-login-action .btn,
[data-theme="dark"] .actions .btn:not(.btn-primary) {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .signup-step1-actions .signup-login-btn:hover,
[data-theme="dark"] .signup-login-action .btn:hover,
[data-theme="dark"] .actions .btn:not(.btn-primary):hover {
  background: #14203a !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

/* Signup Step 3 - Institution section & inputs */
[data-theme="dark"] #signup-phone-readonly {
  background: #060a15 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .inst-accordion {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  background: #0b1222 !important;
}

[data-theme="dark"] .inst-toggle {
  background: #0f1a32 !important;
  border-bottom: 1px solid transparent !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .inst-toggle.open {
  border-bottom-color: rgba(56, 189, 248, 0.25) !important;
}

[data-theme="dark"] .inst-toggle-icon {
  background: #142240 !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .inst-body {
  background: #080d1a !important;
}

[data-theme="dark"] .inst-body .muted {
  color: #94a3b8 !important;
}

[data-theme="dark"] .institution-tab {
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: #0d1527 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .institution-tab:hover {
  border-color: rgba(56, 189, 248, 0.3) !important;
  background: #111c34 !important;
}

[data-theme="dark"] .institution-tab.active {
  border-color: #38bdf8 !important;
  background: rgba(14, 165, 233, 0.2) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .institution-form {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #0b1222 !important;
}

[data-theme="dark"] .inst-name-label {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .inst-empty {
  border: 1px dashed rgba(255, 255, 255, 0.16) !important;
  background: #070c18 !important;
  color: #94a3b8 !important;
}

[data-theme="dark"] .inst-list li {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #0d1527 !important;
}

[data-theme="dark"] .inst-item-head {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .inst-item-head button {
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  background: rgba(239, 68, 68, 0.15) !important;
  color: #f87171 !important;
}

[data-theme="dark"] .upload-label {
  color: #f8fafc !important;
}

[data-theme="dark"] .preview-box {
  background: #070c18 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #64748b !important;
}

[data-theme="dark"] .upload-picker {
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  background: #0d1527 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .upload-picker:hover {
  background: #14203a !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .upload-picker svg {
  stroke: currentColor !important;
}

/* Upgrade / Subscription Page (upgrade.html) */
[data-theme="dark"] .title {
  color: #ffffff !important;
}

[data-theme="dark"] .duration-toggle {
  background: #0b1222 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .duration-toggle button {
  color: #94a3b8 !important;
  background: transparent !important;
}

[data-theme="dark"] .duration-toggle button.active {
  background: linear-gradient(96deg, #0ea5e9, #0284c7) !important;
  color: #ffffff !important;
  box-shadow: 0 10px 18px rgba(14, 165, 233, 0.3) !important;
}

[data-theme="dark"] .suggest-tag {
  background: rgba(16, 185, 129, 0.14) !important;
  border-color: rgba(16, 185, 129, 0.28) !important;
  color: #34d399 !important;
}

[data-theme="dark"] .plan-card {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .plan-card.starter {
  background: linear-gradient(180deg, #0d1527 0%, #070c18 100%) !important;
  border-color: rgba(56, 189, 248, 0.25) !important;
}

[data-theme="dark"] .plan-card.standard {
  background: linear-gradient(180deg, #101c34 0%, #0c1426 100%) !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

[data-theme="dark"] .plan-card.pro {
  background: linear-gradient(180deg, #132244 0%, #0f1a34 100%) !important;
  border-color: rgba(129, 140, 248, 0.4) !important;
}

[data-theme="dark"] .plan-card.ultra {
  background: linear-gradient(180deg, #182348 0%, #101732 100%) !important;
  border-color: rgba(168, 85, 247, 0.4) !important;
}

[data-theme="dark"] .plan-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .plan-card.active {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.25), 0 16px 36px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .plan-name {
  color: #ffffff !important;
}

[data-theme="dark"] .price-box {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .price-main {
  color: #ffffff !important;
}

[data-theme="dark"] .price-old {
  color: #64748b !important;
}

[data-theme="dark"] .price-unit {
  color: #94a3b8 !important;
}

[data-theme="dark"] .features li {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
}

[data-theme="dark"] .features li span {
  color: #f8fafc !important;
}

[data-theme="dark"] .features li small {
  color: #94a3b8 !important;
}

[data-theme="dark"] .popular-badge {
  background: rgba(14, 165, 233, 0.2) !important;
  border-color: #0ea5e9 !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .discount-pill {
  background: rgba(245, 158, 11, 0.16) !important;
  border-color: rgba(245, 158, 11, 0.3) !important;
  color: #fbbf24 !important;
}

[data-theme="dark"] .checkout-card {
  background: #0d1527 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .checkout-title {
  color: #ffffff !important;
}

[data-theme="dark"] .line {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .line strong {
  color: #ffffff !important;
}

[data-theme="dark"] .line.total {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .line.total strong {
  color: #38bdf8 !important;
}

[data-theme="dark"] #discount-code {
  background: #070c18 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] #apply-discount-btn {
  background: #141f38 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] #checkout-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .terms-row {
  color: #94a3b8 !important;
}

[data-theme="dark"] .terms-link {
  color: #38bdf8 !important;
}

[data-theme="dark"] .enamad-link {
  background: #0d1527 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .modal {
  background: rgba(3, 7, 18, 0.75) !important;
}

[data-theme="dark"] .modal-card {
  background: #0d1527 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .modal-title {
  color: #ffffff !important;
}

[data-theme="dark"] .modal-body {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .terms-content {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .terms-content h5 {
  color: #ffffff !important;
}

[data-theme="dark"] .terms-content .term-note {
  background: rgba(245, 158, 11, 0.12) !important;
  border-right-color: #f59e0b !important;
  color: #fbbf24 !important;
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb {
  background: #1e293b !important;
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-track {
  background: #090e1a !important;
}

/* Modal Bottom Action Bar (تایید قوانین و ...) */
[data-theme="dark"] .modal-actions {
  background: #0d1527 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .modal-actions .btn-secondary,
[data-theme="dark"] #terms-close {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .modal-actions .btn-secondary:hover,
[data-theme="dark"] #terms-close:hover {
  background: #1e2d4e !important;
  color: #38bdf8 !important;
  border-color: rgba(56, 189, 248, 0.4) !important;
}

[data-theme="dark"] .modal-actions .btn-primary,
[data-theme="dark"] #terms-accept-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35) !important;
}

/* Mini FAQ & Support Cards in Upgrade Page */
[data-theme="dark"] .mini-faq-card,
[data-theme="dark"] .support-card {
  background: #0b1222 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 18px 35px rgba(0, 0, 0, 0.5) !important;
  backdrop-filter: blur(8px) !important;
}

[data-theme="dark"] .mini-faq-card .faq-title {
  color: #ffffff !important;
}

[data-theme="dark"] .mini-faq-card .faq-item {
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: #0d162a !important;
}

[data-theme="dark"] .mini-faq-card .faq-question {
  background: #0f1a32 !important;
  color: #f1f5f9 !important;
}

[data-theme="dark"] .mini-faq-card .faq-question:hover {
  background: #142240 !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .mini-faq-card .faq-answer {
  background: #0a1020 !important;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .support-toggle {
  background: linear-gradient(96deg, #101c36, #0d1629) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .support-toggle:hover {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.2) !important;
}

[data-theme="dark"] .support-toggle[aria-expanded="true"] {
  border-color: #38bdf8 !important;
  background: linear-gradient(96deg, #142244, #101c36) !important;
}

[data-theme="dark"] .support-note {
  color: #94a3b8 !important;
}

[data-theme="dark"] #upgrade-support-topic {
  background: #070c18 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] #upgrade-support-topic option {
  background: #0b1222 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] #upgrade-support-message {
  background: #070c18 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] #upgrade-support-topic:focus,
[data-theme="dark"] #upgrade-support-message:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25) !important;
  outline: none !important;
}

[data-theme="dark"] #upgrade-support-send {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3) !important;
}

[data-theme="dark"] #upgrade-support-status {
  color: #cbd5e1 !important;
}

/* Welcome Page (welcome.html) */
[data-theme="dark"] body:has(.hero) {
  background:
    radial-gradient(1200px 560px at 100% -10%, rgba(14, 165, 233, 0.16) 0%, transparent 58%),
    radial-gradient(840px 440px at -8% 18%, rgba(34, 197, 94, 0.1) 0%, transparent 54%),
    #050914 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] body:has(.hero) .panel,
[data-theme="dark"] .welcome-panel {
  background: rgba(11, 18, 34, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.6) !important;
  backdrop-filter: blur(14px) !important;
  color: #f8fafc !important;
}

/* Signup Panels - Pure layout containers inside .card (no nested border box) */
[data-theme="dark"] .card .panel,
[data-theme="dark"] .card section.panel,
[data-theme="dark"] #signup-step-1,
[data-theme="dark"] #signup-step-2,
[data-theme="dark"] #signup-step-3 {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}

[data-theme="dark"] .hero img {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.2) !important;
}

[data-theme="dark"] .hero h1 {
  color: #ffffff !important;
}

[data-theme="dark"] .option-card {
  background: #0d1527 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .option-card:hover {
  border-color: rgba(56, 189, 248, 0.35) !important;
  background: #111c34 !important;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .option-card.active {
  background: linear-gradient(140deg, #101c36, #0d1527) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 16px 34px rgba(14, 165, 233, 0.25) !important;
}

[data-theme="dark"] .option-head {
  color: #ffffff !important;
}

[data-theme="dark"] .option-sub {
  color: #94a3b8 !important;
}

[data-theme="dark"] .option-tag {
  background: #141f38 !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .option-card.active .option-tag {
  background: #0ea5e9 !important;
  color: #ffffff !important;
}

[data-theme="dark"] .go-btn {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
  color: #ffffff !important;
  border: 1px solid #38bdf8 !important;
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.35) !important;
}

[data-theme="dark"] .status {
  color: #cbd5e1 !important;
}

/* Help & FAQ Pages (help.html, faq.html) */
[data-theme="dark"] body:has(.guide-card),
[data-theme="dark"] body:has(.faq-card) {
  background:
    radial-gradient(1200px 600px at 95% -10%, rgba(14, 165, 233, 0.14) 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(245, 158, 11, 0.08) 0%, transparent 55%),
    #050914 !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .card {
  background: #0b1222 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .guide-card,
[data-theme="dark"] .faq-card {
  background: #0b1222 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5) !important;
  color: #f8fafc !important;
}

[data-theme="dark"] .guide-head,
[data-theme="dark"] .faq-head {
  background: linear-gradient(180deg, #101c36 0%, #0d1629 100%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .guide-title,
[data-theme="dark"] .faq-title {
  color: #ffffff !important;
}

[data-theme="dark"] .guide-subtitle,
[data-theme="dark"] .faq-subtitle {
  color: #94a3b8 !important;
}

[data-theme="dark"] .guide-body,
[data-theme="dark"] .faq-body {
  background: #070c18 !important;
}

[data-theme="dark"] .faq-section-label {
  background: rgba(14, 165, 233, 0.16) !important;
  border: 1px solid rgba(14, 165, 233, 0.35) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .guide-accordion-item,
[data-theme="dark"] .faq-item {
  background: #0d162a !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .guide-accordion-item:hover,
[data-theme="dark"] .faq-item:hover {
  border-color: rgba(56, 189, 248, 0.3) !important;
}

[data-theme="dark"] .guide-accordion-item.open,
[data-theme="dark"] .faq-item.open {
  border-color: rgba(56, 189, 248, 0.45) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4) !important;
}

[data-theme="dark"] .guide-trigger,
[data-theme="dark"] .faq-trigger {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .guide-trigger-title,
[data-theme="dark"] .faq-question {
  color: #f1f5f9 !important;
}

[data-theme="dark"] .guide-chevron,
[data-theme="dark"] .faq-chevron {
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  color: #38bdf8 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .guide-panel,
[data-theme="dark"] .faq-panel {
  background: #0a1020 !important;
  border-top: 1px dashed rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .guide-panel p,
[data-theme="dark"] .faq-panel p,
[data-theme="dark"] .guide-panel li,
[data-theme="dark"] .faq-answer {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .guide-note,
[data-theme="dark"] .faq-note {
  background: rgba(16, 185, 129, 0.12) !important;
  border: 1px solid rgba(16, 185, 129, 0.28) !important;
  color: #34d399 !important;
}

[data-theme="dark"] .guide-warn {
  background: rgba(245, 158, 11, 0.12) !important;
  border: 1px solid rgba(245, 158, 11, 0.28) !important;
  color: #fbbf24 !important;
}

[data-theme="dark"] .guide-danger,
[data-theme="dark"] .faq-danger {
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.28) !important;
  color: #f87171 !important;
}

[data-theme="dark"] .icon-chip {
  background: rgba(56, 189, 248, 0.14) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  color: #38bdf8 !important;
  box-shadow: none !important;
}

[data-theme="dark"] .icon-chip.profile {
  color: #e2e8f0 !important;
}

[data-theme="dark"] .icon-inline svg {
  stroke: #cbd5e1 !important;
}

[data-theme="dark"] .guide-anchor {
  color: #38bdf8 !important;
}

/* User bar elements in help & faq */
[data-theme="dark"] .user-bar {
  background: #0b1222 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .user-hello {
  color: #f8fafc !important;
}

[data-theme="dark"] .user-plan {
  background: rgba(56, 189, 248, 0.16) !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .user-avatar {
  background: #141f38 !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .icon-btn {
  background: #141f38 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] .icon-btn:hover {
  background: #1e2d4e !important;
  color: #38bdf8 !important;
}

/* --------------------------------------------------------------------------
   Generation Status & Processing Queue ("صف پردازش")
   -------------------------------------------------------------------------- */
[data-theme="dark"] #output {
  color: #f1f5f9;
}

[data-theme="dark"] #output:empty {
  border: none !important;
  background: transparent !important;
  min-height: 0 !important;
  padding: 0 !important;
}

[data-theme="dark"] #output > .ok {
  background: #0d172a !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  border-radius: 12px;
  padding: 8px 12px;
  display: inline-block;
}

[data-theme="dark"] .generation-progress {
  background: #0d172a !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), inset 0 0 14px rgba(56, 189, 248, 0.05) !important;
}

[data-theme="dark"] .generation-progress.ok {
  background: #0d172a !important;
  border-color: rgba(56, 189, 248, 0.35) !important;
  color: #38bdf8 !important;
}

[data-theme="dark"] .generation-progress-text {
  color: #f1f5f9 !important;
  font-weight: 700 !important;
}

[data-theme="dark"] .generation-progress-timer {
  background: rgba(56, 189, 248, 0.16) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
  font-weight: 800 !important;
}

[data-theme="dark"] .generation-progress-stop {
  background: rgba(239, 68, 68, 0.18) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
  transition: all 0.2s ease !important;
}

[data-theme="dark"] .generation-progress-stop:hover {
  background: rgba(239, 68, 68, 0.32) !important;
  border-color: rgba(239, 68, 68, 0.75) !important;
  color: #ffffff !important;
}

[data-theme="dark"] #stop-generate {
  background: rgba(239, 68, 68, 0.16) !important;
  border: 1px solid rgba(239, 68, 68, 0.45) !important;
  color: #fca5a5 !important;
  transition: all 0.2s ease !important;
}

[data-theme="dark"] #stop-generate:hover {
  background: rgba(239, 68, 68, 0.3) !important;
  border-color: rgba(239, 68, 68, 0.75) !important;
  color: #ffffff !important;
}

[data-theme="dark"] .generation-limit-card {
  background: #1c1017 !important;
  border: 1px solid rgba(244, 63, 94, 0.35) !important;
  color: #fda4af !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .generation-limit-text {
  color: #fecdd3 !important;
}

[data-theme="dark"] .generation-upgrade-btn {
  background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%) !important;
  border: none !important;
  color: #ffffff !important;
}

/* Generation confirm range modal */
[data-theme="dark"] .confirm-range-desc {
  color: #cbd5e1 !important;
}

[data-theme="dark"] .confirm-range-skip {
  color: #94a3b8 !important;
}

[data-theme="dark"] .confirm-range-select {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
}

/* --------------------------------------------------------------------------
   Plan Quality Feedback Panel ("آیا از کیفیت این برنامه رضایت دارید؟")
   -------------------------------------------------------------------------- */
[data-theme="dark"] .plan-quality-panel {
  background: #0e1628 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .plan-quality-title {
  color: #f8fafc !important;
}

[data-theme="dark"] .plan-quality-btn {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
  transition: all 0.2s ease !important;
}

[data-theme="dark"] .plan-quality-btn:hover {
  background: #1e2d4e !important;
  border-color: rgba(56, 189, 248, 0.5) !important;
  color: #38bdf8 !important;
  transform: translateY(-1px);
}

[data-theme="dark"] .plan-quality-thanks {
  color: #34d399 !important;
}

[data-theme="dark"] .plan-dislike-box {
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding-top: 8px;
}

[data-theme="dark"] .plan-dislike-box div,
[data-theme="dark"] .plan-dislike-heading {
  color: #f8fafc !important;
}

[data-theme="dark"] .plan-dislike-hint {
  color: #94a3b8 !important;
}

[data-theme="dark"] .plan-dislike-box textarea,
[data-theme="dark"] #plan-dislike-input {
  background: #080d18 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #f8fafc !important;
  border-radius: 10px;
}

[data-theme="dark"] .plan-dislike-box textarea:focus,
[data-theme="dark"] #plan-dislike-input:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
  outline: none;
}

[data-theme="dark"] #plan-dislike-send {
  background: #141f38 !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #cbd5e1 !important;
}

[data-theme="dark"] #plan-dislike-send:hover {
  background: #1e2d4e !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
}

/* Split Activity Guidance Modal */
.split-help-modal-active .modal-card,
[data-theme="dark"] .split-help-modal-active .modal-card {
  width: min(540px, 94vw) !important;
  padding: 20px !important;
}

.split-help-modal-active .modal-title,
[data-theme="dark"] .split-help-modal-active .modal-title {
  font-size: 16px !important;
  font-weight: 800 !important;
  text-align: center !important;
  margin-bottom: 14px !important;
}

.split-help-modal-active #confirm-message,
[data-theme="dark"] .split-help-modal-active #confirm-message {
  font-size: 14px !important;
  line-height: 2 !important;
  color: inherit !important;
}

.split-help-modal-active #confirm-message p,
[data-theme="dark"] .split-help-modal-active #confirm-message p {
  margin: 0 0 12px 0 !important;
}

.split-help-modal-active #confirm-message p:last-child,
[data-theme="dark"] .split-help-modal-active #confirm-message p:last-child {
  margin-bottom: 0 !important;
}

.split-help-modal-active .modal-actions,
#confirm-modal .modal-actions:has(#confirm-cancel.hidden),
[data-theme="dark"] .split-help-modal-active .modal-actions,
[data-theme="dark"] #confirm-modal .modal-actions:has(#confirm-cancel.hidden) {
  direction: rtl !important;
  justify-content: center !important;
  margin-top: 30px !important;
  margin-bottom: 6px !important;
}

.split-help-modal-active #confirm-ok,
#confirm-modal .modal-actions:has(#confirm-cancel.hidden) #confirm-ok,
[data-theme="dark"] .split-help-modal-active #confirm-ok,
[data-theme="dark"] #confirm-modal .modal-actions:has(#confirm-cancel.hidden) #confirm-ok {
  min-width: 140px !important;
  height: 42px !important;
  padding: 0 28px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  line-height: 1 !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  border-radius: 10px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}


