/**
 * ConectaTempo — Tema claro / oscuro global (toggle en barra superior).
 * Paleta oscura alineada con mockup: navy #050912, cards glass, acento teal/cyan.
 */

html[data-kw-theme="light"] {
    color-scheme: light;
}

html[data-kw-theme="dark"] {
    color-scheme: dark;

    /* Tokens oscuros — jerarquía de superficies (mockup glass) */
    --saas-sidebar-bg: #0b141d;
    --saas-sidebar-border: rgba(255, 255, 255, 0.08);
    --saas-sidebar-text: #cbd5e1;
    --saas-sidebar-hover-bg: rgba(38, 50, 72, 0.55);
    --saas-main-bg: #0c1829;
    --saas-surface: rgba(18, 28, 46, 0.96);
    --saas-text: #e8edf5;
    --saas-border-table: rgba(255, 255, 255, 0.1);
    --saas-primary: #4fc3f7;
    --saas-primary-hover: #29b6f6;
    --saas-primary-light: rgba(79, 195, 247, 0.16);
    --kw-topbar-text: #f8fafc;
    --kw-topbar-muted: #94a3b8;
    --kw-accent: #4fc3f7;
    --kw-accent-soft: #67e8f9;
    --kw-bg-deep: #0c1829;
    --kw-bg-mid: rgba(16, 28, 48, 0.52);
    --kw-bg-panel: rgba(20, 32, 54, 0.62);
    --kw-bg-raised: rgba(38, 50, 72, 0.42);
    --kw-bg-inset: rgba(6, 12, 22, 0.92);
    --kw-line-faint: rgba(255, 255, 255, 0.06);
    --kw-line-soft: rgba(255, 255, 255, 0.1);
    --kw-line-bright: rgba(255, 255, 255, 0.16);
    --kw-card-bg: linear-gradient(180deg, rgba(42, 54, 78, 0.55) 0%, rgba(22, 32, 52, 0.96) 38%, rgba(10, 18, 32, 0.99) 100%);
    --kw-card-border: rgba(255, 255, 255, 0.12);
    --kw-card-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.1);
    --kw-card-shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
    --kw-btn-primary-start: #29b6f6;
    --kw-btn-primary-mid: #1565c0;
    --kw-btn-primary-end: #0d47a1;
    --kw-btn-primary-border: rgba(79, 195, 247, 0.5);
    --kw-btn-primary-text: #ffffff;
    --kw-btn-shadow: 0 4px 22px rgba(41, 182, 246, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    --kw-btn-shadow-active: 0 2px 12px rgba(41, 182, 246, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    --bg-primary: #050912;
    --bg-white: rgba(22, 32, 52, 0.96);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-dark: #e8edf5;
    --text-medium: #cbd5e1;
    --text-light: #94a3b8;
    --hover-bg: rgba(38, 50, 72, 0.55);
}

/* ---------- Base ---------- */

html[data-kw-theme="dark"] body {
    color: var(--saas-text);
    background: var(--saas-main-bg);
}

html[data-kw-theme="dark"] body.auth-layout {
    position: relative;
    background: var(--kw-bg-deep);
    color: var(--saas-text);
    overflow: auto;
}

html[data-kw-theme="dark"] body.auth-layout .auth-card,
html[data-kw-theme="dark"] body.auth-layout > div {
    position: relative;
}

html[data-kw-theme="dark"] .auth-layout .auth-card {
    background: var(--kw-card-bg);
    border-color: var(--kw-card-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    color: var(--saas-text);
}

html[data-kw-theme="dark"] .auth-layout .auth-brand,
html[data-kw-theme="dark"] .auth-layout .auth-sub,
html[data-kw-theme="dark"] .auth-layout .auth-links a {
    color: var(--saas-text);
}

html[data-kw-theme="dark"] .auth-layout .auth-sub {
    color: var(--kw-topbar-muted);
}

html[data-kw-theme="dark"] .auth-layout .form-control,
html[data-kw-theme="dark"] .auth-layout .form-select {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
}

/* ---------- Sidebar — borde fino luminoso ---------- */

html[data-kw-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #0e1929 0%, #0b141d 100%);
    border-right: none;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.04);
}

html[data-kw-theme="dark"] .sidebar::after {
    content: "";
    position: absolute;
    top: 8%;
    right: 0;
    width: 1px;
    height: 84%;
    pointer-events: none;
    z-index: 2;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(79, 195, 247, 0.15) 12%,
        rgba(79, 195, 247, 0.55) 38%,
        rgba(59, 130, 246, 0.45) 62%,
        rgba(79, 195, 247, 0.2) 88%,
        transparent 100%
    );
    opacity: 0.75;
}

