/* =========================================================
   Logical Accounting — Dark mode ONLY (v4)
   Light mode = original site styles
   Home / Login / Register use their own minimal CSS always
========================================================= */

[data-theme="dark"] {
  color-scheme: dark;
  --mn-bg: #000;
  --mn-card: #111;
  --mn-border: #2a2a2a;
  --mn-text: #e8e8e8;
  --mn-muted: #a8a8a8;
  --mn-blue: #3b82f6;
  --mn-blue-d: #2563eb;
  --mn-blue-s: #93c5fd;
}

/* ---- Base ---- */
[data-theme="dark"] html,
[data-theme="dark"] body {
  background: #000 !important;
  color: var(--mn-text) !important;
}

[data-theme="dark"] main,
[data-theme="dark"] .admin-dashboard,
[data-theme="dark"] .quiz-admin-page,
[data-theme="dark"] .questions-admin-page,
[data-theme="dark"] .pp-admin-page,
[data-theme="dark"] .ai-page,
[data-theme="dark"] .dashboard-page,
[data-theme="dark"] .history-page,
[data-theme="dark"] .quiz-page,
[data-theme="dark"] .profile-page,
[data-theme="dark"] .resources-modern,
[data-theme="dark"] .about-modern,
[data-theme="dark"] .contact-modern,
[data-theme="dark"] .pp-page,
[data-theme="dark"] .classes-page,
[data-theme="dark"] .result-page {
  background: #000 !important;
  color: var(--mn-text) !important;
}

