/* ===== DARK MODE - KonKorde ===== */
/* Activated via data-theme="dark" on <html> */

[data-theme="dark"] {
    /* ===== GLOBAL VARIABLES ===== */
    --sidebar-bg: #0d0f17;
    --sidebar-hover: #161926;
    --sidebar-active: #1e2235;
    --sidebar-text: #8892a8;
    --sidebar-text-active: #e2e8f0;
    --sidebar-accent: #818cf8;

    /* ===== BODY & LAYOUT ===== */
    background: #0f1117 !important;
    color: #e2e8f0;
}

[data-theme="dark"] body {
    background: #0f1117 !important;
    color: #e2e8f0;
}

/* ===== SIDEBAR ===== */
[data-theme="dark"] .sidebar {
    background: #0d0f17;
}

[data-theme="dark"] .sidebar-header {
    border-bottom-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .sidebar-header .logo-icon {
    background: #818cf8;
}

[data-theme="dark"] .sidebar-header .logo-sub {
    color: #8892a8;
}

[data-theme="dark"] .sidebar-nav .nav-section {
    color: rgba(255,255,255,0.15);
}

[data-theme="dark"] .sidebar-nav .nav-link {
    color: #8892a8;
}

[data-theme="dark"] .sidebar-nav .nav-link:hover {
    background: #161926;
    color: #e2e8f0;
}

[data-theme="dark"] .sidebar-nav .nav-link.active {
    background: #1e2235;
    color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

[data-theme="dark"] .sidebar-footer {
    border-top-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .sidebar-toggle-btn {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
}

[data-theme="dark"] .sidebar-toggle-btn:hover {
    background: rgba(255,255,255,0.08);
}

/* ===== TOPBAR ===== */
[data-theme="dark"] .topbar {
    background: #1a1d29;
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .topbar-brand {
    color: #e2e8f0;
}

[data-theme="dark"] .topbar-brand span {
    color: #818cf8;
}

[data-theme="dark"] .topbar-user {
    color: #94a3b8;
}

[data-theme="dark"] .topbar-user .avatar {
    background: #818cf8;
}

[data-theme="dark"] .topbar .menu-toggle {
    color: #e2e8f0;
}

[data-theme="dark"] .topbar .menu-toggle:hover {
    background: rgba(255,255,255,0.08);
}

/* ===== OVERLAY ===== */
[data-theme="dark"] .sidebar-overlay {
    background: rgba(0,0,0,0.7);
}

/* ===== MAIN CONTENT ===== */
[data-theme="dark"] .main-content .content-wrapper {
    color: #e2e8f0;
}

/* ===== BOOTSTRAP COMPONENTS ===== */

/* Cards */
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content {
    background: #1a1d29;
    border-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .card-header {
    background: #222636 !important;
    border-bottom-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .card-footer {
    background: #222636;
    border-top-color: #2d3348;
}

/* Tables */
[data-theme="dark"] .table {
    color: #e2e8f0;
}

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

[data-theme="dark"] .table thead th {
    background-color: #222636 !important;
    color: #94a3b8;
    border-bottom-color: #2d3348;
}

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

[data-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255,255,255,0.01);
}

[data-theme="dark"] .table-bordered,
[data-theme="dark"] .table-bordered > * {
    border-color: #2d3348;
}

/* Forms */
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select {
    background-color: #222636;
    border-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .form-control:focus,
[data-theme="dark"] .form-select:focus {
    background-color: #282c3a;
    border-color: #818cf8;
    color: #e2e8f0;
    box-shadow: 0 0 0 0.2rem rgba(129, 140, 248, 0.15);
}

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

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

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

[data-theme="dark"] .form-check-input:checked {
    background-color: #818cf8;
    border-color: #818cf8;
}

[data-theme="dark"] .input-group-text {
    background-color: #222636;
    border-color: #2d3348;
    color: #94a3b8;
}

/* Modals */
[data-theme="dark"] .modal-header {
    background: #222636;
    border-bottom-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-body {
    background: #1a1d29;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-footer {
    background: #222636;
    border-top-color: #2d3348;
}

[data-theme="dark"] .btn-close {
    filter: invert(1);
}

/* Buttons */
[data-theme="dark"] .btn-outline-secondary {
    color: #94a3b8;
    border-color: #475569;
}

[data-theme="dark"] .btn-outline-secondary:hover {
    background: #2d3348;
    color: #e2e8f0;
    border-color: #94a3b8;
}

[data-theme="dark"] .btn-outline-primary {
    color: #818cf8;
    border-color: #818cf8;
}

[data-theme="dark"] .btn-outline-primary:hover {
    background: #818cf8;
    color: #0f1117;
}

[data-theme="dark"] .btn-outline-danger {
    color: #f87171;
    border-color: #f87171;
}

[data-theme="dark"] .btn-outline-danger:hover {
    background: #f87171;
    color: #0f1117;
}

[data-theme="dark"] .btn-outline-success {
    color: #34d399;
    border-color: #34d399;
}

[data-theme="dark"] .btn-outline-success:hover {
    background: #34d399;
    color: #0f1117;
}

[data-theme="dark"] .btn-outline-warning {
    color: #fbbf24;
    border-color: #fbbf24;
}

[data-theme="dark"] .btn-outline-warning:hover {
    background: #fbbf24;
    color: #0f1117;
}

[data-theme="dark"] .btn-outline-info {
    color: #60a5fa;
    border-color: #60a5fa;
}

[data-theme="dark"] .btn-outline-info:hover {
    background: #60a5fa;
    color: #0f1117;
}

[data-theme="dark"] .btn-outline-dark {
    color: #e2e8f0;
    border-color: #475569;
}

[data-theme="dark"] .btn-outline-dark:hover {
    background: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-secondary {
    background: #2d3348;
    border-color: #475569;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-dark {
    background: #222636;
    border-color: #2d3348;
    color: #e2e8f0;
}

/* Dropdowns */
[data-theme="dark"] .dropdown-menu {
    background: #222636;
    border-color: #2d3348;
}

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

[data-theme="dark"] .dropdown-item:hover,
[data-theme="dark"] .dropdown-item:focus {
    background: #2d3348;
    color: #818cf8;
}

/* Alerts */
[data-theme="dark"] .alert-info {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}

[data-theme="dark"] .alert-warning {
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.3);
    color: #fcd34d;
}

[data-theme="dark"] .alert-danger {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .alert-success {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.3);
    color: #6ee7b7;
}

[data-theme="dark"] .alert-secondary,
[data-theme="dark"] .alert {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}

/* Badges */
[data-theme="dark"] .badge.bg-primary {
    background: rgba(129, 140, 248, 0.2) !important;
    color: #a5b4fc !important;
}

[data-theme="dark"] .badge.bg-success {
    background: rgba(52, 211, 153, 0.2) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .badge.bg-warning {
    background: rgba(251, 191, 36, 0.2) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .badge.bg-danger {
    background: rgba(248, 113, 113, 0.2) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .badge.bg-info {
    background: rgba(96, 165, 250, 0.2) !important;
    color: #93c5fd !important;
}

[data-theme="dark"] .badge.bg-secondary {
    background: rgba(148, 163, 184, 0.15) !important;
    color: #94a3b8 !important;
}

[data-theme="dark"] .badge.bg-dark {
    background: rgba(30, 34, 53, 0.8) !important;
    color: #e2e8f0 !important;
}

[data-theme="dark"] .badge.bg-purple {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #c4b5fd !important;
}

/* Pagination */
[data-theme="dark"] .page-link {
    background: #222636;
    border-color: #2d3348;
    color: #818cf8;
}

[data-theme="dark"] .page-item.active .page-link {
    background: #818cf8;
    border-color: #818cf8;
    color: #0f1117;
}

[data-theme="dark"] .page-item.disabled .page-link {
    background: #1a1d29;
    border-color: #2d3348;
    color: #475569;
}

/* Navs & Tabs */
[data-theme="dark"] .nav-tabs {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8;
    border-color: transparent;
}

[data-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #2d3348 #2d3348 transparent;
    color: #e2e8f0;
    background: #222636;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    background: #1a1d29;
    border-color: #2d3348 #2d3348 #1a1d29;
    color: #e2e8f0;
}

/* Breadcrumb */
[data-theme="dark"] .breadcrumb {
    background: transparent;
}

[data-theme="dark"] .breadcrumb-item + .breadcrumb-item::before {
    color: #475569;
}

[data-theme="dark"] .breadcrumb-item a {
    color: #818cf8;
}

/* Text utilities */
[data-theme="dark"] .text-muted {
    color: #64748b !important;
}

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

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

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

/* Background utilities */
[data-theme="dark"] .bg-light {
    background: #222636 !important;
}

[data-theme="dark"] .bg-white {
    background: #1a1d29 !important;
}

[data-theme="dark"] .bg-body {
    background: #1a1d29 !important;
}

[data-theme="dark"] .bg-body-secondary {
    background: #222636 !important;
}

[data-theme="dark"] .bg-body-tertiary {
    background: #282c3a !important;
}

[data-theme="dark"] .bg-dark {
    background: #222636 !important;
}

/* Border utilities */
[data-theme="dark"] .border {
    border-color: #2d3348 !important;
}

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

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

[data-theme="dark"] .border-start {
    border-left-color: #2d3348 !important;
}

[data-theme="dark"] .border-end {
    border-right-color: #2d3348 !important;
}

[data-theme="dark"] .border-secondary {
    border-color: #475569 !important;
}

/* Accordion */
[data-theme="dark"] .accordion-item {
    background: #1a1d29;
    border-color: #2d3348;
}

[data-theme="dark"] .accordion-button {
    background: #222636;
    color: #e2e8f0;
}

[data-theme="dark"] .accordion-button:not(.collapsed) {
    background: #282c3a;
    color: #818cf8;
}

[data-theme="dark"] .accordion-button::after {
    filter: invert(1);
}

[data-theme="dark"] .accordion-body {
    background: #1a1d29;
    color: #e2e8f0;
}

/* List group */
[data-theme="dark"] .list-group-item {
    background: #1a1d29;
    border-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .list-group-item.active {
    background: #818cf8;
    border-color: #818cf8;
    color: #0f1117;
}

/* Tooltip / Popover */
[data-theme="dark"] .tooltip-inner {
    background: #222636;
    color: #e2e8f0;
}

[data-theme="dark"] .popover {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .popover-header {
    background: #282c3a;
    border-bottom-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .popover-body {
    color: #e2e8f0;
}

/* ===== DARK MODE TOGGLE BUTTON ===== */
.dark-mode-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid #e2e8f0;
    background: transparent;
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
}

.dark-mode-toggle:hover {
    background: rgba(255,255,255,0.08);
    border-color: #818cf8;
    color: #818cf8;
    transform: rotate(30deg);
}

[data-theme="dark"] .dark-mode-toggle {
    border-color: #475569;
    color: #fbbf24;
}

[data-theme="dark"] .dark-mode-toggle:hover {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

/* ===== INDEX PAGE (Module Selector) ===== */
[data-theme="dark"] body[class] {
    background: #0f1117 !important;
}

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

[data-theme="dark"] .header {
    border-bottom-color: rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .title-section h1 {
    background: linear-gradient(120deg, #e2e8f0, #818cf8);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="dark"] .title-section p {
    color: #818cf8;
}

[data-theme="dark"] .badge-date {
    background: rgba(30, 34, 53, 0.8);
    color: #818cf8;
    border-color: rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .app-card {
    background: rgba(26, 29, 41, 0.96);
    border-color: rgba(129, 140, 248, 0.15);
    box-shadow: 0 20px 35px -12px rgba(0,0,0,0.4);
}

[data-theme="dark"] .app-card:hover {
    background: #222636;
    border-color: rgba(129, 140, 248, 0.3);
    box-shadow: 0 28px 40px -16px rgba(0,0,0,0.5);
}

[data-theme="dark"] .icon-wrapper {
    background: linear-gradient(145deg, #282c3a, #1e2235);
    color: #818cf8;
}

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

[data-theme="dark"] .app-sub {
    color: #818cf8;
}

[data-theme="dark"] .card-description {
    color: #94a3b8;
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .btn-access {
    background: #282c3a;
    color: #818cf8;
    border-color: #3b4060;
}

[data-theme="dark"] .btn-access:hover {
    background: #818cf8;
    color: #0f1117;
    border-color: #818cf8;
}

[data-theme="dark"] .info-footer {
    color: #818cf8;
    border-top-color: #2d3348;
    background: rgba(30, 34, 53, 0.7);
}

[data-theme="dark"] ::selection {
    background: rgba(129, 140, 248, 0.3);
    color: #e2e8f0;
}

/* ===== DASHBOARD MODULE ===== */
[data-theme="dark"] .dash-card {
    background: #1a1d29;
    border-color: #2d3348;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

[data-theme="dark"] .dash-card:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

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

[data-theme="dark"] .dash-card-label {
    color: #94a3b8;
}

[data-theme="dark"] .dash-chart-card {
    background: #1a1d29;
    border-color: #2d3348;
}

[data-theme="dark"] .dash-chart-card h6 {
    color: #e2e8f0;
}

[data-theme="dark"] .donut-hole {
    background: #1a1d29;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.3);
}

[data-theme="dark"] .donut-num {
    color: #e2e8f0;
}

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

[data-theme="dark"] .bar-h-label {
    color: #cbd5e1;
}

[data-theme="dark"] .bar-h-track {
    background: #222636;
}

[data-theme="dark"] .bar-h-val {
    color: #e2e8f0;
}

[data-theme="dark"] .bar-vertical-val {
    color: #e2e8f0;
}

[data-theme="dark"] .bar-vertical-track {
    background: #222636;
}

[data-theme="dark"] .bar-vertical-label {
    color: #94a3b8;
}

[data-theme="dark"] .dash-legend {
    color: #94a3b8;
}

[data-theme="dark"] .actividad-mini-item {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .actividad-mini-icon {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
}

[data-theme="dark"] .actividad-mini-body {
    color: #cbd5e1;
}

[data-theme="dark"] .actividad-mini-body strong {
    color: #e2e8f0;
}

[data-theme="dark"] .actividad-mini-body span {
    color: #94a3b8;
}

[data-theme="dark"] .actividad-mini-body small {
    color: #64748b;
}

[data-theme="dark"] .actividad-mini-time {
    color: #64748b;
}

[data-theme="dark"] .dash-mini-proyecto {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .dash-mini-proyecto:hover {
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .dash-mini-proyecto span {
    color: #e2e8f0;
}

/* ===== PROYECTOS MODULE ===== */
[data-theme="dark"] .kanban-desktop {
    background: #161926;
    border-color: #2d3348;
}

[data-theme="dark"] .kanban-toolbar {
    background: #1a1d29;
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .zoom-level {
    color: #94a3b8;
}

[data-theme="dark"] .kanban-column-header {
    background: #1a1d29;
    border-bottom-color: #2d3348;
}

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

[data-theme="dark"] .btn-add-tarea-header {
    background: rgba(255,255,255,0.02);
    border-color: #475569;
    color: #64748b;
}

[data-theme="dark"] .btn-add-tarea {
    border-color: #475569;
    color: #64748b;
}

[data-theme="dark"] .kanban-card {
    background: #222636;
    border-color: #2d3348;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

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

[data-theme="dark"] .kanban-card-completada {
    background: #1a1d29;
    border-color: #2d3348 !important;
}

[data-theme="dark"] .kanban-checkbox {
    border-color: #475569;
    background: #222636;
}

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

[data-theme="dark"] .kanban-card-desc {
    color: #94a3b8;
}

[data-theme="dark"] .kanban-card-footer {
    border-top-color: #2d3348;
}

[data-theme="dark"] .badge-baja {
    background: #2d3348;
    color: #94a3b8;
}

[data-theme="dark"] .badge-media {
    background: rgba(96, 165, 250, 0.15);
    color: #93c5fd;
}

[data-theme="dark"] .badge-alta {
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
}

[data-theme="dark"] .badge-urgente {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
}

[data-theme="dark"] .sortable-ghost {
    background: rgba(129, 140, 248, 0.1);
    border-color: rgba(129, 140, 248, 0.4);
}

[data-theme="dark"] .proyecto-dashboard {
    background: #1a1d29;
    border-color: #2d3348;
}

[data-theme="dark"] .proyecto-dashboard .dash-card {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .proyecto-dashboard .dash-seccion {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .proyecto-dashboard .dash-seccion h6 {
    color: #e2e8f0;
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .proyecto-dashboard .dash-label {
    color: #94a3b8;
}

[data-theme="dark"] .modal-tarea .tarea-seccion {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .modal-tarea .form-tarea-input {
    background: #282c3a;
    border-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .modal-tarea .form-label {
    color: #94a3b8;
}

[data-theme="dark"] .tarea-tabs .nav-link {
    color: #94a3b8;
    border-color: transparent;
}

[data-theme="dark"] .tarea-tabs .nav-link:hover {
    border-color: #2d3348;
    color: #FF6600;
}

[data-theme="dark"] .tarea-tabs .nav-link.active {
    color: #FF6600;
    border-color: #2d3348;
    border-bottom-color: #1a1d29;
    background: #1a1d29;
}

[data-theme="dark"] .actividades-list .actividad-item:hover {
    background: #2d3348 !important;
}

/* ===== CHAT MODULE ===== */
[data-theme="dark"] .chat-container {
    background: #1a1d29;
    border-color: #2d3348;
}

[data-theme="dark"] .chat-messages {
    background: #13151f;
}

[data-theme="dark"] .chat-messages::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] .chat-message-content {
    background: #222636;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

[data-theme="dark"] .chat-message-propio .chat-message-content {
    background: rgba(255, 102, 0, 0.15);
}

[data-theme="dark"] .chat-message-usuario {
    color: #cbd5e1;
}

[data-theme="dark"] .chat-message-fecha {
    color: #64748b;
}

[data-theme="dark"] .chat-message-text {
    color: #e2e8f0;
}

[data-theme="dark"] .chat-message-sistema {
    background: #222636;
    color: #94a3b8;
}

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

[data-theme="dark"] .chat-input {
    border-top-color: #2d3348;
    background: #1a1d29;
}

[data-theme="dark"] .chat-input .form-control {
    background: #222636;
    border-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .chat-input .form-control:focus {
    border-color: #FF6600;
    box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.15);
}

[data-theme="dark"] .chat-date-separator {
    color: #64748b;
}

[data-theme="dark"] .chat-date-separator::before,
[data-theme="dark"] .chat-date-separator::after {
    background: #2d3348;
}

[data-theme="dark"] .chat-evento-contexto {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .chat-sidebar {
    background: #1a1d29;
    border-color: #2d3348;
}

[data-theme="dark"] .chat-sidebar-titulo {
    color: #94a3b8;
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .chat-canal-item {
    color: #cbd5e1;
}

[data-theme="dark"] .chat-canal-item:hover {
    background: rgba(255, 102, 0, 0.08);
    color: #FF6600;
}

[data-theme="dark"] .chat-header {
    background: #1a1d29;
    border-bottom-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .btn-chat-fondo {
    background: #2d3348;
    color: #94a3b8;
}

[data-theme="dark"] .btn-chat-adjunto {
    background: #2d3348;
    color: #94a3b8;
}

[data-theme="dark"] .chat-fondo-muestra {
    border-color: #2d3348;
}

[data-theme="dark"] .chat-adjunto-link {
    background: #222636;
    border-color: #2d3348;
    color: #cbd5e1;
}

[data-theme="dark"] .chat-adjunto-audio {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .chat-emoji-panel {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .chat-emoji-cat {
    color: #64748b;
}

[data-theme="dark"] .chat-sidebar-buscar {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .chat-buscar-resultados {
    background: #222636;
    border-color: #2d3348;
}

[data-theme="dark"] .chat-buscar-item {
    color: #e2e8f0;
}

[data-theme="dark"] .chat-buscar-item-texto {
    color: #94a3b8;
}

[data-theme="dark"] .chat-sidebar-filtros {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .chat-filtro-btn {
    border-color: #475569;
    background: #222636;
    color: #94a3b8;
}

[data-theme="dark"] .buscar-modo-btn {
    border-color: #475569;
    background: #222636;
    color: #94a3b8;
}

[data-theme="dark"] .chat-grabando {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

[data-theme="dark"] .chat-layout:fullscreen {
    background: #0f1117;
}

/* ===== CALENDAR MODULE ===== */
[data-theme="dark"] .cal-grid-wrapper {
    border-color: #2d3348;
    background: #1a1d29;
}

[data-theme="dark"] .cal-grid {
    background: #1a1d29;
}

[data-theme="dark"] .cal-dia-nombre {
    background: #222636;
    border-bottom-color: #2d3348;
    border-right-color: #2d3348;
    color: #94a3b8;
}

[data-theme="dark"] .cal-cell {
    border-right-color: #2d3348;
    border-bottom-color: #2d3348;
    background: #1a1d29;
}

[data-theme="dark"] .cal-cell:hover {
    background: #222636;
}

[data-theme="dark"] .cal-cell.cal-fuera-mes {
    background: #161926;
}

[data-theme="dark"] .cal-cell.cal-fuera-mes .cal-num-dia {
    color: #475569;
}

[data-theme="dark"] .cal-cell.cal-hoy {
    background: rgba(255, 102, 0, 0.08);
}

[data-theme="dark"] .cal-num-dia {
    color: #cbd5e1;
}

[data-theme="dark"] .cal-btn-add {
    color: #64748b;
}

[data-theme="dark"] .cal-chip {
    background: #2d3348;
    color: #cbd5e1;
}

[data-theme="dark"] .cal-chip:hover {
    background: #3b4060;
    color: #e2e8f0;
}

[data-theme="dark"] .cal-agenda-dia {
    border-color: #2d3348;
    background: #1a1d29;
}

[data-theme="dark"] .cal-agenda-fecha {
    background: #222636;
    border-bottom-color: #2d3348;
    color: #94a3b8;
}

[data-theme="dark"] .cal-agenda-fila {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .cal-agenda-fila.cal-fila-vencida {
    background: rgba(248, 113, 113, 0.08);
}

[data-theme="dark"] .cal-agenda-titulo {
    color: #e2e8f0;
}

[data-theme="dark"] .cal-lectura-desc {
    color: #94a3b8;
    background: #222636;
}

[data-theme="dark"] .cal-cell.cal-drop-target {
    background: rgba(255, 102, 0, 0.1) !important;
}

[data-theme="dark"] .cal-filtros .form-select,
[data-theme="dark"] .cal-filtros .form-control {
    background-color: #222636;
    border-color: #2d3348;
    color: #e2e8f0;
}

/* ===== CONTABILIDAD COBROS MODULE ===== */
[data-theme="dark"] .cobros-container {
    background: #0f1117;
    color: #e2e8f0;
}

[data-theme="dark"] .cobros-container .card {
    border-color: #2d3348;
}

[data-theme="dark"] .cobros-container .card-header {
    background-color: #2563eb !important;
}

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

[data-theme="dark"] .cobros-container .form-group label {
    color: #cbd5e1;
}

[data-theme="dark"] .cobros-loading {
    border-color: #2d3348;
}

[data-theme="dark"] .close {
    background-color: rgba(255,255,255,0.08);
    color: #94a3b8;
}

[data-theme="dark"] .badge-pendiente {
    background-color: rgba(251, 191, 36, 0.2);
    color: #fcd34d;
}

[data-theme="dark"] .badge-verificado {
    background-color: rgba(96, 165, 250, 0.2);
    color: #93c5fd;
}

[data-theme="dark"] .badge-aplicado {
    background-color: rgba(52, 211, 153, 0.2);
    color: #6ee7b7;
}

/* ===== RESERVAS MODULE ===== */
[data-theme="dark"] .table-responsive-custom {
    background-color: #1a1d29;
}

[data-theme="dark"] .table-responsive-vertical tbody tr {
    background-color: #1a1d29;
    border-color: #f37021;
}

[data-theme="dark"] .table-responsive-vertical tbody td::before {
    color: #94a3b8;
}

[data-theme="dark"] .table-responsive-vertical tbody td {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .table-responsive-vertical tbody td:last-child {
    background-color: #222636;
}

/* ===== CLIENTES RESERVAS MODULE ===== */
[data-theme="dark"] .card-custom {
    border-color: rgba(255, 102, 0, 0.2);
}

[data-theme="dark"] #modalHistorial .table th {
    background: #222636;
}

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

/* ===== CLIENTES / VEHICULOS / USUARIOS TABLE MODULES ===== */
[data-theme="dark"] .table-custom tr {
    border-color: #2d3348;
    background-color: #1a1d29;
}

[data-theme="dark"] .table-custom td {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .table-custom td::before {
    color: #64748b;
}

[data-theme="dark"] .table-custom td.action-cell {
    background-color: #222636;
}

[data-theme="dark"] textarea.form-control {
    min-height: 80px;
}

/* ===== DOCUMENTOS RESERVAS MODULE ===== */
[data-theme="dark"] .doc-card {
    border-color: #2d3348;
    background: #1a1d29;
}

[data-theme="dark"] .doc-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

[data-theme="dark"] .doc-card .card-img-top {
    background: #222636;
}

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

[data-theme="dark"] .doc-card .card-footer {
    background: #222636;
    border-top-color: #2d3348;
}

/* ===== RH VACACIONES MODULE ===== */
[data-theme="dark"] .table-responsive {
    border-color: #2d3348;
}

[data-theme="dark"] .font-monospace {
    color: #e2e8f0;
}

/* ===== ESTADISTICAS COBRO MODULE ===== */
[data-theme="dark"] .custom-card-dashboard {
    border-color: #2d3348 !important;
    background: #1a1d29;
}

[data-theme="dark"] .table tbody tr.rango-verde {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #6ee7b7 !important;
}

[data-theme="dark"] .table tbody tr.rango-naranja {
    background-color: rgba(251, 191, 36, 0.15) !important;
    color: #fcd34d !important;
}

[data-theme="dark"] .table tbody tr.rango-rojo-claro {
    background-color: rgba(248, 113, 113, 0.15) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .table tbody tr.rango-rojo-fuego {
    background-color: rgba(239, 68, 68, 0.3) !important;
    color: #fca5a5 !important;
}

[data-theme="dark"] .table tbody tr.rango-rojo-amarillento {
    background-color: rgba(255, 128, 0, 0.2) !important;
    color: #fdba74 !important;
}

/* ===== LOGIN MODULE (already dark-ish, minor tweaks) ===== */
[data-theme="dark"] .login-page {
    background:
        radial-gradient(1100px 600px at 8% -10%, rgba(15, 52, 96, 0.85) 0%, transparent 60%),
        radial-gradient(900px 500px at 110% 115%, rgba(226, 87, 30, 0.35) 0%, transparent 55%),
        linear-gradient(135deg, #0a0b12 0%, #0d0f17 55%, #111328 100%);
}

[data-theme="dark"] .login-card {
    background: #1a1d29;
}

[data-theme="dark"] .login-form-inner h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .login-field input {
    background: #222636;
    border-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .login-field input:focus {
    background: #282c3a;
}

[data-theme="dark"] .login-error {
    background: rgba(248, 113, 113, 0.1);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

/* ===== SCROLLBAR STYLING ===== */
[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: #1a1d29;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #2d3348;
    border-radius: 4px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

[data-theme="dark"] * {
    scrollbar-width: thin;
    scrollbar-color: #2d3348 #1a1d29;
}

/* ===== RESPONSIVE TABLES (shared across modules) ===== */
[data-theme="dark"] .table-responsive-vertical tbody td {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .table-responsive-vertical tbody tr {
    background-color: #1a1d29;
}

[data-theme="dark"] .table-responsive-vertical tbody td:last-child {
    background-color: #222636;
}

/* ===== DASHBOARD INLINE BAR FILLS (override inline background) ===== */
[data-theme="dark"] .bar-vertical-fill,
[data-theme="dark"] .bar-h-fill {
    filter: brightness(1.1);
}

/* ===== TRANSITIONS ===== */
[data-theme="dark"] .sidebar,
[data-theme="dark"] .topbar,
[data-theme="dark"] .main-content,
[data-theme="dark"] .card,
[data-theme="dark"] .kanban-card,
[data-theme="dark"] .chat-container,
[data-theme="dark"] .cal-grid-wrapper {
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

/* ===== NOTIFICATIONS (DARK MODE) ===== */
[data-theme="dark"] .notif-trigger {
    border-color: #475569;
    color: #94a3b8;
}

[data-theme="dark"] .notif-trigger:hover {
    border-color: #818cf8;
    color: #818cf8;
    background: rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .notif-panel {
    background: #1a1d29;
    border-color: #2d3348;
    box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

[data-theme="dark"] .notif-panel-header {
    border-bottom-color: #2d3348;
    color: #e2e8f0;
}

[data-theme="dark"] .notif-mark-all {
    color: #818cf8;
}

[data-theme="dark"] .notif-mark-all:hover {
    background: rgba(129, 140, 248, 0.15);
}

[data-theme="dark"] .notif-list::-webkit-scrollbar-thumb {
    background: #475569;
}

[data-theme="dark"] .notif-empty {
    color: #64748b;
}

[data-theme="dark"] .notif-item {
    border-bottom-color: #2d3348;
}

[data-theme="dark"] .notif-item:hover {
    background: rgba(255,255,255,0.03);
}

[data-theme="dark"] .notif-item-nueva {
    background: rgba(129, 140, 248, 0.08);
}

[data-theme="dark"] .notif-item-nueva:hover {
    background: rgba(129, 140, 248, 0.12);
}

[data-theme="dark"] .notif-item-icon {
    background: rgba(129, 140, 248, 0.15);
    color: #818cf8;
}

[data-theme="dark"] .notif-item-titulo {
    color: #e2e8f0;
}

[data-theme="dark"] .notif-item-detalle {
    color: #94a3b8;
}

[data-theme="dark"] .notif-item-fecha {
    color: #64748b;
}