html[data-kw-theme="dark"] .sidebar-nav-section {
    border-top-color: rgba(255, 255, 255, 0.06);
}

html[data-kw-theme="dark"] .sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-kw-theme="dark"] .sidebar-link-logout {
    border-top-color: rgba(255, 255, 255, 0.06);
}

html[data-kw-theme="dark"] .sidebar-title,
html[data-kw-theme="dark"] .sidebar-section-title,
html[data-kw-theme="dark"] .sidebar-nav-link,
html[data-kw-theme="dark"] .sidebar-link-logout {
    color: var(--saas-sidebar-text);
}

html[data-kw-theme="dark"] .sidebar-nav-link:hover {
    background: var(--saas-sidebar-hover-bg);
    color: #f8fafc;
}

html[data-kw-theme="dark"] .sidebar-nav-link.is-active {
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.22) 0%, rgba(37, 99, 235, 0.38) 100%);
    border: 1px solid rgba(79, 195, 247, 0.32);
    box-shadow: inset 3px 0 0 #4fc3f7, 0 0 20px rgba(79, 195, 247, 0.16);
    color: #f8fafc;
    font-weight: 600;
}

html[data-kw-theme="dark"] .sidebar-nav-link.is-active .sidebar-icon {
    color: var(--kw-accent-soft);
    background: rgba(34, 211, 238, 0.12);
}

html[data-kw-theme="dark"] .sidebar-nav-link:hover .sidebar-icon {
    color: var(--kw-accent-soft);
}

html[data-kw-theme="dark"] .sidebar-icon {
    color: #94a3b8;
}

html[data-kw-theme="dark"] body.sidebar-collapsed .sidebar-nav-link.is-active .sidebar-icon {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.25) 0%, rgba(59, 130, 246, 0.35) 100%);
    color: #f8fafc;
}

html[data-kw-theme="dark"] body[data-role="empleado"] .sidebar,
html[data-kw-theme="dark"] body[data-role="worker"] .sidebar,
html[data-kw-theme="dark"] body[data-role="oficina"] .sidebar {
    background: #0f1623;
}

html[data-kw-theme="dark"] body[data-role="empleado"] .sidebar-nav-link.is-active,
html[data-kw-theme="dark"] body[data-role="worker"] .sidebar-nav-link.is-active,
html[data-kw-theme="dark"] body[data-role="oficina"] .sidebar-nav-link.is-active {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.22) 0%, rgba(59, 130, 246, 0.38) 100%);
    color: #f8fafc;
}

/* ---------- Contenido principal ----------
   Movimiento SOLO en .content (no scroll). El scroll va en .main-scroll-region
   sin animaciones ni fondos complejos → fluidez total. */

html[data-kw-theme="dark"] .content {
    position: relative;
    background: var(--kw-bg-deep);
    overflow: hidden;
}

/* Capa decorativa estática (no se repinta al hacer scroll) */
html[data-kw-theme="dark"] .content::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(79, 195, 247, 0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 195, 247, 0.018) 1px, transparent 1px),
        radial-gradient(ellipse 72% 48% at 10% 0%, rgba(41, 182, 246, 0.1) 0%, transparent 58%),
        radial-gradient(ellipse 58% 42% at 96% 100%, rgba(99, 102, 241, 0.07) 0%, transparent 52%),
        linear-gradient(165deg, #0f1f35 0%, #0c1829 50%, #0a1525 100%);
    background-size: 80px 80px, 80px 80px, 100% 100%, 100% 100%, 100% 100%;
}

/* Pulso suave de luz (solo opacity = barato para la GPU) */
html[data-kw-theme="dark"] .content::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 45% 38% at 72% 18%, rgba(41, 182, 246, 0.14) 0%, transparent 62%),
        radial-gradient(ellipse 40% 35% at 22% 82%, rgba(99, 102, 241, 0.1) 0%, transparent 58%);
    opacity: 0.45;
    animation: kw-ambient-pulse 22s ease-in-out infinite alternate;
}

