/* ==========================================================
   HelpDesk Pro - Estilos modernos empresariales
   ========================================================== */

* { box-sizing: border-box; }

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: #f4f6fa;
    color: #1f2937;
    margin: 0;
    min-height: 100vh;
}

/* ===== Layout principal ===== */
.hd-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    box-shadow: 0 4px 30px rgba(0,0,0,0.12);
    overflow-y: auto;
    transition: transform 0.3s ease;
}
.hd-main {
    margin-left: 260px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.hd-content {
    padding: 24px 32px;
    flex: 1;
}

@media (max-width: 768px) {
    .hd-sidebar { transform: translateX(-100%); }
    .hd-sidebar.open { transform: translateX(0); }
    .hd-main { margin-left: 0; }
    .hd-content { padding: 16px; }
}

/* ===== Sidebar brand y nav ===== */
.hd-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}
.hd-logo { width: 40px; height: 40px; border-radius: 10px; background: white; padding: 4px; object-fit: contain; }
.hd-logo-fallback {
    width: 40px; height: 40px; border-radius: 10px;
    background: var(--hd-primary);
    display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: white;
}
.hd-brand-text { line-height: 1.2; }
.hd-brand-name { font-weight: 700; color: #f1f5f9; font-size: 15px; }
.hd-brand-tagline { font-size: 11px; color: #94a3b8; }

.hd-company-chip {
    margin: 14px 16px 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex; gap: 10px; align-items: center;
    font-size: 13px; color: #cbd5e1;
}
.hd-company-chip i { color: var(--hd-primary); font-size: 16px; }

.hd-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.hd-nav-section {
    font-size: 10.5px;
    text-transform: uppercase;
    color: #64748b;
    letter-spacing: 0.6px;
    padding: 14px 12px 6px;
    font-weight: 700;
}
.hd-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: #cbd5e1;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
    position: relative;
}
.hd-nav-item:hover { background: rgba(255,255,255,0.05); color: #f8fafc; }
.hd-nav-item.active {
    background: var(--hd-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(13,110,253,0.4);
}
.hd-nav-item i { font-size: 17px; width: 20px; text-align: center; }

.hd-sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,0.07); }
.hd-sidebar-footer .text-muted { color: #64748b !important; }

/* ===== Topbar ===== */
.hd-topbar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.hd-sidebar-toggle {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    width: 38px; height: 38px;
    font-size: 20px;
    color: #475569;
}
.hd-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}
.hd-search i {
    position: absolute;
    left: 14px; top: 50%; transform: translateY(-50%);
    color: #94a3b8;
}
.hd-search input {
    width: 100%;
    border: 1px solid #e5e7eb;
    background: #f8fafc;
    padding: 10px 14px 10px 40px;
    border-radius: 10px;
    font-size: 14px;
    transition: 0.15s;
}
.hd-search input:focus {
    outline: none;
    border-color: var(--hd-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(13,110,253,0.08);
}

.hd-topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.hd-icon-btn {
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #475569;
    transition: 0.15s;
}
.hd-icon-btn:hover { background: #f1f5f9; color: var(--hd-primary); }
.hd-badge {
    position: absolute;
    top: 4px; right: 4px;
    background: #ef4444; color: white;
    font-size: 10px; font-weight: 700;
    padding: 2px 5px; border-radius: 10px;
    min-width: 18px; text-align: center;
}

.hd-user-btn {
    display: flex; align-items: center; gap: 10px;
    background: transparent; border: none;
    padding: 4px 10px 4px 4px;
    border-radius: 30px;
    transition: 0.15s;
}
.hd-user-btn:hover { background: #f1f5f9; }
.hd-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hd-primary), var(--hd-accent));
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
}
.hd-user-name { font-size: 13px; font-weight: 600; line-height: 1.1; color: #1e293b; }
.hd-user-role { font-size: 11px; color: #64748b; }

/* ===== Notificaciones dropdown ===== */
.hd-notif-dropdown { width: 360px; padding: 0; border: none; box-shadow: 0 12px 40px rgba(0,0,0,0.12); border-radius: 12px; overflow: hidden; }
.hd-notif-header { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; }
.hd-notif-list { max-height: 420px; overflow-y: auto; }
.hd-notif-item {
    padding: 12px 16px;
    display: flex; gap: 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: 0.15s;
    text-decoration: none;
    color: inherit;
}
.hd-notif-item:hover { background: #f8fafc; }
.hd-notif-item.unread { background: rgba(13,110,253,0.04); }
.hd-notif-item .icon-wrap { width: 36px; height: 36px; border-radius: 8px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; }
.hd-notif-item .title { font-weight: 600; font-size: 13px; color: #1e293b; }
.hd-notif-item .msg { font-size: 12px; color: #64748b; line-height: 1.35; margin-top: 2px; }
.hd-notif-item .time { font-size: 11px; color: #94a3b8; margin-top: 4px; }
.hd-notif-footer { padding: 10px 16px; background: #f8fafc; text-align: center; border-top: 1px solid #f1f5f9; }

/* ===== Tarjetas / KPIs ===== */
.card {
    border: none;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 20px rgba(0,0,0,0.025);
    overflow: hidden;
}
.card-header { background: white; border-bottom: 1px solid #f1f5f9; font-weight: 600; padding: 14px 18px; }
.card-body { padding: 18px; }

.kpi-card {
    background: white;
    padding: 22px;
    border-radius: 14px;
    border: 1px solid #f1f5f9;
    transition: 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    height: 100%;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.kpi-card .kpi-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    margin-bottom: 14px;
}
.kpi-card .kpi-value { font-size: 28px; font-weight: 800; line-height: 1.1; color: #0f172a; }
.kpi-card .kpi-label { font-size: 13px; color: #64748b; font-weight: 500; margin-top: 4px; }
.kpi-card .kpi-delta { font-size: 11px; font-weight: 600; margin-top: 8px; }
.kpi-card.primary .kpi-icon { background: rgba(13,110,253,0.1); color: var(--hd-primary); }
.kpi-card.success .kpi-icon { background: rgba(25,135,84,0.1); color: #198754; }
.kpi-card.warning .kpi-icon { background: rgba(253,126,20,0.1); color: #fd7e14; }
.kpi-card.danger .kpi-icon { background: rgba(220,53,69,0.1); color: #dc3545; }
.kpi-card.info .kpi-icon { background: rgba(13,202,240,0.12); color: #0dcaf0; }
.kpi-card.secondary .kpi-icon { background: rgba(108,117,125,0.1); color: #6c757d; }

/* ===== Page header ===== */
.page-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.page-header h1 { font-size: 24px; font-weight: 700; margin: 0; color: #0f172a; }
.page-header .subtitle { color: #64748b; font-size: 14px; margin-top: 4px; }
.page-header .breadcrumb { font-size: 12px; color: #94a3b8; margin-bottom: 4px; }

/* ===== Tablas modernas ===== */
.table { border-collapse: separate; border-spacing: 0; margin: 0; }
.table thead th { background: #f8fafc; color: #475569; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 12px 16px; border-bottom: 1px solid #e2e8f0; }
.table tbody td { padding: 14px 16px; border-top: 1px solid #f1f5f9; font-size: 14px; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.table-card { background: white; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); border: 1px solid #f1f5f9; }

/* ===== Ticket cards / status ===== */
.ticket-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid #f1f5f9; transition: 0.15s; }
.ticket-row:hover { background: #f8fafc; }
.ticket-priority-dot { width: 8px; height: 36px; border-radius: 4px; }
.ticket-priority-dot.critical { background: #dc3545; }
.ticket-priority-dot.high { background: #fd7e14; }
.ticket-priority-dot.medium { background: #0dcaf0; }
.ticket-priority-dot.low { background: #94a3b8; }

.status-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
}
.status-pill.dot::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ===== Botones ===== */
.btn { border-radius: 8px; font-weight: 500; padding: 8px 16px; font-size: 14px; }
.btn-primary { background: var(--hd-primary); border-color: var(--hd-primary); }
.btn-primary:hover { filter: brightness(0.92); }
.btn-soft-primary { background: rgba(13,110,253,0.1); color: var(--hd-primary); border: none; }
.btn-soft-primary:hover { background: rgba(13,110,253,0.18); color: var(--hd-primary); }

/* ===== Forms ===== */
.form-label { font-weight: 600; font-size: 13px; color: #475569; margin-bottom: 6px; }
.form-control, .form-select { border-radius: 8px; border-color: #e5e7eb; padding: 10px 14px; font-size: 14px; }
.form-control:focus, .form-select:focus { border-color: var(--hd-primary); box-shadow: 0 0 0 4px rgba(13,110,253,0.08); }
.form-text { font-size: 12px; color: #64748b; }
.input-group-text { background: #f8fafc; border-color: #e5e7eb; font-size: 13px; color: #64748b; }

/* ===== Login page ===== */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: stretch;
}
.auth-left {
    flex: 1.1;
    background: linear-gradient(135deg, #0f172a 0%, #1e40af 100%);
    color: white;
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}
.auth-left::before {
    content: "";
    position: absolute; inset: 0;
    background: radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08), transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(255,255,255,0.06), transparent 50%);
}
.auth-left-content { position: relative; z-index: 1; max-width: 460px; text-align: center; }
.auth-left h1 { font-size: 36px; font-weight: 800; margin-bottom: 16px; }
.auth-left p { font-size: 16px; color: rgba(255,255,255,0.8); line-height: 1.6; }
.auth-features { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.auth-feature { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); padding: 16px; border-radius: 12px; text-align: left; }
.auth-feature i { font-size: 24px; color: #60a5fa; margin-bottom: 8px; display: block; }
.auth-feature h6 { font-weight: 700; margin-bottom: 4px; }
.auth-feature p { font-size: 12px; margin: 0; color: rgba(255,255,255,0.7); }

.auth-right {
    flex: 1;
    background: #f8fafc;
    display: flex; align-items: center; justify-content: center;
    padding: 40px;
}
.auth-card { width: 100%; max-width: 420px; background: white; padding: 40px; border-radius: 18px; box-shadow: 0 20px 60px rgba(15,23,42,0.08); }
.auth-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; color: #0f172a; }
.auth-card .subtitle { color: #64748b; font-size: 14px; margin-bottom: 28px; }

@media (max-width: 992px) { .auth-left { display: none; } }

/* ===== Modal ===== */
.modal-content { border-radius: 16px; border: none; }
.modal-header { padding: 18px 22px; border-bottom: 1px solid #f1f5f9; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid #f1f5f9; }

/* ===== Timeline (ticket history) ===== */
.timeline { position: relative; padding-left: 24px; }
.timeline::before {
    content: ""; position: absolute; left: 8px; top: 0; bottom: 0;
    width: 2px; background: #e5e7eb;
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-item::before {
    content: ""; position: absolute; left: -22px; top: 4px;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--hd-primary);
}
.timeline-item.system::before { border-color: #94a3b8; }
.timeline-item .when { font-size: 11px; color: #94a3b8; }
.timeline-item .who { font-size: 13px; font-weight: 600; color: #1e293b; }
.timeline-item .what { font-size: 13px; color: #475569; margin-top: 2px; }

/* ===== Comments ===== */
.comment-item { background: white; border: 1px solid #f1f5f9; border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.comment-item.internal { background: #fef9c3; border-color: #fcd34d; }
.comment-item .head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }

/* ===== Workflow visualization ===== */
.wf-states { display: flex; flex-wrap: wrap; gap: 12px; }
.wf-state {
    padding: 10px 16px;
    border-radius: 10px;
    background: white;
    border: 2px solid;
    font-size: 13px;
    font-weight: 600;
}

/* ===== Toast de mismatch (validacion inteligente) ===== */
.hd-mismatch-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1090;
    width: 420px;
    max-width: calc(100vw - 40px);
    transform: translateX(440px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s;
}
.hd-mismatch-toast.show {
    transform: translateX(0);
    opacity: 1;
}
.hd-mismatch-toast-inner {
    background: linear-gradient(180deg, #fff7ed 0%, #ffffff 100%);
    border: 1px solid #fbbf24;
    border-left: 6px solid #f59e0b;
    border-radius: 14px;
    padding: 16px 18px;
    box-shadow: 0 20px 50px rgba(245, 158, 11, 0.25), 0 4px 12px rgba(0, 0, 0, 0.06);
    animation: hdToastPulse 1.5s ease-out;
}
@keyframes hdToastPulse {
    0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55), 0 20px 50px rgba(245, 158, 11, 0.25); }
    100% { box-shadow: 0 0 0 18px rgba(245, 158, 11, 0), 0 20px 50px rgba(245, 158, 11, 0.25); }
}
.hd-mismatch-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: #fbbf24;
    color: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
    animation: hdIconBounce 0.6s ease-out;
}
@keyframes hdIconBounce {
    0% { transform: scale(0); }
    60% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes hdShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}
.hd-shake { animation: hdShake 0.5s ease-in-out; }
textarea.hd-shake { border-color: #f59e0b !important; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15) !important; }

/* ===== Lesson content ===== */
.lesson-content-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-left: 4px solid var(--hd-primary);
}
.lesson-content {
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.7;
    color: #334155;
}
.lesson-content::first-letter {
    font-size: 18px;
    font-weight: 600;
    color: var(--hd-primary);
}

/* ===== Training cards ===== */
.training-card {
    background: white;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    border: 1px solid #f1f5f9;
    transition: 0.2s;
    height: 100%;
    display: flex; flex-direction: column;
}
.training-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.1); }
.training-card-cover {
    height: 140px;
    background: linear-gradient(135deg, var(--hd-primary), var(--hd-accent));
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 48px;
}
.training-card-cover img { width: 100%; height: 100%; object-fit: cover; }
.training-card-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.training-progress-bar { height: 6px; background: #f1f5f9; border-radius: 4px; overflow: hidden; margin-top: 8px; }
.training-progress-bar .fill { height: 100%; background: var(--hd-accent); transition: width 0.4s; }

/* ===== Scrollbar suave ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ===== Interactive tutorial overlay ===== */
.hd-tutorial-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,0.7);
    z-index: 2000;
    display: none;
    align-items: center; justify-content: center;
}
.hd-tutorial-overlay.active { display: flex; }
.hd-tutorial-card {
    background: white;
    padding: 28px;
    border-radius: 16px;
    max-width: 500px;
    margin: 16px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.hd-tutorial-card h3 { font-weight: 700; margin-bottom: 10px; }
.hd-tutorial-step-indicator { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }

/* ===== Empty state ===== */
.empty-state { text-align: center; padding: 60px 20px; color: #64748b; }
.empty-state i { font-size: 56px; color: #cbd5e1; margin-bottom: 12px; }
.empty-state h4 { font-weight: 600; color: #475569; }

/* ===== Badge helpers ===== */
.badge { font-weight: 600; padding: 5px 9px; font-size: 11px; border-radius: 6px; }

/* ===== Selector de tema ===== */
.hd-theme-menu { min-width:260px; padding:8px 0 }
.theme-option {
    display:flex; align-items:center; gap:10px;
    padding:8px 14px; font-size:14px;
}
.theme-option.active { background:rgba(13,110,253,0.08); color:var(--hd-primary); font-weight:600 }
.theme-swatch {
    width:22px; height:22px; border-radius:6px;
    border:1px solid rgba(0,0,0,0.15); flex-shrink:0;
    box-shadow:0 1px 3px rgba(0,0,0,0.1);
}
.theme-check { margin-left:auto; color:var(--hd-primary) }

/* ============================================
   TEMAS ADICIONALES - cada tema redefine los
   colores principales del sistema
   ============================================ */

/* ----- Solar (warm, tonos calidos) ----- */
[data-hd-theme="solar"] body { background:#fdf6e3; color:#586e75 }
[data-hd-theme="solar"] .hd-topbar { background:#eee8d5; border-bottom-color:#d4cbb1 }
[data-hd-theme="solar"] .card,
[data-hd-theme="solar"] .kpi-card,
[data-hd-theme="solar"] .table-card { background:#fffaef; border-color:#eee8d5; color:#586e75 }
[data-hd-theme="solar"] .card-header { background:#fffaef; border-bottom-color:#eee8d5; color:#073642 }
[data-hd-theme="solar"] .table thead th { background:#eee8d5; color:#657b83; border-bottom-color:#d4cbb1 }
[data-hd-theme="solar"] .hd-sidebar { background:linear-gradient(180deg, #073642 0%, #002b36 100%) }
[data-hd-theme="solar"] .form-control,
[data-hd-theme="solar"] .form-select { background:#fffaef; border-color:#d4cbb1; color:#586e75 }
[data-hd-theme="solar"] { --hd-primary:#cb4b16; --bs-primary:#cb4b16; --bs-primary-rgb:203,75,22 }
[data-hd-theme="solar"] .btn-primary { background:#cb4b16; border-color:#cb4b16 }
[data-hd-theme="solar"] .hd-nav-item.active { background:#cb4b16; box-shadow:0 4px 14px rgba(203,75,22,0.4) }

/* ----- Oceano (azul/teal) ----- */
[data-hd-theme="ocean"] body { background:#e0f2fe; color:#0c4a6e }
[data-hd-theme="ocean"] .hd-topbar { background:#bae6fd; border-bottom-color:#7dd3fc }
[data-hd-theme="ocean"] .card,
[data-hd-theme="ocean"] .kpi-card,
[data-hd-theme="ocean"] .table-card { background:#f0f9ff; border-color:#bae6fd; color:#0c4a6e }
[data-hd-theme="ocean"] .card-header { background:#f0f9ff; border-bottom-color:#bae6fd; color:#0c4a6e }
[data-hd-theme="ocean"] .table thead th { background:#bae6fd; color:#075985 }
[data-hd-theme="ocean"] .hd-sidebar { background:linear-gradient(180deg, #0c4a6e 0%, #082f49 100%) }
[data-hd-theme="ocean"] { --hd-primary:#0284c7; --bs-primary:#0284c7; --bs-primary-rgb:2,132,199 }
[data-hd-theme="ocean"] .btn-primary { background:#0284c7; border-color:#0284c7 }
[data-hd-theme="ocean"] .hd-nav-item.active { background:#0284c7; box-shadow:0 4px 14px rgba(2,132,199,0.4) }

/* ----- Bosque (verde) ----- */
[data-hd-theme="forest"] body { background:#f0fdf4; color:#14532d }
[data-hd-theme="forest"] .hd-topbar { background:#dcfce7; border-bottom-color:#bbf7d0 }
[data-hd-theme="forest"] .card,
[data-hd-theme="forest"] .kpi-card,
[data-hd-theme="forest"] .table-card { background:#f7fef9; border-color:#bbf7d0; color:#14532d }
[data-hd-theme="forest"] .card-header { background:#f7fef9; border-bottom-color:#bbf7d0; color:#14532d }
[data-hd-theme="forest"] .table thead th { background:#dcfce7; color:#166534 }
[data-hd-theme="forest"] .hd-sidebar { background:linear-gradient(180deg, #14532d 0%, #052e16 100%) }
[data-hd-theme="forest"] { --hd-primary:#16a34a; --bs-primary:#16a34a; --bs-primary-rgb:22,163,74 }
[data-hd-theme="forest"] .btn-primary { background:#16a34a; border-color:#16a34a }
[data-hd-theme="forest"] .hd-nav-item.active { background:#16a34a; box-shadow:0 4px 14px rgba(22,163,74,0.4) }

/* ----- Rosa (rose) ----- */
[data-hd-theme="rose"] body { background:#fff1f2; color:#881337 }
[data-hd-theme="rose"] .hd-topbar { background:#ffe4e6; border-bottom-color:#fecdd3 }
[data-hd-theme="rose"] .card,
[data-hd-theme="rose"] .kpi-card,
[data-hd-theme="rose"] .table-card { background:#fff5f6; border-color:#fecdd3; color:#881337 }
[data-hd-theme="rose"] .card-header { background:#fff5f6; border-bottom-color:#fecdd3; color:#881337 }
[data-hd-theme="rose"] .table thead th { background:#ffe4e6; color:#9f1239 }
[data-hd-theme="rose"] .hd-sidebar { background:linear-gradient(180deg, #881337 0%, #4c0519 100%) }
[data-hd-theme="rose"] { --hd-primary:#e11d48; --bs-primary:#e11d48; --bs-primary-rgb:225,29,72 }
[data-hd-theme="rose"] .btn-primary { background:#e11d48; border-color:#e11d48 }
[data-hd-theme="rose"] .hd-nav-item.active { background:#e11d48; box-shadow:0 4px 14px rgba(225,29,72,0.4) }

/* ----- Crepusculo (twilight - dark purple/indigo) ----- */
[data-hd-theme="twilight"] body { background:#1e1b4b; color:#e0e7ff }
[data-hd-theme="twilight"] .hd-topbar { background:#312e81; border-bottom-color:#4338ca }
[data-hd-theme="twilight"] .card,
[data-hd-theme="twilight"] .kpi-card,
[data-hd-theme="twilight"] .table-card { background:#312e81; border-color:#4338ca; color:#e0e7ff }
[data-hd-theme="twilight"] .card-header { background:#312e81; border-bottom-color:#4338ca; color:#e0e7ff }
[data-hd-theme="twilight"] .table thead th { background:#1e1b4b; color:#c7d2fe; border-bottom-color:#4338ca }
[data-hd-theme="twilight"] .table tbody td { color:#e0e7ff; border-color:#4338ca }
[data-hd-theme="twilight"] .table tbody tr:hover { background:#1e1b4b }
[data-hd-theme="twilight"] .hd-sidebar { background:linear-gradient(180deg, #0f0a3c 0%, #1e1b4b 100%) }
[data-hd-theme="twilight"] .form-control,
[data-hd-theme="twilight"] .form-select { background:#1e1b4b; border-color:#4338ca; color:#e0e7ff }
[data-hd-theme="twilight"] .input-group-text { background:#1e1b4b; color:#a5b4fc; border-color:#4338ca }
[data-hd-theme="twilight"] .modal-content { background:#312e81; color:#e0e7ff }
[data-hd-theme="twilight"] { --hd-primary:#a78bfa; --bs-primary:#a78bfa; --bs-primary-rgb:167,139,250 }
[data-hd-theme="twilight"] .btn-primary { background:#7c3aed; border-color:#7c3aed }
[data-hd-theme="twilight"] .hd-nav-item.active { background:#7c3aed; box-shadow:0 4px 14px rgba(124,58,237,0.4) }
[data-hd-theme="twilight"] .hd-content, [data-hd-theme="twilight"] h1, [data-hd-theme="twilight"] h2,
[data-hd-theme="twilight"] h3, [data-hd-theme="twilight"] h4, [data-hd-theme="twilight"] h5, [data-hd-theme="twilight"] h6 { color:#f1f5f9 }
[data-hd-theme="twilight"] .text-muted { color:#a5b4fc !important }
[data-hd-theme="twilight"] .dropdown-menu { background:#312e81; border-color:#4338ca }
[data-hd-theme="twilight"] .dropdown-item { color:#e0e7ff }
[data-hd-theme="twilight"] .dropdown-item:hover { background:#4338ca; color:#fff }

/* ----- Medianoche (midnight - super dark) ----- */
[data-hd-theme="midnight"] body { background:#000000; color:#e5e5e5 }
[data-hd-theme="midnight"] .hd-topbar { background:#0a0a0a; border-bottom-color:#262626 }
[data-hd-theme="midnight"] .card,
[data-hd-theme="midnight"] .kpi-card,
[data-hd-theme="midnight"] .table-card { background:#0a0a0a; border-color:#262626; color:#e5e5e5 }
[data-hd-theme="midnight"] .card-header { background:#0a0a0a; border-bottom-color:#262626; color:#f5f5f5 }
[data-hd-theme="midnight"] .table thead th { background:#000; color:#a3a3a3; border-bottom-color:#262626 }
[data-hd-theme="midnight"] .table tbody td { border-color:#262626; color:#e5e5e5 }
[data-hd-theme="midnight"] .table tbody tr:hover { background:#171717 }
[data-hd-theme="midnight"] .hd-sidebar { background:#000 }
[data-hd-theme="midnight"] .form-control,
[data-hd-theme="midnight"] .form-select { background:#0a0a0a; border-color:#262626; color:#e5e5e5 }
[data-hd-theme="midnight"] .input-group-text { background:#0a0a0a; color:#a3a3a3; border-color:#262626 }
[data-hd-theme="midnight"] .modal-content { background:#0a0a0a; color:#e5e5e5 }
[data-hd-theme="midnight"] { --hd-primary:#06b6d4; --bs-primary:#06b6d4; --bs-primary-rgb:6,182,212 }
[data-hd-theme="midnight"] .btn-primary { background:#06b6d4; border-color:#06b6d4 }
[data-hd-theme="midnight"] .hd-nav-item.active { background:#06b6d4; box-shadow:0 4px 14px rgba(6,182,212,0.5) }
[data-hd-theme="midnight"] .hd-content, [data-hd-theme="midnight"] h1, [data-hd-theme="midnight"] h2,
[data-hd-theme="midnight"] h3, [data-hd-theme="midnight"] h4, [data-hd-theme="midnight"] h5, [data-hd-theme="midnight"] h6 { color:#fafafa }
[data-hd-theme="midnight"] .text-muted { color:#737373 !important }
[data-hd-theme="midnight"] .dropdown-menu { background:#0a0a0a; border-color:#262626 }
[data-hd-theme="midnight"] .dropdown-item { color:#e5e5e5 }
[data-hd-theme="midnight"] .dropdown-item:hover { background:#262626; color:#fff }

/* ----- Alto contraste (accesibilidad) ----- */
[data-hd-theme="contrast"] body { background:#ffffff; color:#000000 }
[data-hd-theme="contrast"] .hd-topbar { background:#fff; border-bottom:3px solid #000 }
[data-hd-theme="contrast"] .card,
[data-hd-theme="contrast"] .kpi-card,
[data-hd-theme="contrast"] .table-card { background:#fff; border:2px solid #000; color:#000; box-shadow:none }
[data-hd-theme="contrast"] .card-header { background:#000; color:#fff; border-bottom:2px solid #000 }
[data-hd-theme="contrast"] .table thead th { background:#000; color:#fff; border-bottom:2px solid #000 }
[data-hd-theme="contrast"] .table tbody td { border-color:#000; color:#000 }
[data-hd-theme="contrast"] .hd-sidebar { background:#000 }
[data-hd-theme="contrast"] .form-control,
[data-hd-theme="contrast"] .form-select { background:#fff; border:2px solid #000; color:#000 }
[data-hd-theme="contrast"] { --hd-primary:#000000; --bs-primary:#000000; --bs-primary-rgb:0,0,0 }
[data-hd-theme="contrast"] .btn-primary { background:#000; border-color:#000; color:#fff; font-weight:700 }
[data-hd-theme="contrast"] .btn-light { border:2px solid #000 }
[data-hd-theme="contrast"] .hd-nav-item.active { background:#fff; color:#000; box-shadow:none; border:2px solid #fff }

/* ===== Dark mode ===== */
[data-bs-theme="dark"] {
    color-scheme: dark;
}
[data-bs-theme="dark"] body { background:#0f172a; color:#e2e8f0 }
[data-bs-theme="dark"] .hd-topbar { background:#1e293b; border-bottom-color:#334155 }
[data-bs-theme="dark"] .card, [data-bs-theme="dark"] .kpi-card, [data-bs-theme="dark"] .table-card { background:#1e293b; color:#e2e8f0; border-color:#334155 }
[data-bs-theme="dark"] .card-header { background:#1e293b; border-bottom-color:#334155; color:#e2e8f0 }
[data-bs-theme="dark"] .table thead th { background:#0f172a; color:#cbd5e1; border-color:#334155 }
[data-bs-theme="dark"] .table tbody td { border-color:#334155; color:#e2e8f0 }
[data-bs-theme="dark"] .table tbody tr:hover { background:#0f172a }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background:#0f172a; color:#e2e8f0; border-color:#334155 }
[data-bs-theme="dark"] .form-control:focus, [data-bs-theme="dark"] .form-select:focus { background:#0f172a; color:#e2e8f0 }
[data-bs-theme="dark"] .input-group-text { background:#0f172a; color:#94a3b8; border-color:#334155 }
[data-bs-theme="dark"] .hd-search input { background:#0f172a; border-color:#334155; color:#e2e8f0 }
[data-bs-theme="dark"] .hd-icon-btn { background:#0f172a; border-color:#334155; color:#cbd5e1 }
[data-bs-theme="dark"] .hd-icon-btn:hover { background:#334155 }
[data-bs-theme="dark"] .modal-content { background:#1e293b; color:#e2e8f0 }
[data-bs-theme="dark"] .modal-header, [data-bs-theme="dark"] .modal-footer { border-color:#334155 }
[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 { background:#334155; color:#fff }
[data-bs-theme="dark"] .list-group-item { background:#1e293b; color:#e2e8f0; border-color:#334155 }
[data-bs-theme="dark"] .kanban-col { background:#1e293b }
[data-bs-theme="dark"] .kanban-card { background:#0f172a; color:#e2e8f0 }
[data-bs-theme="dark"] .btn-light { background:#334155; color:#e2e8f0; border-color:#475569 }
[data-bs-theme="dark"] .btn-light:hover { background:#475569; color:#fff }
[data-bs-theme="dark"] .text-muted { color:#94a3b8 !important }
[data-bs-theme="dark"] .alert-info { background:#1e3a8a44; border-color:#3b82f6 }
[data-bs-theme="dark"] .alert-warning { background:#78350f44; border-color:#f59e0b }
[data-bs-theme="dark"] .alert-success { background:#14532d44; border-color:#22c55e }
[data-bs-theme="dark"] .alert-danger { background:#7f1d1d44; border-color:#ef4444 }
[data-bs-theme="dark"] .hd-content { color:#e2e8f0 }
[data-bs-theme="dark"] .page-header h1, [data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3, [data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6 { color:#f1f5f9 }
[data-bs-theme="dark"] .kpi-card .kpi-value { color:#f1f5f9 }
[data-bs-theme="dark"] .accordion-item { background:#1e293b; border-color:#334155 }
[data-bs-theme="dark"] .accordion-button { background:#1e293b; color:#e2e8f0 }
[data-bs-theme="dark"] .accordion-button:not(.collapsed) { background:#0f172a; color:#fff }
[data-bs-theme="dark"] .chat-messages { background:#0f172a }
[data-bs-theme="dark"] .chat-bubble { background:#1e293b; color:#e2e8f0 }
[data-bs-theme="dark"] .chat-msg.mine .chat-bubble { background:#1e40af; color:#fff }
[data-bs-theme="dark"] code { background:#0f172a; color:#fbbf24 }
[data-bs-theme="dark"] pre.bg-dark { background:#020617 !important }
