/* Dark theme overrides for NiceAdmin + feature pages.
   Activated via html[data-bs-theme="dark"]. Print styles stay light. */

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

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

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

[data-bs-theme="dark"] a:hover {
  color: #a5b4fc;
}

[data-bs-theme="dark"] #main {
  background: #0b1220;
}

[data-bs-theme="dark"] .pagetitle h1 {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .back-to-top {
  background: #4154f1;
}

/* Cards */
[data-bs-theme="dark"] .card {
  background-color: #162032;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.35);
  color: #e2e8f0;
}

[data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .card-footer {
  background-color: #162032;
  border-color: #2a3548;
  color: #94a3b8;
}

[data-bs-theme="dark"] .card-title {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .card-title span {
  color: #94a3b8;
}

/* Dashboard info cards (Tasas, Ventas, Clientes, etc.) */
[data-bs-theme="dark"] .dashboard .info-card h6 {
  color: #ffffff;
}

[data-bs-theme="dark"] .dashboard .filter .icon {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .dashboard .filter .icon:hover,
[data-bs-theme="dark"] .dashboard .filter .icon:focus {
  color: #ffffff;
}

[data-bs-theme="dark"] .dashboard .revenue-card .card-icon {
  color: #8b9cff;
  background: rgba(65, 84, 241, 0.2);
}

[data-bs-theme="dark"] .dashboard .sales-card .card-icon {
  background: rgba(46, 202, 106, 0.15);
}

[data-bs-theme="dark"] .dashboard .customers-card .card-icon {
  background: rgba(255, 119, 29, 0.15);
}

[data-bs-theme="dark"] .card-img-overlay {
  background-color: rgba(11, 18, 32, 0.55);
}

/* Dropdowns */
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #162032;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.45);
  color: #e2e8f0;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-item {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-menu .dropdown-item:focus {
  background-color: #1a2332;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-footer a {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .dropdown-divider {
  border-color: #2a3548;
}

@media (min-width: 768px) {
  [data-bs-theme="dark"] .dropdown-menu-arrow::before {
    background: #162032;
    border-top-color: #2a3548;
    border-left-color: #2a3548;
  }
}

/* Accordion / tabs / breadcrumb */
[data-bs-theme="dark"] .accordion-item {
  border-color: #2a3548;
  background-color: #162032;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
  color: #e2e8f0;
  background-color: #1a2332;
}

[data-bs-theme="dark"] .accordion-flush .accordion-body {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .nav-tabs-bordered {
  border-bottom-color: #2a3548;
}

[data-bs-theme="dark"] .nav-tabs-bordered .nav-link {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .nav-tabs-bordered .nav-link.active {
  background-color: #162032;
  color: #8b9cff;
}

[data-bs-theme="dark"] .breadcrumb,
[data-bs-theme="dark"] .breadcrumb a {
  color: #94a3b8;
}

[data-bs-theme="dark"] .breadcrumb .active {
  color: #cbd5e1;
}

/* Header */
[data-bs-theme="dark"] .logo span {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .header {
  background-color: #162032;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .header .toggle-sidebar-btn {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .header .search-bar {
  background: #162032;
}

[data-bs-theme="dark"] .header .search-form input {
  color: #e2e8f0;
  background-color: #1a2332;
  border-color: rgba(148, 163, 184, 0.35);
}

[data-bs-theme="dark"] .header .search-form button i {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .header-nav .nav-icon,
[data-bs-theme="dark"] .header-nav .nav-profile {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .header-nav .theme-toggle-item {
  border-right-color: rgba(148, 163, 184, 0.25);
}

[data-bs-theme="dark"] .header-nav .notifications .notification-item:hover,
[data-bs-theme="dark"] .header-nav .messages .message-item:hover,
[data-bs-theme="dark"] .header-nav .profile .dropdown-item:hover {
  background-color: #1a2332;
}

[data-bs-theme="dark"] .header-nav .messages .message-item h4,
[data-bs-theme="dark"] .header-nav .profile .dropdown-header h6 {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .header-nav .notifications .notification-item p,
[data-bs-theme="dark"] .header-nav .messages .message-item p {
  color: #94a3b8;
}

/* Sidebar */
[data-bs-theme="dark"] .sidebar {
  background-color: #162032;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.35);
  scrollbar-color: #475569 transparent;
}

[data-bs-theme="dark"] .sidebar::-webkit-scrollbar {
  background-color: #162032;
}

[data-bs-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
  background-color: #475569;
}

[data-bs-theme="dark"] .sidebar-nav .nav-heading {
  color: #94a3b8;
}

[data-bs-theme="dark"] .sidebar-nav .nav-link {
  color: #ffffff;
  background: #1a2332;
}

[data-bs-theme="dark"] .sidebar-nav .nav-link i {
  color: #ffffff;
}

[data-bs-theme="dark"] .sidebar-nav .nav-link.collapsed {
  color: #ffffff;
  background: transparent;
}

[data-bs-theme="dark"] .sidebar-nav .nav-link.collapsed i {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .sidebar-nav .nav-link:hover {
  color: #ffffff;
  background: #1a2332;
}

[data-bs-theme="dark"] .sidebar-nav .nav-link:hover i {
  color: #ffffff;
}

[data-bs-theme="dark"] .sidebar-nav .nav-content a {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .sidebar-nav .nav-content a:hover,
[data-bs-theme="dark"] .sidebar-nav .nav-content a.active {
  color: #ffffff;
}

[data-bs-theme="dark"] .sidebar-nav .nav-content a.active i {
  background-color: #ffffff;
}

/* Footer */
[data-bs-theme="dark"] .footer {
  background-color: #0b1220;
  color: #94a3b8;
  border-top-color: #2a3548;
}

[data-bs-theme="dark"] .footer .copyright {
  color: #94a3b8;
}

/* Forms */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select {
  background-color: #1a2332;
  border-color: #2a3548;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #1a2332;
  border-color: #4154f1;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.2rem rgba(65, 84, 241, 0.25);
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #64748b;
}

[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] label {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .input-group-text {
  background-color: #1a2332;
  border-color: #2a3548;
  color: #cbd5e1;
}

[data-bs-theme="dark"] .form-check-input {
  background-color: #1a2332;
  border-color: #475569;
}

/* Tables */
[data-bs-theme="dark"] table,
[data-bs-theme="dark"] .table {
  color: #e2e8f0;
  --bs-table-bg: transparent;
  --bs-table-color: #e2e8f0;
  --bs-table-border-color: #2a3548;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(65, 84, 241, 0.12);
}

[data-bs-theme="dark"] .table > :not(caption) > * > * {
  border-bottom-color: #2a3548;
  color: #e2e8f0;
}

[data-bs-theme="dark"] table.dataTable tbody tr,
[data-bs-theme="dark"] table.dataTable.stripe tbody tr.odd,
[data-bs-theme="dark"] table.dataTable.display tbody tr.odd {
  background-color: #162032;
}

[data-bs-theme="dark"] table.dataTable.stripe tbody tr.even,
[data-bs-theme="dark"] table.dataTable.display tbody tr.even {
  background-color: #1a2332;
}

[data-bs-theme="dark"] table.dataTable tbody tr:hover,
[data-bs-theme="dark"] table.dataTable.hover tbody tr:hover,
[data-bs-theme="dark"] table.dataTable.display tbody tr:hover {
  background-color: rgba(65, 84, 241, 0.15) !important;
}

[data-bs-theme="dark"] table.dataTable thead th,
[data-bs-theme="dark"] table.dataTable thead td {
  border-bottom-color: #2a3548;
  color: #e2e8f0;
}

[data-bs-theme="dark"] table.dataTable.no-footer {
  border-bottom-color: #2a3548;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button {
  color: #cbd5e1 !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: #4154f1 !important;
  border-color: #4154f1 !important;
  color: #fff !important;
}

[data-bs-theme="dark"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #1a2332 !important;
  border-color: #2a3548 !important;
  color: #e2e8f0 !important;
}

/* Modals / list groups / misc Bootstrap surfaces */
[data-bs-theme="dark"] .modal-content {
  background-color: #162032;
  color: #e2e8f0;
  border-color: #2a3548;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
  border-color: #2a3548;
}

[data-bs-theme="dark"] .list-group-item {
  background-color: #162032;
  border-color: #2a3548;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .bg-white {
  background-color: #162032 !important;
}

[data-bs-theme="dark"] .text-dark {
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .border,
[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top {
  border-color: #2a3548 !important;
}

[data-bs-theme="dark"] hr {
  border-color: #2a3548;
  opacity: 1;
}

/* Situaciones */
[data-bs-theme="dark"] .sit-page {
  --sit-ink: #e2e8f0;
  --sit-muted: #94a3b8;
  --sit-line: #2a3548;
  --sit-surface: #162032;
  --sit-soft: #1a2332;
  --sit-accent: #14b8a6;
  --sit-accent-hover: #2dd4bf;
  --sit-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .sit-group,
[data-bs-theme="dark"] .sit-card {
  background: #162032;
}

[data-bs-theme="dark"] .sit-card:hover {
  border-color: #475569;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .sit-card__desc {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .sit-field .form-control,
[data-bs-theme="dark"] .sit-field .form-select,
[data-bs-theme="dark"] .sit-col-pager__btn {
  background: #1a2332;
  border-color: #2a3548;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .sit-col-pager__btn:not(:disabled):hover {
  border-color: #2dd4bf;
  color: #2dd4bf;
}

[data-bs-theme="dark"] .sit-group__count {
  background: #2a3548;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .sit-hero__icon {
  background: rgba(20, 184, 166, 0.15);
  border-color: rgba(20, 184, 166, 0.35);
}

[data-bs-theme="dark"] .sit-btn {
  background: rgba(20, 184, 166, 0.12);
  border-color: rgba(45, 212, 191, 0.35);
  color: #2dd4bf;
}

[data-bs-theme="dark"] .sit-btn:hover {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}

[data-bs-theme="dark"] .sit-badge--type {
  background: #1a2332;
  color: #cbd5e1;
  border-color: #2a3548;
}

[data-bs-theme="dark"] .sit-stat--open,
[data-bs-theme="dark"] .sit-group--alta .sit-group__head,
[data-bs-theme="dark"] .sit-badge--priority-alta,
[data-bs-theme="dark"] .sit-badge--status-abierta {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
}

[data-bs-theme="dark"] .sit-stat--open .sit-stat__value,
[data-bs-theme="dark"] .sit-badge--priority-alta,
[data-bs-theme="dark"] .sit-badge--status-abierta {
  color: #fca5a5;
}

[data-bs-theme="dark"] .sit-group--alta .sit-group__count {
  background: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

[data-bs-theme="dark"] .sit-stat--progress,
[data-bs-theme="dark"] .sit-group--media .sit-group__head,
[data-bs-theme="dark"] .sit-badge--priority-media,
[data-bs-theme="dark"] .sit-badge--status-en-proceso {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
}

[data-bs-theme="dark"] .sit-stat--progress .sit-stat__value,
[data-bs-theme="dark"] .sit-badge--priority-media,
[data-bs-theme="dark"] .sit-badge--status-en-proceso {
  color: #fcd34d;
}

[data-bs-theme="dark"] .sit-group--media .sit-group__count {
  background: rgba(245, 158, 11, 0.35);
  color: #fde68a;
}

[data-bs-theme="dark"] .sit-group--baja .sit-group__head,
[data-bs-theme="dark"] .sit-badge--priority-baja,
[data-bs-theme="dark"] .sit-badge--status-cerrada {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
}

[data-bs-theme="dark"] .sit-badge--priority-baja,
[data-bs-theme="dark"] .sit-badge--status-cerrada {
  color: #6ee7b7;
}

[data-bs-theme="dark"] .sit-group--baja .sit-group__count {
  background: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}

[data-bs-theme="dark"] .sit-empty i {
  color: #475569;
}

[data-bs-theme="dark"] .sit-modal .btn-light {
  background: #1a2332;
  border-color: #2a3548;
  color: #e2e8f0;
}

/* Reports */
[data-bs-theme="dark"] .report-page {
  --rpt-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
  --rpt-border: rgba(148, 163, 184, 0.25);
  --rpt-text: #e2e8f0;
  --rpt-muted: #94a3b8;
  --rpt-accent: #8b9cff;
  --rpt-accent-soft: rgba(65, 84, 241, 0.2);
  --rpt-surface: #162032;
  --rpt-panel: #1a2332;
}

[data-bs-theme="dark"] .report-page .info-card.border-primary {
  border-color: rgba(139, 156, 255, 0.4) !important;
  background: linear-gradient(
    180deg,
    rgba(65, 84, 241, 0.18),
    #1a2332
  );
}

[data-bs-theme="dark"] .report-page .info-card h6,
[data-bs-theme="dark"] .report-page .info-card .card-title {
  color: #ffffff;
}

[data-bs-theme="dark"] .report-results-bar {
  background: linear-gradient(
    90deg,
    rgba(65, 84, 241, 0.18),
    rgba(26, 35, 50, 0.6)
  );
  border-color: rgba(139, 156, 255, 0.25);
}

[data-bs-theme="dark"] .report-filters__header {
  border-bottom-color: rgba(148, 163, 184, 0.25);
}

[data-bs-theme="dark"] .report-filters .form-control,
[data-bs-theme="dark"] .report-filters .form-select {
  border-color: rgba(148, 163, 184, 0.3);
  background-color: #1a2332;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .report-table-wrap .table tbody td {
  border-color: rgba(148, 163, 184, 0.2);
}

[data-bs-theme="dark"] .report-table-wrap .table tbody tr:hover {
  background: rgba(65, 84, 241, 0.12);
}

[data-bs-theme="dark"] .report-table-wrap .table-primary,
[data-bs-theme="dark"] .report-table-wrap .table-primary > th,
[data-bs-theme="dark"] .report-table-wrap .table-primary > td {
  background-color: rgba(65, 84, 241, 0.22) !important;
  color: #e2e8f0;
}

/* Operations workbench */
[data-bs-theme="dark"] .ops-page {
  --ops-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
  --ops-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.45);
  --ops-surface: #162032;
  --ops-border: rgba(148, 163, 184, 0.3);
  --ops-text: #e2e8f0;
  --ops-muted: #94a3b8;
  --ops-accent-soft: rgba(99, 102, 241, 0.22);
}

[data-bs-theme="dark"] .ops-modal {
  --ops-surface: #162032;
  --ops-border: rgba(148, 163, 184, 0.3);
  --ops-text: #e2e8f0;
  --ops-muted: #94a3b8;
  --ops-accent-soft: rgba(99, 102, 241, 0.22);
  --ops-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .ops-area-chip,
[data-bs-theme="dark"] .ops-btn-cancel,
[data-bs-theme="dark"] .ops-plan-pill {
  background: #162032;
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.3);
}

[data-bs-theme="dark"] .ops-btn-cancel:hover {
  background: #1a2332;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .ops-empty {
  background: linear-gradient(180deg, #1a2332 0%, #162032 100%);
  color: #94a3b8;
}

[data-bs-theme="dark"] .ops-search-modal__footer,
[data-bs-theme="dark"] .ops-modal .modal-footer {
  background: #1a2332;
  border-color: #2a3548;
}

[data-bs-theme="dark"] .ops-status--waiting,
[data-bs-theme="dark"] .ops-status--pending {
  background: rgba(245, 158, 11, 0.18);
  color: #fcd34d;
}

[data-bs-theme="dark"] .ops-status--billing {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
}

[data-bs-theme="dark"] .ops-status--processing {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
}

[data-bs-theme="dark"] .ops-status--done {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}

[data-bs-theme="dark"] .ops-status--truncated {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}

[data-bs-theme="dark"] .ops-status--default {
  background: rgba(148, 163, 184, 0.18);
  color: #cbd5e1;
}

/* BioDental */
[data-bs-theme="dark"] .biodental-page {
  --bd-primary-light: rgba(20, 184, 166, 0.2);
  --bd-surface: #162032;
  --bd-muted: #94a3b8;
  --bd-border: #2a3548;
  --bd-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

[data-bs-theme="dark"] .biodental-panel,
[data-bs-theme="dark"] .biodental-detail-section,
[data-bs-theme="dark"] .biodental-modal .modal-footer {
  background: #1a2332;
  border-color: #2a3548;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .biodental-stat {
  background: #162032;
  border-color: #2a3548;
}

[data-bs-theme="dark"] .biodental-stat__value {
  color: #e2e8f0;
}

[data-bs-theme="dark"] .biodental-stat--total {
  background: linear-gradient(
    135deg,
    rgba(15, 118, 110, 0.25),
    rgba(8, 145, 178, 0.2)
  );
  border-color: rgba(153, 246, 228, 0.35);
}

[data-bs-theme="dark"] .biodental-filters .form-label {
  color: #cbd5e1;
}

[data-bs-theme="dark"] .biodental-table tbody tr:hover {
  background-color: rgba(15, 118, 110, 0.15);
}

[data-bs-theme="dark"] .biodental-badge--default {
  background: #1a2332;
  color: #cbd5e1;
  border-color: #2a3548;
}

/* Login section background */
[data-bs-theme="dark"] .section.register {
  background: #0b1220;
}