@keyframes kw-ambient-pulse {
    from { opacity: 0.3; }
    to { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
    html[data-kw-theme="dark"] .content::after {
        animation: none;
        opacity: 0.4;
    }
}

html[data-kw-theme="dark"] .content > * {
    position: relative;
    z-index: 1;
}

html[data-kw-theme="dark"] .main-scroll-region {
    background: transparent !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

html[data-kw-theme="dark"] .content .app-page-inner.container-fluid {
    position: relative;
    background: var(--kw-bg-panel) !important;
    border: 1px solid rgba(79, 195, 247, 0.14) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.03),
        0 0 0 1px rgba(79, 195, 247, 0.05),
        0 8px 28px rgba(0, 0, 0, 0.18) !important;
    margin: 10px 12px 14px !important;
}

/* Borde lateral fino del panel principal */
html[data-kw-theme="dark"] .content .app-page-inner.container-fluid::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 0;
    bottom: 14px;
    width: 1px;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(79, 195, 247, 0.35) 20%,
        rgba(79, 195, 247, 0.55) 50%,
        rgba(79, 195, 247, 0.3) 80%,
        transparent 100%
    );
}

html[data-kw-theme="dark"] .content .app-page-inner.container-fluid::after {
    content: "";
    position: absolute;
    top: 14px;
    right: 0;
    bottom: 14px;
    width: 1px;
    pointer-events: none;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(79, 195, 247, 0.12) 25%,
        rgba(59, 130, 246, 0.22) 50%,
        rgba(79, 195, 247, 0.1) 75%,
        transparent 100%
    );
    opacity: 0.7;
}

html[data-kw-theme="dark"] .kw-topbar-brand-text {
    color: var(--kw-topbar-text) !important;
}

html[data-kw-theme="dark"] .kw-topbar-tools .form-select,
html[data-kw-theme="dark"] .kw-theme-toggle {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.28);
    color: #e2e8f0;
}

html[data-kw-theme="dark"] .kw-theme-toggle:hover {
    background: rgba(30, 41, 59, 0.9);
    color: var(--kw-accent-soft);
    border-color: rgba(34, 211, 238, 0.35);
}

/* ---------- Superficies y cards ---------- */

html[data-kw-theme="dark"] .card,
html[data-kw-theme="dark"] .biz-card,
html[data-kw-theme="dark"] .dashboard-card,
html[data-kw-theme="dark"] .emp-widget {
    background: var(--kw-card-bg) !important;
    border: 1px solid var(--kw-card-border) !important;
    color: #e8edf5;
    box-shadow: var(--kw-card-highlight), var(--kw-card-shadow) !important;
}

html[data-kw-theme="dark"] .card-header,
html[data-kw-theme="dark"] .content .card-header {
    background: var(--kw-bg-raised) !important;
    border-bottom: 1px solid var(--kw-line-soft) !important;
    color: #f1f5f9;
}

html[data-kw-theme="dark"] .content .table-responsive {
    background: var(--kw-bg-inset) !important;
    border: 1px solid var(--kw-line-soft) !important;
    box-shadow: inset 0 1px 0 var(--kw-line-faint);
}

html[data-kw-theme="dark"] .content .table thead th {
    background: var(--kw-bg-raised) !important;
    color: #94a3b8 !important;
    border-bottom: 1px solid var(--kw-line-soft) !important;
}

html[data-kw-theme="dark"] .topbar {
    background: var(--kw-bg-inset) !important;
    border-color: var(--kw-line-soft) !important;
    color: #e8edf5;
}

html[data-kw-theme="dark"] .content .biz-page {
    background: transparent;
}

html[data-kw-theme="dark"] .content .biz-page .card,
html[data-kw-theme="dark"] .content .biz-page .biz-card {
    background: var(--kw-card-bg);
    border: 1px solid var(--kw-card-border);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

html[data-kw-theme="dark"] .content .biz-page .page-title,
html[data-kw-theme="dark"] .content .biz-page .page-subtitle,
html[data-kw-theme="dark"] .emp-widget-title {
    color: #f1f5f9;
}

html[data-kw-theme="dark"] .content .biz-page .page-subtitle {
    color: #94a3b8;
}

html[data-kw-theme="dark"] .content .biz-page .calendario-wrapper,
html[data-kw-theme="dark"] .content .biz-page .admin-cierre-card {
    background: rgba(15, 28, 48, 0.92);
    border-color: rgba(148, 163, 184, 0.2);
}

/* ---------- Formularios y tablas ---------- */

html[data-kw-theme="dark"] .form-control,
html[data-kw-theme="dark"] .form-select,
html[data-kw-theme="dark"] textarea.form-control {
    background-color: var(--kw-bg-inset) !important;
    border-color: var(--kw-line-soft) !important;
    color: #e8edf5;
    box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.22);
}

