/* ============================================
   Modo oscuro (html[data-bs-theme="dark"])
   Complementa Bootstrap 5.3 data-bs-theme
   ============================================ */
html[data-bs-theme="dark"] {
    color-scheme: dark;
}

html[data-bs-theme="dark"] body {
    background: #12151a !important;
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] .login-navbar {
    background: linear-gradient(135deg, #0f1419 0%, #0a0d11 100%) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.4) !important;
}

html[data-bs-theme="dark"] .login-navbar-logo {
    background: rgba(255, 255, 255, 0.06) !important;
}

html[data-bs-theme="dark"] .login-container {
    background: #0d0f12 !important;
}

html[data-bs-theme="dark"] .login-container::before {
    opacity: 0.25;
    background: radial-gradient(circle, rgba(100, 149, 237, 0.12) 1px, transparent 1px);
}

html[data-bs-theme="dark"] .login-card {
    background: #1a1f26 !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.06) !important;
}

html[data-bs-theme="dark"] .login-card h2 {
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] .login-card .login-card-heading {
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] #login-section .bg-light {
    background-color: #252b35 !important;
    border-color: #3d4654 !important;
    color: #cfd6de !important;
}

html[data-bs-theme="dark"] .dashboard-header {
    background: #0f1419 !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45) !important;
}

html[data-bs-theme="dark"] .logo,
html[data-bs-theme="dark"] .subtitle {
    color: #fff !important;
}

html[data-bs-theme="dark"] .user-info {
    color: #e0e4ea !important;
}

html[data-bs-theme="dark"] .tabs-nav {
    background: #1a1f26 !important;
    border-bottom-color: #2d333b !important;
}

html[data-bs-theme="dark"] .tab-btn {
    color: #9aa5b1 !important;
}

html[data-bs-theme="dark"] .tab-btn:hover {
    color: #e8eaed !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

html[data-bs-theme="dark"] .tab-btn.active {
    color: #6ea8fe !important;
    background: rgba(13, 110, 253, 0.15) !important;
    border-bottom-color: #6ea8fe !important;
}

html[data-bs-theme="dark"] .main-content {
    background: #12151a !important;
}

html[data-bs-theme="dark"] .filters-card,
html[data-bs-theme="dark"] .table-card,
html[data-bs-theme="dark"] .card:not(.login-card) {
    background: #1a1f26 !important;
    border-color: #2d333b !important;
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] .table {
    --bs-table-bg: #1a1f26;
    --bs-table-color: #e8eaed;
    border-color: #2d333b !important;
}

html[data-bs-theme="dark"] .table thead th {
    background: #222831 !important;
    color: #cfd6de !important;
    border-color: #2d333b !important;
}

html[data-bs-theme="dark"] .table tbody td {
    border-color: #2d333b !important;
}

html[data-bs-theme="dark"] .table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04) !important;
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background-color: #222831 !important;
    border-color: #3d4654 !important;
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] .form-control::placeholder {
    color: #7a8699 !important;
}

html[data-bs-theme="dark"] .form-label {
    color: #cfd6de !important;
}

html[data-bs-theme="dark"] .modal-content {
    background: #1a1f26 !important;
    color: #e8eaed !important;
    border-color: #2d333b !important;
}

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

html[data-bs-theme="dark"] .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

html[data-bs-theme="dark"] .notifications-dropdown,
html[data-bs-theme="dark"] .whatsapp-alerts-dropdown {
    background: #1a1f26 !important;
    border: 1px solid #2d333b !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
}

html[data-bs-theme="dark"] .notifications-header,
html[data-bs-theme="dark"] .whatsapp-alerts-header {
    background: #222831 !important;
    border-bottom-color: #2d333b !important;
}

html[data-bs-theme="dark"] .notifications-header h6 {
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] .notification-item,
html[data-bs-theme="dark"] .whatsapp-alerts-item {
    border-bottom-color: #2d333b !important;
}

html[data-bs-theme="dark"] .notification-item:hover,
html[data-bs-theme="dark"] .whatsapp-alerts-item:hover {
    background: #222831 !important;
}

html[data-bs-theme="dark"] .notification-expediente {
    color: #9ec5fe !important;
}

html[data-bs-theme="dark"] .notification-empty,
html[data-bs-theme="dark"] .whatsapp-alerts-empty {
    color: #9aa5b1 !important;
}

