/* =====================================================================
   Shikshanetra dark theme — sn-dark.css
   Owner: UI-01. Ported from production portal/assets/css/dark-theme.css.
   Active when <html data-bs-theme="dark"> (set before first paint by the
   layouts' theme boot script from the System / Light / Dark choice).
   Bootstrap 5.3 darkens its own components; these rules cover the theme's
   own light colours.
   ===================================================================== */
[data-bs-theme="dark"] {
  color-scheme: dark;
  --sn-text: #e2e8f0;
  --sn-text-muted: #a3b1c6;
  --sn-bg: #0f172a;
  --sn-surface: #1e293b;
  --sn-shell-bg: #0f172a;
  --sn-border: #334155;
  --sn-border-strong: #475569;
  --sn-hover: #273449;
  --lte-border-color: #2b3546;
  --lte-shell-bg: #0f172a;
  --bs-body-bg: #0f172a;
  --bs-body-color: #e2e8f0;
  --bs-secondary-bg: #1e293b;
  --bs-tertiary-bg: #0b1222;
  --bs-border-color: #334155;
  --bs-emphasis-color: #f8fafc;
  --bs-secondary-color: #a3b1c6;
  --bs-link-color: var(--sn-primary-light);
  --bs-link-hover-color: #bfdbfe;
  --sn-flyout-bg: #1e293b;
  --sn-flyout-fg: #e2e8f0;
  --sn-flyout-muted: #94a3b8;
  --sn-flyout-border: #334155;
  --sn-focus-ring: 0 0 0 2px #0f172a, 0 0 0 4px #93c5fd; /* UX-001 dark */
  --sn-border-input: #64748b;
}
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item):not(.user-action-item):not(.sn-flyout-link) { color: var(--sn-primary-light); }