html[data-kw-theme="dark"] .form-control:focus,
html[data-kw-theme="dark"] .form-select:focus {
    background-color: rgba(15, 23, 42, 0.95);
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(34, 211, 238, 0.12);
    color: #f8fafc;
}

html[data-kw-theme="dark"] .form-control::placeholder {
    color: #64748b;
}

html[data-kw-theme="dark"] .form-label,
html[data-kw-theme="dark"] label {
    color: #cbd5e1;
}

html[data-kw-theme="dark"] .table {
    --bs-table-bg: transparent;
    --bs-table-color: #e2e8f0;
    --bs-table-border-color: rgba(148, 163, 184, 0.16);
    --bs-table-striped-bg: rgba(15, 23, 42, 0.45);
    --bs-table-striped-color: #e2e8f0;
    --bs-table-active-color: #f8fafc;
    --bs-table-hover-color: #f8fafc;
    --bs-table-hover-bg: rgba(34, 211, 238, 0.06);
    background-color: rgba(15, 28, 48, 0.72);
    border-color: rgba(148, 163, 184, 0.18);
    color: #e2e8f0;
}

html[data-kw-theme="dark"] .table-light {
    --bs-table-color: #94a3b8;
    --bs-table-bg: rgba(15, 23, 42, 0.75);
    --bs-table-border-color: rgba(148, 163, 184, 0.18);
}

html[data-kw-theme="dark"] thead.table-light,
html[data-kw-theme="dark"] .table thead.table-light {
    --bs-table-color: #94a3b8;
    --bs-table-bg: rgba(15, 23, 42, 0.75);
}

html[data-kw-theme="dark"] thead.table-light th,
html[data-kw-theme="dark"] .table thead.table-light th {
    background: rgba(15, 23, 42, 0.75) !important;
    color: #94a3b8 !important;
}

html[data-kw-theme="dark"] .table thead th {
    background: rgba(15, 23, 42, 0.75);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.18);
}

html[data-kw-theme="dark"] .table td,
html[data-kw-theme="dark"] .table th {
    border-color: rgba(148, 163, 184, 0.14);
}

html[data-kw-theme="dark"] .table tbody td,
html[data-kw-theme="dark"] .table tbody th {
    color: #e2e8f0;
}

html[data-kw-theme="dark"] .table-striped > tbody > tr:nth-of-type(odd) > * {
    color: #e2e8f0;
}

html[data-kw-theme="dark"] .table-hover tbody tr:hover {
    color: #f8fafc;
}

/* ---------- Botones unificados (mockup cyan glow) ---------- */

html[data-kw-theme="dark"] .btn-primary,
html[data-kw-theme="dark"] .btn.btn-primary,
html[data-kw-theme="dark"] .btn-cal:not(.btn-cal-secondary):not(.btn-cal-outline):not(.btn-danger):not(.btn-cal-arrow),
html[data-kw-theme="dark"] .btn-shift,
html[data-kw-theme="dark"] .tw-btn-primary,
html[data-kw-theme="dark"] .modern-btn-primary,
html[data-kw-theme="dark"] .btn-filtrar,
html[data-kw-theme="dark"] .btn-volver,
html[data-kw-theme="dark"] .doc-worker-submit,
html[data-kw-theme="dark"] .doc-upload-submit,
html[data-kw-theme="dark"] .pagination .page-item.active .page-link {
    background: linear-gradient(180deg, var(--kw-btn-primary-start) 0%, var(--kw-btn-primary-mid) 52%, var(--kw-btn-primary-end) 100%) !important;
    border: 1px solid var(--kw-btn-primary-border) !important;
    color: var(--kw-btn-primary-text) !important;
    box-shadow: var(--kw-btn-shadow) !important;
    filter: none !important;
}