/* ---- Header / footer ---- */
[data-theme="dark"] .main-header,
[data-theme="dark"] header.main-header {
  background: #000 !important;
  border-bottom: 1px solid #1a1a1a !important;
}
[data-theme="dark"] .main-header a,
[data-theme="dark"] .nav-links a,
[data-theme="dark"] .brand,
[data-theme="dark"] .brand b,
[data-theme="dark"] .brand small {
  color: #e0e0e0 !important;
}
[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-user {
  color: var(--mn-blue-s) !important;
}
[data-theme="dark"] footer {
  background: #000 !important;
  border-top: 1px solid #1a1a1a !important;
  color: var(--mn-muted) !important;
}
[data-theme="dark"] footer a,
[data-theme="dark"] .footer-brand,
[data-theme="dark"] footer h4 {
  color: #ddd !important;
}
[data-theme="dark"] .footer-brand span {
  color: var(--mn-blue) !important;
}

/* Soften overly bright logo / icons */
[data-theme="dark"] .brand-logo,
[data-theme="dark"] .brand-logo img {
  background: transparent !important;
  opacity: 0.92;
  filter: brightness(0.92) contrast(1.05);
}
[data-theme="dark"] .menu-toggle,
[data-theme="dark"] .menu-toggle span {
  background: #c0c0c0 !important;
  color: #c0c0c0 !important;
}
[data-theme="dark"] svg,
[data-theme="dark"] .icon,
[data-theme="dark"] [class*="icon"] {
  opacity: 0.9;
}
[data-theme="dark"] .stat-icon,
[data-theme="dark"] .resource-file-icon,
[data-theme="dark"] .feature-icon,
[data-theme="dark"] .la-feature-icon,
[data-theme="dark"] .hp-feature-icon,
[data-theme="dark"] .hp-strip-icon,
[data-theme="dark"] .action-number,
[data-theme="dark"] .question-number {
  background: rgba(59, 130, 246, 0.14) !important;
  color: #93c5fd !important;
  border-color: transparent !important;
  box-shadow: none !important;
  filter: none !important;
}

/* ---- Shared cards / panels ---- */
[data-theme="dark"] .admin-stat,
[data-theme="dark"] .admin-action-card,
[data-theme="dark"] .admin-card,
[data-theme="dark"] .admin-panel,
[data-theme="dark"] .admin-filter-card,
[data-theme="dark"] .admin-results-card,
[data-theme="dark"] .admin-message,
[data-theme="dark"] .admin-mini-stat,
[data-theme="dark"] .quiz-admin-card,
[data-theme="dark"] .quiz-admin-stats > *,
[data-theme="dark"] .quiz-admin-hero,
[data-theme="dark"] .questions-card,
[data-theme="dark"] .questions-stat,
[data-theme="dark"] .student-card,
[data-theme="dark"] .student-stat,
[data-theme="dark"] .mail-card,
[data-theme="dark"] .mail-stat,
[data-theme="dark"] .ai-review-card,
[data-theme="dark"] .ai-stat,
[data-theme="dark"] .ai-empty,
[data-theme="dark"] .pp-log-card,
[data-theme="dark"] .import-card,
[data-theme="dark"] .system-card,
[data-theme="dark"] .card-surface,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .analytics-card,
[data-theme="dark"] .profile-card,
[data-theme="dark"] .dash-welcome,
[data-theme="dark"] .history-surface,
[data-theme="dark"] .history-stat,
[data-theme="dark"] .question-card,
[data-theme="dark"] .quiz-empty,
[data-theme="dark"] .quiz-top,
[data-theme="dark"] .quiz-submit,
[data-theme="dark"] .result-card,
[data-theme="dark"] .result-stat,
[data-theme="dark"] .resource-modern-card,
[data-theme="dark"] .resources-count-card,
[data-theme="dark"] .resources-filter-bar,
[data-theme="dark"] .resources-info-card,
[data-theme="dark"] .resources-hero-card,
[data-theme="dark"] .resources-empty,
[data-theme="dark"] .pp-year-card,
[data-theme="dark"] .pp-empty,
[data-theme="dark"] .pp-summary-card,
[data-theme="dark"] .pp-result-card,
[data-theme="dark"] .pp-mini-stat,
[data-theme="dark"] .pp-question-card,
[data-theme="dark"] .pp-answer-box,
[data-theme="dark"] .missed-item,
[data-theme="dark"] .missed-row,
[data-theme="dark"] .trend-insight,
[data-theme="dark"] .timer-box,
[data-theme="dark"] .option-label,
[data-theme="dark"] .about-profile-card,
[data-theme="dark"] .about-final-card,
[data-theme="dark"] .achievement-card,
[data-theme="dark"] .contact-method-card,
[data-theme="dark"] .contact-location-card,
[data-theme="dark"] .contact-feature-card,
[data-theme="dark"] .contact-hero-card,
[data-theme="dark"] .contact-final-card,
[data-theme="dark"] .classes-syllabus-card,
[data-theme="dark"] .classes-final-card,
[data-theme="dark"] .bulk-toolbar,
[data-theme="dark"] .motivation-card,
[data-theme="dark"] .answer-review,
[data-theme="dark"] .la-feature-card,
[data-theme="dark"] .la-hero-card,
[data-theme="dark"] .la-final-cta-inner {
  background: var(--mn-card) !important;
  border-color: var(--mn-border) !important;
  color: var(--mn-text) !important;
  box-shadow: none !important;
}

/* Text hierarchy on dark cards */
[data-theme="dark"] .admin-stat-number,
[data-theme="dark"] .admin-section h2,
[data-theme="dark"] .admin-action-card h3,
[data-theme="dark"] .quiz-admin-card-header h2,
[data-theme="dark"] .quiz-admin-hero h1,
[data-theme="dark"] .dashboard-page h1,
[data-theme="dark"] .dashboard-page h2,
[data-theme="dark"] .dashboard-page h3,
[data-theme="dark"] .history-page h1,
[data-theme="dark"] .history-page h2,
[data-theme="dark"] .result-card h1,
[data-theme="dark"] .result-card h2,
[data-theme="dark"] .answer-review h2,
[data-theme="dark"] .answer-review strong,
[data-theme="dark"] .motivation-card h3,
[data-theme="dark"] .contact-final-content h2,
[data-theme="dark"] .resource-modern-card h3,
[data-theme="dark"] .dash-welcome h1,
[data-theme="dark"] .dash-welcome h2,
[data-theme="dark"] .history-stat strong,
[data-theme="dark"] .stat-card strong,
[data-theme="dark"] .profile-card h2,
[data-theme="dark"] .question-card h2 {
  color: #f2f2f2 !important;
}

[data-theme="dark"] .admin-stat-label,
[data-theme="dark"] .admin-stat-sub,
[data-theme="dark"] .admin-section p,
[data-theme="dark"] .admin-action-card p,
[data-theme="dark"] .quiz-admin-card-header p,
[data-theme="dark"] .quiz-admin-hero p,
[data-theme="dark"] .motivation-card p,
[data-theme="dark"] .motivation-card > span,
[data-theme="dark"] .contact-final-content p,
[data-theme="dark"] .card-surface p,
[data-theme="dark"] .card-surface small,
[data-theme="dark"] .history-stat span,
[data-theme="dark"] .history-stat small,
[data-theme="dark"] .history-page p,
[data-theme="dark"] .history-page small,
[data-theme="dark"] .answer-review span,
[data-theme="dark"] .answer-review p,
[data-theme="dark"] .result-card p,
[data-theme="dark"] .result-card small,
[data-theme="dark"] .resource-modern-card p,
[data-theme="dark"] .missed-item p,
[data-theme="dark"] .option-content {
  color: #b0b0b0 !important;
}

[data-theme="dark"] .action-open,
[data-theme="dark"] .motivation-card a,
[data-theme="dark"] a {
  color: #93c5fd !important;
}
[data-theme="dark"] a:hover {
  color: #bfdbfe !important;
}

/* Motivation / contact CTAs — navy not mint */
[data-theme="dark"] .motivation-card,
[data-theme="dark"] .contact-final-card {
  background: linear-gradient(145deg, #0b1220, #111827) !important;
  border: 1px solid #1e3a5f !important;
}
[data-theme="dark"] .motivation-card > span,
[data-theme="dark"] .contact-final-content .eyebrow,
[data-theme="dark"] .contact-final-card .eyebrow {
  color: #93c5fd !important;
}
[data-theme="dark"] .contact-final-content h2 span {
  color: #60a5fa !important;
}
[data-theme="dark"] .contact-final-button {
  background: #2563eb !important;
  color: #fff !important;
}

/* Admin action hover */
[data-theme="dark"] .admin-action-card:hover {
  border-color: var(--mn-blue) !important;
  background: #151515 !important;
}
[data-theme="dark"] .action-number {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #93c5fd !important;
}

/* Forms */
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"],
[data-theme="dark"] input[type="search"],
[data-theme="dark"] input:not([type]),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1a1a1a !important;
  border: 1px solid #333 !important;
  color: #eee !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
  color: #777 !important;
}

/* Buttons */
[data-theme="dark"] .btn.primary,
[data-theme="dark"] .admin-btn,
[data-theme="dark"] .student-btn:not(.request-reject),
[data-theme="dark"] .la-btn-primary,
[data-theme="dark"] .resource-download,
[data-theme="dark"] .pp-start-btn,
[data-theme="dark"] .profile-btn,
[data-theme="dark"] .download-btn,
[data-theme="dark"] .missed-btn {
  background: #2563eb !important;
  color: #fff !important;
  border-color: transparent !important;
}
[data-theme="dark"] .request-reject,
[data-theme="dark"] .admin-btn-danger,
[data-theme="dark"] .quiz-btn-danger {
  background: #7f1d1d !important;
  color: #fecaca !important;
}

/* Tables */
[data-theme="dark"] table th,
[data-theme="dark"] .admin-table th,
[data-theme="dark"] .student-table th,
[data-theme="dark"] .quiz-table th,
[data-theme="dark"] .questions-table th,
[data-theme="dark"] .history-table th {
  background: #0a0a0a !important;
  color: #a8a8a8 !important;
  border-color: #2a2a2a !important;
}
[data-theme="dark"] table td,
[data-theme="dark"] .admin-table td,
[data-theme="dark"] .student-table td,
[data-theme="dark"] .quiz-table td,
[data-theme="dark"] .questions-table td,
[data-theme="dark"] .history-table td {
  background: #111 !important;
  color: #d0d0d0 !important;
  border-color: #1f1f1f !important;
}

/* Quiz */
[data-theme="dark"] .option-label {
  background: #141414 !important;
  border-color: #333 !important;
  color: #e5e5e5 !important;
}
[data-theme="dark"] .option-label:has(input:checked) {
  border-color: #3b82f6 !important;
  background: #0a1628 !important;
}
[data-theme="dark"] .option-letter {
  background: #222 !important;
  color: #ddd !important;
}
[data-theme="dark"] .option-label:has(input:checked) .option-letter {
  background: #2563eb !important;
  color: #fff !important;
}
[data-theme="dark"] .quiz-submit {
  background: #111 !important;
  border-color: #2a2a2a !important;
}
[data-theme="dark"] .quiz-submit .btn,
[data-theme="dark"] .quiz-submit button {
  background: #2563eb !important;
  color: #fff !important;
}

/* Result explanations */
[data-theme="dark"] .answer-explanation {
  background: #0a1628 !important;
  border: 1px solid #1e3a5f !important;
  color: #c8d0d8 !important;
}
[data-theme="dark"] .answer-wrong {
  background: #1a0a0a !important;
  border-color: #7f1d1d !important;
}

/* Heroes */
[data-theme="dark"] .resources-modern-hero,
[data-theme="dark"] .contact-modern-hero,
[data-theme="dark"] .about-modern-hero,
[data-theme="dark"] .pp-hero,
[data-theme="dark"] .la-hero,
[data-theme="dark"] .classes-hero,
[data-theme="dark"] .quiz-admin-hero {
  background: #000 !important;
}

/* Resource how-to steps */
[data-theme="dark"] .resources-info-steps > div {
  background: #1a1a1a !important;
  border-color: #333 !important;
}
[data-theme="dark"] .resources-info-steps p {
  color: #c8c8c8 !important;
}
[data-theme="dark"] .resources-info-main h2 {
  color: #f0f0f0 !important;
}
[data-theme="dark"] .resources-info-main h2 span {
  color: #60a5fa !important;
}
[data-theme="dark"] .resources-info-number {
  background: #1a1a1a !important;
  border-color: #333 !important;
  color: #93c5fd !important;
}

/* Status pills — not blinding white */
[data-theme="dark"] .request-status.granted,
[data-theme="dark"] .status-published,
[data-theme="dark"] .status-graded {
  background: #0f1f1a !important;
  color: #6ee7b7 !important;
}
[data-theme="dark"] .request-status.pending,
[data-theme="dark"] .missed-btn.pending {
  background: #3d2e00 !important;
  color: #fbbf24 !important;
}
[data-theme="dark"] .request-status.rejected {
  background: #1f0a0a !important;
  color: #fca5a5 !important;
}

/* Soften pure white badges / chips */
[data-theme="dark"] .count-pill,
[data-theme="dark"] .quiz-badge,
[data-theme="dark"] [class*="badge"]:not(.mn-badge):not(.hp-panel-badge) {
  filter: brightness(0.88);
}

/* Resource tabs */
[data-theme="dark"] .resource-tabs a {
  background: #1a1a1a !important;
  border-color: #333 !important;
  color: #c8c8c8 !important;
}
[data-theme="dark"] .resource-tabs a.active,
[data-theme="dark"] .resource-tabs a:hover {
  background: #0a1628 !important;
  border-color: #3b82f6 !important;
  color: #93c5fd !important;
}

/* Theme toggle options readable */
[data-theme="dark"] .theme-option {
  background: #151515 !important;
  border-color: #333 !important;
  color: #e0e0e0 !important;
}
[data-theme="dark"] .theme-option.active {
  border-color: #3b82f6 !important;
  background: #0a1628 !important;
}