/* Shell */
[data-bs-theme="dark"] body, [data-bs-theme="dark"] .app-main { background: #0f172a; color: #e2e8f0; }
[data-bs-theme="dark"] .app-header { background-color: #111827; border-color: #2b3546; }
[data-bs-theme="dark"] .app-sidebar, [data-bs-theme="dark"] .sidebar-brand { background: #111827; border-color: #2b3546; }
[data-bs-theme="dark"] .sidebar-brand .brand-text, [data-bs-theme="dark"] .sn-page-title .sn-page-title-text { color: #f1f5f9; }
[data-bs-theme="dark"] .sidebar-brand .brand-subtitle { color: #94a3b8; }
[data-bs-theme="dark"] .sidebar-menu .nav-link { color: #cbd5e1; }
[data-bs-theme="dark"] .sidebar-menu .nav-treeview .nav-link { color: #a3b1c6; }
[data-bs-theme="dark"] .sidebar-menu .nav-link:hover { background: rgba(99, 102, 241, 0.18); color: #f8fafc; }
[data-bs-theme="dark"] .sidebar-menu .nav-link.active, [data-bs-theme="dark"] .sidebar-menu .nav-link.active .nav-icon { background: rgba(59, 130, 246, 0.22); color: #93c5fd; }
[data-bs-theme="dark"] .sidebar-menu .nav-header { color: #8796ad; }
[data-bs-theme="dark"] .sidebar-menu .nav-item.sn-menu-logout { border-color: #2b3546; }
[data-bs-theme="dark"] .sn-header-btn { color: #cbd5e1; }
[data-bs-theme="dark"] .sn-header-btn:hover, [data-bs-theme="dark"] .sn-header-btn[aria-expanded="true"] { background: #273449; color: #fff; }
[data-bs-theme="dark"] .sn-tenant-chip { background: rgba(96, 165, 250, 0.15); color: #bfdbfe; }
[data-bs-theme="dark"] .sn-flyout-link:hover, [data-bs-theme="dark"] .sn-flyout-link:focus-visible { background: #273449; }
[data-bs-theme="dark"] .sn-flyout-link.is-active { color: #93c5fd !important; background: rgba(96, 165, 250, 0.16); }

/* Utilities that ignore the theme */
[data-bs-theme="dark"] .bg-white, [data-bs-theme="dark"] .bg-light, [data-bs-theme="dark"] .bg-body { background-color: #1e293b !important; }
[data-bs-theme="dark"] .text-dark, [data-bs-theme="dark"] .text-black, [data-bs-theme="dark"] .text-body { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .text-muted, [data-bs-theme="dark"] .text-secondary { color: #a3b1c6 !important; }
[data-bs-theme="dark"] .text-success { color: #34d399 !important; }
[data-bs-theme="dark"] .text-danger { color: #f87171 !important; }
[data-bs-theme="dark"] .text-primary { color: var(--sn-primary-light) !important; }
[data-bs-theme="dark"] .text-info { color: #22d3ee !important; }
[data-bs-theme="dark"] .text-warning { color: #fbbf24 !important; }
[data-bs-theme="dark"] .border, [data-bs-theme="dark"] .border-top, [data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-start, [data-bs-theme="dark"] .border-end { border-color: #334155 !important; }

/* Cards, headers, footers */
[data-bs-theme="dark"] .card { background: #1e293b; box-shadow: 0 0 0 1px #273449, 0 4px 14px rgba(0, 0, 0, 0.35); }
[data-bs-theme="dark"] .card-header { background: #1e293b; border-color: #273449; color: #f1f5f9; }
[data-bs-theme="dark"] .card-footer { background: #172033; border-color: #273449; }
[data-bs-theme="dark"] .card-title { color: #f1f5f9; }
[data-bs-theme="dark"] .card.card-flat { border-color: #334155; }
[data-bs-theme="dark"] .form-section { background: #172033; border-color: #334155; }
[data-bs-theme="dark"] .form-section-title { color: #f1f5f9; border-color: #334155; }
[data-bs-theme="dark"] .form-section-title i { background: #273449; }
[data-bs-theme="dark"] .sn-form-actions { border-color: #334155; }

/* Tables */
[data-bs-theme="dark"] .table {
  --bs-table-bg: #1e293b; --bs-table-color: #e2e8f0; --bs-table-border-color: #334155;
  --bs-table-striped-bg: #223047; --bs-table-striped-color: #e2e8f0; --bs-table-hover-bg: #273449; --bs-table-hover-color: #fff;
  color: #e2e8f0;
}
[data-bs-theme="dark"] .table > :not(caption) > * > * { border-color: #334155; }
[data-bs-theme="dark"] .table thead th, [data-bs-theme="dark"] .table-dark th { background-color: #273449 !important; color: #e2e8f0 !important; border-color: #334155 !important; }
[data-bs-theme="dark"] .table tbody td { border-color: #2b3546; }
[data-bs-theme="dark"] .sn-table-toolbar { border-color: #334155; }

/* Forms */
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select, [data-bs-theme="dark"] .input-group-text {
  background-color: #0f172a; color: #e2e8f0; border-color: #334155;
}
[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus { background-color: #0f172a; color: #f8fafc; border-color: #3b82f6; }
[data-bs-theme="dark"] .form-control::placeholder { color: #7486a0; }
[data-bs-theme="dark"] .form-control:disabled, [data-bs-theme="dark"] .form-control[readonly], [data-bs-theme="dark"] .form-select:disabled { background-color: #1a2436; color: #a3b1c6; }
[data-bs-theme="dark"] .form-label { color: #cbd5e1; }
[data-bs-theme="dark"] .sn-auth .form-control { background: #0f172a; border-color: #334155; }

/* Badges */
[data-bs-theme="dark"] .badge.bg-success-subtle, [data-bs-theme="dark"] .badge-success-subtle, [data-bs-theme="dark"] .sn-badge-success { background-color: rgba(16, 185, 129, 0.22) !important; color: #6ee7b7 !important; border-color: rgba(16, 185, 129, 0.45); }
[data-bs-theme="dark"] .badge.bg-danger-subtle, [data-bs-theme="dark"] .badge-danger-subtle, [data-bs-theme="dark"] .sn-badge-danger { background-color: rgba(239, 68, 68, 0.22) !important; color: #fca5a5 !important; border-color: rgba(239, 68, 68, 0.45); }
[data-bs-theme="dark"] .badge.bg-warning-subtle, [data-bs-theme="dark"] .badge-warning-subtle, [data-bs-theme="dark"] .sn-badge-warning { background-color: rgba(245, 158, 11, 0.22) !important; color: #fde68a !important; border-color: rgba(245, 158, 11, 0.45); }
[data-bs-theme="dark"] .badge.bg-info-subtle, [data-bs-theme="dark"] .badge-info-subtle, [data-bs-theme="dark"] .sn-badge-info { background-color: rgba(6, 182, 212, 0.22) !important; color: #67e8f9 !important; border-color: rgba(6, 182, 212, 0.45); }
[data-bs-theme="dark"] .badge.bg-primary-subtle, [data-bs-theme="dark"] .badge-primary-subtle, [data-bs-theme="dark"] .sn-badge-primary { background-color: rgba(59, 130, 246, 0.22) !important; color: #93c5fd !important; border-color: rgba(59, 130, 246, 0.45); }
[data-bs-theme="dark"] .badge.bg-secondary-subtle, [data-bs-theme="dark"] .sn-badge-neutral { background-color: rgba(148, 163, 184, 0.22) !important; color: #cbd5e1 !important; border-color: rgba(148, 163, 184, 0.45); }
[data-bs-theme="dark"] .badge.bg-light { background-color: #334155 !important; color: #e2e8f0 !important; }

/* Alerts */
[data-bs-theme="dark"] .alert-success { background: rgba(16, 185, 129, 0.14); color: #a7f3d0; }
[data-bs-theme="dark"] .alert-danger { background: rgba(239, 68, 68, 0.14); color: #fecaca; }
[data-bs-theme="dark"] .alert-warning { background: rgba(245, 158, 11, 0.14); color: #fde68a; }
[data-bs-theme="dark"] .alert-info { background: rgba(6, 182, 212, 0.14); color: #a5f3fc; }
[data-bs-theme="dark"] .alert-primary { background: rgba(59, 130, 246, 0.14); color: #bfdbfe; }
[data-bs-theme="dark"] .sn-locked { background: rgba(245, 158, 11, 0.1); color: #fde68a; }
[data-bs-theme="dark"] .error-message { background: rgba(239, 68, 68, 0.14); color: #fecaca; }

/* Buttons */
[data-bs-theme="dark"] .btn-light { --bs-btn-bg: #334155; --bs-btn-border-color: #334155; --bs-btn-color: #e2e8f0; --bs-btn-hover-bg: #475569; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-outline-secondary { --bs-btn-color: #cbd5e1; --bs-btn-border-color: #475569; --bs-btn-hover-bg: #334155; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--sn-primary-light); --bs-btn-border-color: var(--sn-primary-light); }
[data-bs-theme="dark"] .btn-soft-secondary { background: #273449; color: #e2e8f0; }
[data-bs-theme="dark"] .btn-soft-primary { background: rgba(96, 165, 250, 0.15); color: #bfdbfe; }

/* Components */
[data-bs-theme="dark"] .dropdown-menu { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .dropdown-item { color: #e2e8f0; }
[data-bs-theme="dark"] .dropdown-item:hover, [data-bs-theme="dark"] .dropdown-item:focus { background-color: #334155; color: #fff; }
[data-bs-theme="dark"] .modal-content { background: #1e293b; }
[data-bs-theme="dark"] .modal-footer { background: #172033; border-color: #273449; }
[data-bs-theme="dark"] .modal-header.modal-header-plain { background: #1e293b; color: #f1f5f9; border-color: #273449; }
[data-bs-theme="dark"] .modal-header.modal-header-plain .btn-close, [data-bs-theme="dark"] .alert .btn-close, [data-bs-theme="dark"] .sn-toast .btn-close { filter: invert(1) grayscale(100%) brightness(200%); }
[data-bs-theme="dark"] .page-link { background-color: #1e293b !important; border-color: #334155 !important; color: #93c5fd !important; }
[data-bs-theme="dark"] .page-item.active .page-link { color: #fff !important; background: linear-gradient(135deg, var(--sn-primary) 0%, var(--sn-primary-dark) 100%) !important; }
[data-bs-theme="dark"] .page-item.disabled .page-link { background-color: #1a2436 !important; color: #64748b !important; }
[data-bs-theme="dark"] .nav-tabs { border-color: #334155; }
[data-bs-theme="dark"] .nav-tabs .nav-link { color: #cbd5e1; }
[data-bs-theme="dark"] .nav-tabs .nav-link.active { background-color: #1e293b; border-color: #334155 #334155 #1e293b; color: #f8fafc; }
[data-bs-theme="dark"] .progress { background: #273449; }
[data-bs-theme="dark"] .glass-card, [data-bs-theme="dark"] .sn-stat, [data-bs-theme="dark"] .info-box,
[data-bs-theme="dark"] .quick-action-btn, [data-bs-theme="dark"] .sn-quick-action { background: #1e293b; border-color: #273449; color: #e2e8f0; }
[data-bs-theme="dark"] .stat-value, [data-bs-theme="dark"] .sn-stat-value, [data-bs-theme="dark"] .info-box-number, [data-bs-theme="dark"] .quick-info strong { color: #f1f5f9; }
[data-bs-theme="dark"] .section-title, [data-bs-theme="dark"] .sn-section-title { color: #f1f5f9; }
[data-bs-theme="dark"] .sn-empty h3 { color: #f1f5f9; }
[data-bs-theme="dark"] .sn-toast { background: #1e293b; border-color: #334155; color: #e2e8f0; }
[data-bs-theme="dark"] .sn-kv dd { color: #f1f5f9; }
[data-bs-theme="dark"] .sn-timeline::before { background: #334155; }
[data-bs-theme="dark"] .sn-timeline > li::before { background: #1e293b; }
[data-bs-theme="dark"] .sn-skeleton { background: #273449; }

/* User menu & theme switcher */
[data-bs-theme="dark"] .user-profile-toggle { background-color: #1e293b; border-color: #334155; color: #f1f5f9 !important; }
[data-bs-theme="dark"] .user-profile-toggle:hover, [data-bs-theme="dark"] .user-profile-toggle[aria-expanded="true"] { background-color: #273449; border-color: #475569; }
[data-bs-theme="dark"] .user-toggle-name { color: #f1f5f9; }
[data-bs-theme="dark"] .user-toggle-role { color: #a3b1c6; }
[data-bs-theme="dark"] .online-status-dot { border-color: #1e293b; }
[data-bs-theme="dark"] .user-profile-menu { background: #1e293b !important; border-color: #334155 !important; }
[data-bs-theme="dark"] .user-action-item { color: #cbd5e1 !important; }
[data-bs-theme="dark"] .user-action-item:hover, [data-bs-theme="dark"] .user-action-item:focus-visible { background-color: #273449; color: #fff !important; }
[data-bs-theme="dark"] .action-item-title { color: #f1f5f9; }
[data-bs-theme="dark"] .action-item-desc { color: #a3b1c6; }
[data-bs-theme="dark"] .action-icon-badge.indigo { background-color: rgba(99, 102, 241, 0.18); color: #a5b4fc; }
[data-bs-theme="dark"] .action-icon-badge.blue { background-color: rgba(59, 130, 246, 0.18); color: #93c5fd; }
[data-bs-theme="dark"] .action-icon-badge.emerald { background-color: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
[data-bs-theme="dark"] .action-icon-badge.amber { background-color: rgba(245, 158, 11, 0.18); color: #fcd34d; }
[data-bs-theme="dark"] .action-icon-badge.purple { background-color: rgba(139, 92, 246, 0.18); color: #c4b5fd; }
[data-bs-theme="dark"] .user-profile-footer { background-color: #172033; border-color: #273449; }
[data-bs-theme="dark"] .btn-signout { background-color: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.35); color: #fca5a5 !important; }
[data-bs-theme="dark"] .theme-switcher { border-color: #273449; }
[data-bs-theme="dark"] .theme-switcher-label { color: #a3b1c6; }
[data-bs-theme="dark"] .theme-switcher-options { background: #0f172a; }
[data-bs-theme="dark"] .theme-option { color: #a3b1c6; }
[data-bs-theme="dark"] .theme-option:hover { color: #f1f5f9; }
[data-bs-theme="dark"] .theme-option.active, [data-bs-theme="dark"] .theme-option[aria-checked="true"] { background: #334155; color: #93c5fd; box-shadow: none; }

/* Auth & error */
[data-bs-theme="dark"] body.sn-auth { background: #0b1222; }
[data-bs-theme="dark"] .login-container, [data-bs-theme="dark"] .sn-error-card { background: #1e293b; }
[data-bs-theme="dark"] .login-header h1, [data-bs-theme="dark"] .login-header h2 { color: #f1f5f9; }
[data-bs-theme="dark"] .sn-auth .form-label { color: #cbd5e1; }
[data-bs-theme="dark"] .btn-login { background: var(--sn-primary-dark); }
[data-bs-theme="dark"] .btn-login:hover { background: var(--sn-primary); }
[data-bs-theme="dark"] .security-badge { color: #6ee7b7; }
[data-bs-theme="dark"] .sn-error { background: #0f172a; }

/* Third-party widgets */
[data-bs-theme="dark"] .select2-container .select2-selection, [data-bs-theme="dark"] .select2-dropdown, [data-bs-theme="dark"] .select2-search__field {
  background-color: #0f172a !important; color: #e2e8f0 !important; border-color: #334155 !important;
}
[data-bs-theme="dark"] .select2-container .select2-selection__rendered { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .select2-results__option { color: #e2e8f0; }
[data-bs-theme="dark"] .select2-results__option--highlighted, [data-bs-theme="dark"] .select2-results__option[aria-selected="true"] { background-color: #334155 !important; color: #fff !important; }
[data-bs-theme="dark"] .swal2-popup { background: #1e293b !important; color: #e2e8f0 !important; }
[data-bs-theme="dark"] .swal2-title, [data-bs-theme="dark"] .swal2-html-container { color: #e2e8f0 !important; }
[data-bs-theme="dark"] .swal2-input, [data-bs-theme="dark"] .swal2-textarea, [data-bs-theme="dark"] .swal2-select { background: #0f172a !important; color: #e2e8f0 !important; border-color: #334155 !important; }
[data-bs-theme="dark"] .air-datepicker {
  --adp-background-color: #1e293b; --adp-color: #e2e8f0; --adp-border-color: #334155; --adp-border-color-inner: #334155;
  --adp-background-color-hover: #334155; --adp-color-other-month: #64748b; --adp-day-name-color: #fbbf24;
}
[data-bs-theme="dark"] .air-datepicker-nav--title, [data-bs-theme="dark"] .air-datepicker-nav--title i { color: #f1f5f9; }
[data-bs-theme="dark"] .ql-toolbar.ql-snow, [data-bs-theme="dark"] .ql-container.ql-snow { border-color: #334155; }
[data-bs-theme="dark"] .ql-toolbar.ql-snow { background: #1a2436; }
[data-bs-theme="dark"] .ql-snow .ql-stroke { stroke: #cbd5e1; }
[data-bs-theme="dark"] .ql-snow .ql-fill { fill: #cbd5e1; }
[data-bs-theme="dark"] .ql-snow .ql-picker { color: #cbd5e1; }
[data-bs-theme="dark"] ::-webkit-scrollbar-track { background: #0f172a; }
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb { background: #475569; }

/* Public marketing site */
[data-bs-theme="dark"] .sn-public-nav { background: rgba(15, 23, 42, 0.92); border-color: #1e293b; }
[data-bs-theme="dark"] .sn-public-nav .nav-link { color: #cbd5e1; }
[data-bs-theme="dark"] .sn-public-nav .nav-link:hover, [data-bs-theme="dark"] .sn-public-nav .nav-link.active { color: #fff; }
[data-bs-theme="dark"] .sn-section-alt { background: #111a2e; }
[data-bs-theme="dark"] .sn-feature, [data-bs-theme="dark"] .sn-plan, [data-bs-theme="dark"] .sn-module-card,
[data-bs-theme="dark"] .sn-faq .accordion-item, [data-bs-theme="dark"] .sn-callout { background: #1e293b; border-color: #334155; }
[data-bs-theme="dark"] .sn-plan.is-featured { border-color: var(--sn-primary-light); }
[data-bs-theme="dark"] .sn-eyebrow { background: rgba(96, 165, 250, 0.14); color: #bfdbfe; }
[data-bs-theme="dark"] .sn-lead, [data-bs-theme="dark"] .sn-muted { color: #a3b1c6; }
[data-bs-theme="dark"] .sn-hero { background: radial-gradient(900px 500px at 85% -10%, rgba(99, 102, 241, 0.25), transparent 60%), radial-gradient(800px 500px at -10% 20%, rgba(37, 99, 235, 0.22), transparent 60%), #0b1222; }
[data-bs-theme="dark"] .sn-public h1, [data-bs-theme="dark"] .sn-public h2, [data-bs-theme="dark"] .sn-public h3 { color: #f1f5f9; }
[data-bs-theme="dark"] .sn-illustration .ill-surface { fill: #1e293b; }
[data-bs-theme="dark"] .sn-illustration .ill-line { fill: #334155; }

[data-bs-theme="dark"] .sn-flyout-link:focus-visible { outline-color: #93c5fd; background: #273449; } /* UX-019 */
[data-bs-theme="dark"] :focus-visible { outline-color: #93c5fd; }
[data-bs-theme="dark"] .form-control::placeholder { color: #94a3b8; }