html[data-kw-theme="dark"] .btn-primary:hover,
html[data-kw-theme="dark"] .btn.btn-primary:hover,
html[data-kw-theme="dark"] .btn-cal:not(.btn-cal-secondary):not(.btn-cal-outline):not(.btn-danger):not(.btn-cal-arrow):hover,
html[data-kw-theme="dark"] .btn-shift:hover,
html[data-kw-theme="dark"] .tw-btn-primary:hover,
html[data-kw-theme="dark"] .modern-btn-primary:hover {
    background: linear-gradient(180deg, #4fc3f7 0%, #1976d2 52%, #1565c0 100%) !important;
    border-color: rgba(79, 195, 247, 0.62) !important;
    color: #fff !important;
    box-shadow: 0 6px 26px rgba(79, 195, 247, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
}

html[data-kw-theme="dark"] .btn-primary:active,
html[data-kw-theme="dark"] .btn.btn-primary:active,
html[data-kw-theme="dark"] .btn-cal:not(.btn-cal-secondary):not(.btn-cal-outline):not(.btn-danger):not(.btn-cal-arrow):active {
    transform: translateY(1px);
    box-shadow: var(--kw-btn-shadow-active) !important;
}

html[data-kw-theme="dark"] .btn-outline-primary,
html[data-kw-theme="dark"] .btn-outline-secondary,
html[data-kw-theme="dark"] .btn-cal-secondary,
html[data-kw-theme="dark"] .btn-cal-outline,
html[data-kw-theme="dark"] .tw-btn-sec,
html[data-kw-theme="dark"] .modern-btn-secondary {
    background: var(--kw-bg-inset) !important;
    color: #cbd5e1 !important;
    border: 1px solid var(--kw-line-soft) !important;
    box-shadow: inset 0 1px 0 var(--kw-line-faint) !important;
}

html[data-kw-theme="dark"] .btn-outline-primary:hover,
html[data-kw-theme="dark"] .btn-outline-secondary:hover,
html[data-kw-theme="dark"] .btn-cal-secondary:hover,
html[data-kw-theme="dark"] .btn-cal-outline:hover {
    background: var(--kw-bg-raised) !important;
    color: #f1f5f9 !important;
    border-color: var(--kw-line-bright) !important;
}

html[data-kw-theme="dark"] .btn-outline-primary {
    color: var(--kw-accent-soft) !important;
    border-color: rgba(79, 195, 247, 0.38) !important;
}

html[data-kw-theme="dark"] .btn-outline-primary:hover {
    background: rgba(79, 195, 247, 0.12) !important;
    color: #e0f7fa !important;
    border-color: rgba(79, 195, 247, 0.55) !important;
}

html[data-kw-theme="dark"] .btn-success {
    background: rgba(34, 197, 94, 0.14) !important;
    border: 1px solid rgba(34, 197, 94, 0.38) !important;
    color: #86efac !important;
    box-shadow: inset 0 1px 0 rgba(134, 239, 172, 0.12) !important;
}

html[data-kw-theme="dark"] .btn-danger {
    background: rgba(239, 68, 68, 0.14) !important;
    border: 1px solid rgba(239, 68, 68, 0.38) !important;
    color: #fca5a5 !important;
    box-shadow: inset 0 1px 0 rgba(252, 165, 165, 0.1) !important;
}

html[data-kw-theme="dark"] .btn-secondary {
    background: var(--kw-bg-inset) !important;
    border-color: var(--kw-line-soft) !important;
    color: #cbd5e1 !important;
}

html[data-kw-theme="dark"] .btn-light,
html[data-kw-theme="dark"] .btn-outline-light {
    background: rgba(15, 23, 42, 0.65);
    border-color: rgba(148, 163, 184, 0.25);
    color: #e2e8f0;
}

html[data-kw-theme="dark"] .btn-link {
    color: var(--kw-accent-soft);
}

/* ---------- Bootstrap extras ---------- */

html[data-kw-theme="dark"] .dropdown-menu {
    background: rgba(15, 28, 48, 0.98);
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html[data-kw-theme="dark"] .dropdown-item {
    color: #e2e8f0;
}

html[data-kw-theme="dark"] .dropdown-item:hover,
html[data-kw-theme="dark"] .dropdown-item:focus {
    background: rgba(34, 211, 238, 0.1);
    color: #f8fafc;
}

html[data-kw-theme="dark"] .modal-content {
    background: rgba(15, 28, 48, 0.98);
    border-color: rgba(148, 163, 184, 0.22);
    color: #e2e8f0;
}

html[data-kw-theme="dark"] .modal-header,
html[data-kw-theme="dark"] .modal-footer {
    border-color: rgba(148, 163, 184, 0.16);
}

html[data-kw-theme="dark"] .modal-title {
    color: #f8fafc;
}

html[data-kw-theme="dark"] .btn-close {
    filter: invert(1) grayscale(1);
    opacity: 0.75;
}

html[data-kw-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fcd34d;
}

html[data-kw-theme="dark"] .alert-danger {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
    color: #fca5a5;
}

html[data-kw-theme="dark"] .alert-success {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

html[data-kw-theme="dark"] .alert-info {
    background: rgba(34, 211, 238, 0.12);
    border-color: rgba(34, 211, 238, 0.3);
    color: #a5f3fc;
}

html[data-kw-theme="dark"] .badge.bg-light,
html[data-kw-theme="dark"] .badge.text-bg-light {
    background: rgba(30, 41, 59, 0.85) !important;
    color: #e2e8f0 !important;
}

html[data-kw-theme="dark"] .nav-tabs {
    border-color: rgba(148, 163, 184, 0.2);
}

html[data-kw-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8;
    border-color: transparent;
}

html[data-kw-theme="dark"] .nav-tabs .nav-link.active {
    background: rgba(15, 28, 48, 0.92);
    border-color: rgba(148, 163, 184, 0.2) rgba(148, 163, 184, 0.2) transparent;
    color: var(--kw-accent-soft);
}

html[data-kw-theme="dark"] .list-group-item {
    background: rgba(15, 28, 48, 0.72);
    border-color: rgba(148, 163, 184, 0.16);
    color: #e2e8f0;
}

html[data-kw-theme="dark"] .pagination .page-link {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(148, 163, 184, 0.22);
    color: #cbd5e1;
}

html[data-kw-theme="dark"] .pagination .page-item.active .page-link {
    background: linear-gradient(180deg, #29b6f6 0%, #1565c0 100%) !important;
    border-color: rgba(79, 195, 247, 0.45) !important;
    color: #fff !important;
    box-shadow: 0 4px 16px rgba(79, 195, 247, 0.28) !important;
}

html[data-kw-theme="dark"] .text-muted,
html[data-kw-theme="dark"] .muted {
    color: #94a3b8 !important;
}

html[data-kw-theme="dark"] .text-dark {
    color: #e2e8f0 !important;
}

html[data-kw-theme="dark"] hr {
    border-color: rgba(148, 163, 184, 0.16);
    opacity: 1;
}

html[data-kw-theme="dark"] .dash-search .form-control {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(148, 163, 184, 0.24);
    color: #e2e8f0;
}

/* ---------- Scrollbars finos (modo oscuro) ---------- */

html[data-kw-theme="dark"] .sidebar-nav,
html[data-kw-theme="dark"] .main-scroll-region,
html[data-kw-theme="dark"] .modal-body,
html[data-kw-theme="dark"] .table-responsive {
    scrollbar-color: rgba(79, 195, 247, 0.28) transparent;
}

html[data-kw-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb,
html[data-kw-theme="dark"] .main-scroll-region::-webkit-scrollbar-thumb,
html[data-kw-theme="dark"] .modal-body::-webkit-scrollbar-thumb,
html[data-kw-theme="dark"] .table-responsive::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.22);
}

html[data-kw-theme="dark"] .sidebar-nav::-webkit-scrollbar-thumb:hover,
html[data-kw-theme="dark"] .main-scroll-region::-webkit-scrollbar-thumb:hover,
html[data-kw-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover,
html[data-kw-theme="dark"] .table-responsive::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 195, 247, 0.38);
}

/* ---------- Toggle tema (ambos modos) ---------- */

.kw-topbar-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kw-theme-toggle {
    width: 36px;
    height: 31px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.kw-theme-toggle:hover {
    background: #f8fafc;
    color: #0f172a;
}

.kw-theme-toggle i {
    width: 16px !important;
    height: 16px !important;
    max-width: 16px;
    max-height: 16px;
}