html[data-bs-theme="dark"] .flatpickr-calendar {
    background: #1a1f26 !important;
    border-color: #2d333b !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

html[data-bs-theme="dark"] .flatpickr-day {
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] .flatpickr-day:hover {
    background: #2d333b !important;
}

html[data-bs-theme="dark"] .flatpickr-day.selected {
    background: #0d6efd !important;
    border-color: #0d6efd !important;
}

html[data-bs-theme="dark"] .flatpickr-current-month .flatpickr-monthDropdown-months,
html[data-bs-theme="dark"] .flatpickr-current-month input.cur-year {
    background: #222831 !important;
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] .text-muted {
    color: #9aa5b1 !important;
}

html[data-bs-theme="dark"] .list-group-item {
    background: #1a1f26 !important;
    border-color: #2d333b !important;
    color: #e8eaed !important;
}

/* --- Agenda: cajas de movimientos / eventos (agenda.css usa fondo blanco) --- */
html[data-bs-theme="dark"] .agenda-item {
    background: #1e242d !important;
    border-color: #3d4654 !important;
    color: #e8eaed !important;
    box-shadow: none !important;
}

html[data-bs-theme="dark"] .agenda-item:hover {
    background: #252b35 !important;
    border-color: #4a5568 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
}

html[data-bs-theme="dark"] .agenda-item-pinned {
    background: #2a2418 !important;
    border-color: #6b4e16 !important;
    border-left-color: #f59e0b !important;
}

html[data-bs-theme="dark"] .agenda-item-pinned:hover {
    background: #332a1c !important;
}

html[data-bs-theme="dark"] .agenda-item-title {
    color: #f1f3f5 !important;
}

html[data-bs-theme="dark"] .agenda-item-time {
    color: #f1f3f5 !important;
}

html[data-bs-theme="dark"] .agenda-item-title-strong {
    color: #f1f3f5 !important;
}

html[data-bs-theme="dark"] .agenda-item-sub {
    color: #aeb6bf !important;
}

html[data-bs-theme="dark"] .agenda-item-lawyer {
    color: #cfd6de !important;
}

html[data-bs-theme="dark"] .agenda-sort-inline-label,
html[data-bs-theme="dark"] .agenda-sort-trigger {
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] .agenda-sort-menu {
    background: #1e242d !important;
    border-color: #3d4654 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
}

html[data-bs-theme="dark"] .agenda-sort-option {
    color: #e8eaed !important;
    border-bottom-color: #2d333b !important;
}

html[data-bs-theme="dark"] .agenda-sort-option:hover {
    background: #252b35 !important;
}

html[data-bs-theme="dark"] .agenda-sort-option.is-active {
    color: #6ea8fe !important;
    border-left-color: #6ea8fe !important;
    background: #1e242d !important;
}

html[data-bs-theme="dark"] .agenda-pagination {
    border-top-color: #3d4654 !important;
}

html[data-bs-theme="dark"] .agenda-item-expediente {
    color: #9aa5b1 !important;
}

html[data-bs-theme="dark"] .agenda-item-caratula,
html[data-bs-theme="dark"] .agenda-item-damnificado {
    color: #aeb6bf !important;
}

html[data-bs-theme="dark"] .agenda-item-body {
    color: #cfd6de !important;
}

html[data-bs-theme="dark"] .agenda-item-vencimiento {
    color: #ff8a8a !important;
}

html[data-bs-theme="dark"] .agenda-item-vencimiento.proximo {
    color: #ffd666 !important;
}

html[data-bs-theme="dark"] .agenda-item-acciones button {
    color: #9aa5b1 !important;
}

html[data-bs-theme="dark"] .agenda-item-acciones button:hover {
    color: #e8eaed !important;
}

/* Botones outline dentro de la tarjeta de agenda */
html[data-bs-theme="dark"] .agenda-item .btn-outline-warning {
    color: #fbbf24 !important;
    border-color: rgba(251, 191, 36, 0.55) !important;
}

html[data-bs-theme="dark"] .agenda-item .btn-outline-warning:hover {
    background: rgba(251, 191, 36, 0.15) !important;
    color: #fde68a !important;
}

html[data-bs-theme="dark"] .agenda-item .btn-outline-info {
    color: #7dd3fc !important;
    border-color: rgba(125, 211, 252, 0.5) !important;
}

html[data-bs-theme="dark"] .agenda-item .btn-outline-info:hover {
    background: rgba(125, 211, 252, 0.12) !important;
    color: #bae6fd !important;
}

/* --- Expedientes: panel de filtros (card-header bg-white + body con gradiente claro) --- */
html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-card.card {
    background: #1e242d !important;
    border-color: #3d4654 !important;
    color: #e8eaed !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35) !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-toolbar,
html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-card > .card-header {
    background: #222831 !important;
    background-color: #222831 !important;
    border-bottom-color: #3d4654 !important;
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-toolbar.bg-white {
    background: #222831 !important;
    background-color: #222831 !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-title {
    color: #f1f3f5 !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-subtitle {
    color: #9aa5b1 !important;
    opacity: 1 !important;
}

html[data-bs-theme="dark"] #tab-expedientes .btn-expedientes-filtros-toggle:hover,
html[data-bs-theme="dark"] #tab-expedientes .btn-expedientes-filtros-toggle:focus {
    background: rgba(110, 168, 254, 0.12) !important;
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-chevron-wrap {
    background: linear-gradient(145deg, rgba(110, 168, 254, 0.28), rgba(110, 168, 254, 0.1)) !important;
    color: #9ec5fe !important;
}

html[data-bs-theme="dark"] #tab-expedientes .btn-expedientes-filtros-toggle:hover .expedientes-filtros-chevron-wrap {
    background: linear-gradient(145deg, rgba(110, 168, 254, 0.38), rgba(110, 168, 254, 0.16)) !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-body {
    background: linear-gradient(180deg, #252b35 0%, #1e242d 55%, #1a1f26 100%) !important;
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-label {
    color: #cfd6de !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-section-title {
    color: #f1f3f5 !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-hint {
    color: #9aa5b1 !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-hint strong {
    color: #cfe2ff !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-advanced {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.2) 0%, rgba(13, 110, 253, 0.06) 100%) !important;
    border-color: rgba(110, 168, 254, 0.28) !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-card .dropdown-menu {
    background: #222831 !important;
    border: 1px solid #3d4654 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-card .dropdown-item {
    color: #e8eaed !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-card .dropdown-item:hover,
html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-card .dropdown-item:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #fff !important;
}

html[data-bs-theme="dark"] #tab-expedientes .expedientes-filtros-card .dropdown-divider {
    border-top-color: #3d4654 !important;
}
