/* ============================================
   BioAsist — Panel de Control y Páginas v3.0 (Enterprise Glassmorphism)
   ============================================ */

/* ═══════════════════════════════════════════════
   ENCABEZADO EJECUTIVO DEL DASHBOARD
   ═══════════════════════════════════════════════ */
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
    padding: 1.5rem 1.75rem;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.75) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl, 18px);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

[data-theme="light"] .dash-header {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 245, 249, 0.95) 100%);
    border-color: rgba(226, 232, 240, 0.85);
    box-shadow: 0 10px 25px -10px rgba(15, 23, 42, 0.08);
}

.dash-header::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    background: radial-gradient(circle, rgba(56, 189, 248, 0.10) 0%, transparent 70%);
    pointer-events: none;
}

.dash-header-title {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.dash-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    width: fit-content;
}

.dash-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: livePulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

.dash-header h1 {
    font-size: 1.45rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
}

.dash-header-date {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.dash-header-stats {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.dash-pill-stat {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.95rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .dash-pill-stat {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(226, 232, 240, 0.9);
}

/* ═══════════════════════════════════════════════
   ALERT BANNER (SOLICITUDES PENDIENTES)
   ═══════════════════════════════════════════════ */
.premium-alert-banner {
    background: linear-gradient(135deg, rgba(225, 29, 72, 0.9) 0%, rgba(244, 63, 94, 0.85) 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg, 16px);
    padding: 1.25rem 1.75rem;
    margin-bottom: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 12px 30px -8px rgba(225, 29, 72, 0.35);
    color: #fff;
    flex-wrap: wrap;
    gap: 1.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.premium-alert-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 70%);
    pointer-events: none;
}

.premium-alert-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.premium-bell-wrapper {
    background: rgba(255, 255, 255, 0.22);
    padding: 12px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2) inset;
    backdrop-filter: blur(8px);
}

.premium-bell {
    animation: ringBellPulse 2.5s infinite;
    color: #ffffff;
    display: flex;
}

@keyframes ringBellPulse {
    0% { transform: rotate(0) scale(1); }
    10% { transform: rotate(18deg) scale(1.08); }
    20% { transform: rotate(-14deg) scale(1.08); }
    30% { transform: rotate(10deg) scale(1.08); }
    40% { transform: rotate(-8deg) scale(1.08); }
    50%, 100% { transform: rotate(0) scale(1); }
}

.premium-alert-text {
    font-size: 1.12rem;
    font-weight: 750;
    letter-spacing: 0.3px;
    margin: 0;
}

.premium-alert-subtext {
    font-size: 0.88rem;
    opacity: 0.95;
    margin-top: 3px;
    font-weight: 400;
}

.premium-alert-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.premium-btn {
    background: #ffffff;
    color: #e11d48;
    border: none;
    padding: 0.65rem 1.25rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.premium-btn:hover {
    background: #ffffff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    color: #be123c;
}

.premium-badge {
    background: linear-gradient(135deg, #e11d48 0%, #fb7185 100%);
    color: #ffffff;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.empty-pending-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    margin-bottom: 1.75rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: var(--radius-lg, 14px);
    color: var(--text-primary);
}

/* ═══════════════════════════════════════════════
   CUADRÍCULA DE ESTADÍSTICAS DEL PANEL (CARDS)
   ═══════════════════════════════════════════════ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 1180px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card-pro {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.68) 0%, rgba(15, 23, 42, 0.84) 100%);
    border: 1px solid rgba(56, 189, 248, 0.14);
    border-radius: 20px;
    padding: 1.25rem 1.35rem 1.3rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s ease,
                border-color 0.25s ease,
                background 0.25s ease;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .stat-card-pro {
    background: linear-gradient(160deg, #ffffff 0%, #f6f9fe 100%);
    border: 1px solid rgba(22, 109, 176, 0.12);
    box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.07), 0 1px 3px rgba(15, 23, 42, 0.04);
}

.stat-card-pro::before {
    content: '';
    position: absolute;
    top: -45px;
    right: -45px;
    width: 145px;
    height: 145px;
    border-radius: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(22, 109, 176, 0.20) 0%, transparent 70%);
    opacity: 0.18;
    transition: opacity 0.25s ease, background 0.25s ease, transform 0.3s ease;
}

.stat-card-pro:hover,
.stat-card-pro:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px -6px rgba(0, 0, 0, 0.38);
}

[data-theme="light"] .stat-card-pro:hover,
[data-theme="light"] .stat-card-pro:focus-visible {
    box-shadow: 0 16px 32px -10px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.05);
}

.stat-card-pro:hover::before,
.stat-card-pro:focus-visible::before {
    opacity: 0.38;
    transform: scale(1.1);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.stat-card-label {
    font-size: 0.94rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    text-transform: none;
    transition: color 0.2s ease;
}

/* Botón flotante de ícono en esquina superior derecha (azul corporativo en reposo) */
.stat-card-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(22, 109, 176, 0.20);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.22);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.25s ease,
                color 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.25s ease;
}

[data-theme="light"] .stat-card-icon-wrap {
    background: #ffffff;
    color: #166db0;
    border: 1px solid rgba(22, 109, 176, 0.12);
    box-shadow: 0 6px 14px -4px rgba(22, 109, 176, 0.18);
}

.stat-card-pro:hover .stat-card-icon-wrap,
.stat-card-pro:focus-visible .stat-card-icon-wrap {
    transform: scale(1.06);
    color: #ffffff;
    border-color: transparent;
}

/* Fila central: Anillo circular a la izquierda + métricas apiladas a la derecha */
.stat-card-ring-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.stat-ring-box {
    position: relative;
    width: 84px;
    height: 84px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-ring-svg {
    width: 84px;
    height: 84px;
    display: block;
}

.stat-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 7.5;
}

[data-theme="light"] .stat-ring-track {
    stroke: #e8eef6;
}

.stat-ring-fill {
    fill: none;
    stroke: #38bdf8;
    stroke-width: 7.5;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke 0.25s ease, stroke-dashoffset 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .stat-ring-fill {
    stroke: #166db0;
}

.stat-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.stat-ring-pct {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.stat-ring-sub {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: 2px;
    line-height: 1;
}

.stat-metric-stack {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 0;
    flex: 1;
}

.stat-metric-item {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-metric-val {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.08;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.stat-metric-val.secondary {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.stat-metric-lbl {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

/* ── Colores semánticos revelados únicamente al pasar el mouse / foco ── */

/* Presentes (Azul Corporativo intenso) */
.stat-card-pro.blue:hover,
.stat-card-pro.blue:focus-visible {
    border-color: rgba(22, 109, 176, 0.45);
}
.stat-card-pro.blue:hover::before,
.stat-card-pro.blue:focus-visible::before {
    background: radial-gradient(circle, rgba(22, 109, 176, 0.35) 0%, transparent 70%);
}
.stat-card-pro.blue:hover .stat-card-icon-wrap,
.stat-card-pro.blue:focus-visible .stat-card-icon-wrap {
    background: linear-gradient(135deg, #166db0, #0e4f81);
    box-shadow: 0 4px 12px rgba(22, 109, 176, 0.35);
}
.stat-card-pro.blue:hover .stat-ring-fill,
.stat-card-pro.blue:focus-visible .stat-ring-fill {
    stroke: #38bdf8;
}
[data-theme="light"] .stat-card-pro.blue:hover .stat-ring-fill,
[data-theme="light"] .stat-card-pro.blue:focus-visible .stat-ring-fill {
    stroke: #0e4f81;
}

/* Puntuales (Verde Esmeralda en hover) */
.stat-card-pro.green:hover,
.stat-card-pro.green:focus-visible {
    border-color: rgba(16, 185, 129, 0.45);
}
.stat-card-pro.green:hover::before,
.stat-card-pro.green:focus-visible::before {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.35) 0%, transparent 70%);
}
.stat-card-pro.green:hover .stat-card-icon-wrap,
.stat-card-pro.green:focus-visible .stat-card-icon-wrap {
    background: linear-gradient(135deg, #10b981, #059669);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}
.stat-card-pro.green:hover .stat-ring-fill,
.stat-card-pro.green:focus-visible .stat-ring-fill {
    stroke: #34d399;
}
[data-theme="light"] .stat-card-pro.green:hover .stat-ring-fill,
[data-theme="light"] .stat-card-pro.green:focus-visible .stat-ring-fill {
    stroke: #10b981;
}

/* Atrasos (Ámbar en hover) */
.stat-card-pro.yellow:hover,
.stat-card-pro.yellow:focus-visible {
    border-color: rgba(245, 158, 11, 0.45);
}
.stat-card-pro.yellow:hover::before,
.stat-card-pro.yellow:focus-visible::before {
    background: radial-gradient(circle, rgba(245, 158, 11, 0.35) 0%, transparent 70%);
}
.stat-card-pro.yellow:hover .stat-card-icon-wrap,
.stat-card-pro.yellow:focus-visible .stat-card-icon-wrap {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}
.stat-card-pro.yellow:hover .stat-ring-fill,
.stat-card-pro.yellow:focus-visible .stat-ring-fill {
    stroke: #fbbf24;
}
[data-theme="light"] .stat-card-pro.yellow:hover .stat-ring-fill,
[data-theme="light"] .stat-card-pro.yellow:focus-visible .stat-ring-fill {
    stroke: #f59e0b;
}

/* Ausentes (Rojo Carmesí en hover) */
.stat-card-pro.red:hover,
.stat-card-pro.red:focus-visible {
    border-color: rgba(239, 68, 68, 0.45);
}
.stat-card-pro.red:hover::before,
.stat-card-pro.red:focus-visible::before {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.35) 0%, transparent 70%);
}
.stat-card-pro.red:hover .stat-card-icon-wrap,
.stat-card-pro.red:focus-visible .stat-card-icon-wrap {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
}
.stat-card-pro.red:hover .stat-ring-fill,
.stat-card-pro.red:focus-visible .stat-ring-fill {
    stroke: #f87171;
}
[data-theme="light"] .stat-card-pro.red:hover .stat-ring-fill,
[data-theme="light"] .stat-card-pro.red:focus-visible .stat-ring-fill {
    stroke: #ef4444;
}

/* ═══════════════════════════════════════════════
   DISEÑO DE CUADRÍCULA DEL PANEL (CHARTS & LISTS)
   ═══════════════════════════════════════════════ */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.dash-chart-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.75) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 16px);
    padding: 1.5rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25);
    position: relative;
}

[data-theme="light"] .dash-chart-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.9) 100%);
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 6px 20px -2px rgba(15, 23, 42, 0.05);
}

.dash-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .dash-chart-header {
    border-bottom-color: rgba(226, 232, 240, 0.8);
}

.dash-chart-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.dash-controls-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(15, 23, 42, 0.4);
    padding: 0.35rem 0.5rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-wrap: wrap;
}

/* ── Panel Cumplimiento vs Atrasos con doble anillo circular ── */
.compliance-gauge-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    min-height: 210px;
    padding: 0.5rem 0.25rem;
}

.compliance-rings-group {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.compliance-ring-box {
    position: relative;
    width: 98px;
    height: 98px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.2s ease;
}

.compliance-ring-box:hover {
    transform: scale(1.04);
}

.compliance-ring-svg {
    width: 98px;
    height: 98px;
    display: block;
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.compliance-gauge-panel.single-mode {
    justify-content: center;
    gap: 1.75rem;
}

.compliance-gauge-panel.single-mode .compliance-ring-box,
.compliance-gauge-panel.single-mode .compliance-ring-svg {
    width: 152px;
    height: 152px;
}

.compliance-gauge-panel.single-mode .compliance-ring-pct {
    font-size: 1.65rem;
}

.compliance-gauge-panel.single-mode .compliance-ring-sub {
    font-size: 0.82rem;
    margin-top: 4px;
}

.compliance-gauge-panel.single-mode .compliance-metric-val {
    font-size: 2.1rem;
}

.compliance-ring-box.is-hidden,
.compliance-metric-item.is-hidden {
    display: none !important;
}

.compliance-ring-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 9;
}

[data-theme="light"] .compliance-ring-track {
    stroke: #e8eef6;
}

.compliance-ring-fill {
    fill: none;
    stroke-width: 9;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    transition: stroke-dashoffset 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.compliance-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none;
}

.compliance-ring-pct {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.08;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.compliance-ring-sub {
    font-size: 0.66rem;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: 2px;
    line-height: 1;
}

.compliance-metric-stack {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    min-width: 82px;
}

.compliance-metric-item {
    display: flex;
    flex-direction: column;
}

.compliance-metric-val {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.05;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.compliance-metric-lbl {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.compliance-metric-total {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-tertiary);
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

[data-theme="light"] .compliance-metric-total {
    border-top-color: #e2e8f0;
}

@media (max-width: 480px) {
    .compliance-gauge-panel {
        flex-direction: column;
        justify-content: center;
    }
    .compliance-metric-stack {
        flex-direction: row;
        gap: 1.5rem;
        align-items: center;
    }
    .compliance-metric-total {
        border-top: none;
        padding-top: 0;
    }
}

[data-theme="light"] .dash-controls-pill {
    background: rgba(241, 245, 249, 0.85);
    border-color: rgba(203, 213, 225, 0.8);
}

.dash-controls-divider {
    width: 1px;
    height: 18px;
    background: rgba(255, 255, 255, 0.12);
}

[data-theme="light"] .dash-controls-divider {
    background: rgba(203, 213, 225, 1);
}

/* ═══════════════════════════════════════════════
   LISTA DE ACTIVIDAD RECIENTE
   ═══════════════════════════════════════════════ */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.recent-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .recent-item {
    background: rgba(248, 250, 252, 0.7);
    border-color: rgba(226, 232, 240, 0.7);
}

.recent-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateX(4px);
}

[data-theme="light"] .recent-item:hover {
    background: rgba(255, 255, 255, 1);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.recent-item-info {
    flex: 1;
    min-width: 0;
}

.recent-item-info p {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-item-info span {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.recent-item-time {
    font-size: 0.82rem;
    font-weight: 700;
    font-family: 'Inter', monospace;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.22);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   PANTALLA DE RELOJ
   ═══════════════════════════════════════════════ */
.clock-display {
    text-align: center;
    padding: 2rem;
}

.clock-time {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(135deg, var(--primary-300), var(--accent-400));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 8px rgba(99, 102, 241, 0.2));
    line-height: 1.1;
}

.clock-date {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: .5rem;
    font-weight: 500;
}

.clock-status {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: .9rem;
}

/* ═══════════════════════════════════════════════
   BOTÓN DE MARCAR
   ═══════════════════════════════════════════════ */
.mark-btn-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.mark-btn {
    width: 185px;
    height: 185px;
    border-radius: 50%;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--bg-primary);
    cursor: pointer;
    transition: all .35s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    text-transform: uppercase;
    text-align: center;
    padding: 1rem;
    letter-spacing: 0.02em;
}

.mark-btn.entrada {
    background: linear-gradient(135deg, var(--success-500), var(--success-400));
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.4), 0 0 0 0 rgba(16, 185, 129, 0);
}

.mark-btn.entrada:hover {
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.5), 0 0 48px rgba(16, 185, 129, 0.15);
    transform: scale(1.06);
}

.mark-btn.salida {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-400));
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
    color: #fff;
}

.mark-btn.salida:hover {
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5), 0 0 48px rgba(99, 102, 241, 0.15);
    transform: scale(1.06);
}

.mark-btn.salida_almuerzo {
    background: linear-gradient(135deg, var(--warning-500), var(--warning-400));
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.4);
}

.mark-btn.salida_almuerzo:hover {
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.5), 0 0 48px rgba(245, 158, 11, 0.15);
    transform: scale(1.06);
}

.mark-btn.entrada_almuerzo {
    background: linear-gradient(135deg, var(--info-500), var(--info-400));
    box-shadow: 0 8px 32px rgba(14, 165, 233, 0.4);
}

.mark-btn.entrada_almuerzo:hover {
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.5), 0 0 48px rgba(14, 165, 233, 0.15);
    transform: scale(1.06);
}

.mark-btn.completado {
    background: var(--bg-tertiary);
    box-shadow: none;
    cursor: default;
    opacity: .7;
    color: var(--text-secondary);
}

.mark-btn.disabled {
    background: var(--bg-tertiary);
    box-shadow: none;
    cursor: not-allowed;
    opacity: .5;
    color: var(--text-secondary);
}

.mark-btn svg {
    width: 42px;
    height: 42px;
}

/* ── Anillo de Pulso ── */
.mark-btn-pulse {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    border: 2px solid;
    animation: mark-pulse 2.2s ease-in-out infinite;
    opacity: .5;
}

.mark-btn.entrada .mark-btn-pulse {
    border-color: var(--success-400);
}

.mark-btn.salida .mark-btn-pulse {
    border-color: var(--primary-400);
}

.mark-btn.salida_almuerzo .mark-btn-pulse {
    border-color: var(--warning-400);
}

.mark-btn.entrada_almuerzo .mark-btn-pulse {
    border-color: var(--info-400);
}

@keyframes mark-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: .5;
    }

    50% {
        transform: scale(1.12);
        opacity: 0;
    }
}

/* ═══════════════════════════════════════════════
   CALENDARIO
   ═══════════════════════════════════════════════ */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-header {
    text-align: center;
    font-size: .7rem;
    font-weight: 600;
    color: var(--text-tertiary);
    padding: .5rem;
    text-transform: uppercase;
}

.calendar-day {
    text-align: center;
    padding: .5rem .25rem;
    border-radius: var(--radius-sm);
    font-size: .8rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.calendar-day:hover {
    background: var(--bg-hover);
}

.calendar-day.today {
    font-weight: 700;
    color: var(--primary-300);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.2);
}

.calendar-day.other-month {
    color: var(--text-tertiary);
    opacity: .35;
}

.calendar-day .day-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin: 2px auto 0;
}

/* ═══════════════════════════════════════════════
   SECCIÓN BIOMÉTRICA
   ═══════════════════════════════════════════════ */
.bio-section {
    text-align: center;
    padding: 1.5rem;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    margin-top: 1rem;
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.bio-section.active {
    border-color: var(--success-500);
    border-style: solid;
    background: rgba(16, 185, 129, 0.04);
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.08);
}

.bio-section.inactive {
    border-color: var(--warning-500);
    background: rgba(245, 158, 11, 0.04);
}

/* Efecto de barrido del escáner cuando está activo */
.bio-section.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--success-400) 50%, transparent 100%);
    animation: scanner-sweep 2.5s ease-in-out infinite;
    opacity: 0.7;
}

@keyframes scanner-sweep {
    0% {
        top: 0;
        opacity: 0.7;
    }

    50% {
        top: calc(100% - 3px);
        opacity: 0.4;
    }

    100% {
        top: 0;
        opacity: 0.7;
    }
}

.bio-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-400);
    position: relative;
    z-index: 1;
    transition: all var(--transition-base);
}

.bio-icon.success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success-400);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.15);
}

.fingerprint-animation {
    animation: fingerprint-scan 2s ease-in-out infinite;
}

@keyframes fingerprint-scan {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: .6;
        transform: scale(.95);
    }
}


/* ═══════════════════════════════════════════════
   MÓDULO DE CONFIGURACIÓN — ENTERPRISE GLASSMORPHISM
   ═══════════════════════════════════════════════ */
.cfg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .cfg-grid {
        grid-template-columns: 1fr;
    }
    .cfg-span-2 {
        grid-column: span 1 !important;
    }
}

.cfg-span-2 {
    grid-column: span 2;
}

.cfg-section-banner {
    grid-column: span 2;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: -0.25rem;
    padding: 0 0.25rem;
}

@media (max-width: 1024px) {
    .cfg-section-banner {
        grid-column: span 1;
    }
}

.cfg-section-banner-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.25), transparent);
}

.cfg-section-banner-title {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.cfg-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.55) 0%, rgba(15, 23, 42, 0.78) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg, 16px);
    padding: 1.5rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

[data-theme="light"] .cfg-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.92) 100%);
    border-color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 6px 20px -2px rgba(15, 23, 42, 0.05);
}

.cfg-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] .cfg-card:hover {
    border-color: rgba(148, 163, 184, 0.45);
}

.cfg-card::before {
    display: none;
}

.card-stat::before {
    display: none !important;
}

.cfg-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

[data-theme="light"] .cfg-card-header {
    border-bottom-color: rgba(226, 232, 240, 0.85);
}

.cfg-card-title-group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.cfg-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.22);
}

.cfg-icon-box.emerald { background: rgba(52, 211, 153, 0.12); color: #34d399; border-color: rgba(52, 211, 153, 0.22); }
.cfg-icon-box.amber { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border-color: rgba(251, 191, 36, 0.22); }
.cfg-icon-box.indigo { background: rgba(129, 140, 248, 0.12); color: #818cf8; border-color: rgba(129, 140, 248, 0.22); }
.cfg-icon-box.rose { background: rgba(251, 113, 133, 0.12); color: #fb7185; border-color: rgba(251, 113, 133, 0.22); }

.cfg-card-title {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.25;
}

.cfg-card-subtitle {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin: 0.2rem 0 0 0;
}

.cfg-subpanel {
    background: rgba(15, 23, 42, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 1.1rem 1.25rem;
}

[data-theme="light"] .cfg-subpanel {
    background: rgba(241, 245, 249, 0.7);
    border-color: rgba(203, 213, 225, 0.75);
}

.cfg-table-container {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.25);
}

[data-theme="light"] .cfg-table-container {
    border-color: rgba(226, 232, 240, 0.9);
    background: rgba(255, 255, 255, 0.7);
}

.cfg-table-head {
    background: rgba(15, 23, 42, 0.55);
}

[data-theme="light"] .cfg-table-head {
    background: rgba(241, 245, 249, 0.9);
}

/* ═══════════════════════════════════════════════
   MÓDULO DE REPORTES — ENTERPRISE BENTO UI
   ═══════════════════════════════════════════════ */
.rep-tabs-wrapper {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.35rem;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    margin-bottom: 1.5rem;
}

[data-theme="light"] .rep-tabs-wrapper {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(203, 213, 225, 0.85);
}

.rep-tabs-wrapper .tab-btn {
    border-radius: 10px !important;
    padding: 0.55rem 1.15rem !important;
    font-size: 0.86rem !important;
    font-weight: 600 !important;
    border: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.rep-tabs-wrapper .tab-btn.active {
    background: linear-gradient(135deg, #166db0 0%, #0e4f81 100%) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(22, 109, 176, 0.35) !important;
}

.rep-filter-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.55) 0%, rgba(15, 23, 42, 0.78) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 1.35rem 1.5rem;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.22);
    position: relative;
    z-index: 50;
    overflow: visible;
    margin-bottom: 1.25rem;
}

[data-theme="light"] .rep-filter-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.95) 100%);
    border-color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 6px 20px -2px rgba(15, 23, 42, 0.05);
}

.rep-summary-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.65) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

[data-theme="light"] .rep-summary-bar {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

.rep-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

[data-theme="light"] .rep-pill-btn {
    background: rgba(241, 245, 249, 0.9);
    border-color: rgba(203, 213, 225, 0.8);
    color: #334155;
}

.rep-pill-btn:hover {
    background: #475569 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.2);
}

.rep-pill-btn strong {
    font-weight: 700;
}

.rep-pill-btn.active-total,
.rep-pill-btn.active-puntual,
.rep-pill-btn.active-atraso,
.rep-pill-btn.active-vacio {
    background: linear-gradient(135deg, #166db0 0%, #0e4f81 100%) !important;
    border-color: #0e4f81 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(22, 109, 176, 0.3);
}

.rep-pill-btn.active-total:hover,
.rep-pill-btn.active-puntual:hover,
.rep-pill-btn.active-atraso:hover,
.rep-pill-btn.active-vacio:hover {
    background: #475569 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
}

.rep-toolbar-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    margin-bottom: 1rem;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.65) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

[data-theme="light"] .rep-toolbar-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
}

/* Botones de acción unificados en Reportes (Tema Azul + Hover Gris Profesional) */
.rep-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.48rem 0.95rem;
    font-size: 0.83rem;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, #166db0 0%, #0e4f81 100%);
    border: 1px solid #0e4f81;
    color: #ffffff !important;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(22, 109, 176, 0.28);
    text-decoration: none;
    line-height: 1.4;
    user-select: none;
}

.rep-action-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.rep-action-btn:hover {
    background: #475569 !important;
    border-color: #334155 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(51, 65, 85, 0.25);
}

.rep-action-btn:hover svg {
    transform: scale(1.08);
}

.rep-action-btn:active {
    background: #1e293b !important;
    border-color: #0f172a !important;
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Acciones destructivas diferenciadas por severidad (Heurística de Prevención de Errores) */
.rep-action-danger {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(248, 113, 113, 0.4);
    color: #fca5a5 !important;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.12);
}

[data-theme="light"] .rep-action-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c !important;
}

.rep-action-danger:hover {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.rep-action-critical {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    border-color: #991b1b;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(185, 28, 28, 0.3);
}

.rep-action-critical:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%) !important;
    border-color: #7f1d1d !important;
    color: #ffffff !important;
    box-shadow: 0 6px 14px rgba(153, 27, 27, 0.38);
}

/* Botones dedicados de Exportación (Excel / PDF): limpios en reposo, pill completo al hover */
.rep-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.34rem 0.85rem 0.34rem 0.42rem;
    font-size: 0.84rem;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.12s ease;
    line-height: 1.3;
    user-select: none;
    background: transparent;
    border: 1px solid transparent;
    box-shadow: none;
}

.rep-export-icon-box {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
    transition: background 0.2s ease, transform 0.2s ease;
}

.rep-export-icon-img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}

.rep-export-btn:hover .rep-export-icon-img {
    transform: scale(1.08);
}

/* Variante Excel */
.rep-export-excel {
    color: #4ade80;
}

[data-theme="light"] .rep-export-excel {
    color: #15803d;
}

.rep-export-excel:hover,
[data-theme="light"] .rep-export-excel:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    border-color: #15803d;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(21, 128, 61, 0.32);
}

.rep-export-excel:hover .rep-export-icon-box,
[data-theme="light"] .rep-export-excel:hover .rep-export-icon-box {
    background: rgba(255, 255, 255, 0.95);
}

/* Variante PDF */
.rep-export-pdf {
    color: #f87171;
}

[data-theme="light"] .rep-export-pdf {
    color: #b91c1c;
}

.rep-export-pdf:hover,
[data-theme="light"] .rep-export-pdf:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(220, 38, 38, 0.32);
}

.rep-export-pdf:hover .rep-export-icon-box,
[data-theme="light"] .rep-export-pdf:hover .rep-export-icon-box {
    background: rgba(255, 255, 255, 0.95);
}

.rep-export-btn:active {
    transform: translateY(0);
}


/* ═══════════════════════════════════════════════
   REDISEÑO DE MODALES Y FORMULARIOS (SOFT BENTO)
   ═══════════════════════════════════════════════ */
.modal-backdrop {
    background: rgba(2, 6, 23, 0.68) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    padding: 1.25rem !important;
}

[data-theme="light"] .modal-backdrop {
    background: rgba(15, 23, 42, 0.45) !important;
}

.modal {
    background: linear-gradient(160deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 22px !important;
    box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    overflow-x: hidden;
}

[data-theme="light"] .modal {
    background: #ffffff !important;
    border: 1px solid rgba(226, 232, 240, 0.95) !important;
    box-shadow: 0 24px 55px -12px rgba(15, 23, 42, 0.18), 0 4px 16px -2px rgba(15, 23, 42, 0.06) !important;
}

.modal-header {
    padding: 1.35rem 1.75rem !important;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

[data-theme="light"] .modal-header {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0 !important;
}

.modal-header h3 {
    font-size: 1.12rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
}

.modal-header h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    border-radius: 99px;
    background: linear-gradient(180deg, #2563eb, #0ea5e9);
    flex-shrink: 0;
}

.modal-header .btn-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    background: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-secondary) !important;
    transition: all 0.2s ease !important;
}

.modal-header .btn-icon:hover {
    background: rgba(239, 68, 68, 0.14) !important;
    color: #ef4444 !important;
    transform: none !important;
}

.modal-body {
    padding: 1.5rem 1.75rem !important;
}

.modal-body .form-group {
    margin-bottom: 1.15rem;
}

.modal-body .form-label {
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.055em !important;
    text-transform: uppercase;
    color: var(--text-secondary) !important;
    margin-bottom: 0.42rem !important;
}

.modal-body .form-input,
.modal-body .form-select,
.modal-body .form-textarea,
.modal-body textarea.form-input {
    border-radius: 12px !important;
    padding: 0.68rem 0.95rem !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
    background: rgba(15, 23, 42, 0.55) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
    color: var(--text-primary) !important;
    transition: all 0.2s ease !important;
}

[data-theme="light"] .modal-body .form-input,
[data-theme="light"] .modal-body .form-select,
[data-theme="light"] .modal-body .form-textarea,
[data-theme="light"] .modal-body textarea.form-input {
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
}

.modal-body .form-input:focus,
.modal-body .form-select:focus,
.modal-body .form-textarea:focus,
.modal-body textarea.form-input:focus {
    border-color: #2563eb !important;
    background: rgba(15, 23, 42, 0.85) !important;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.16) !important;
}

[data-theme="light"] .modal-body .form-input:focus,
[data-theme="light"] .modal-body .form-select:focus,
[data-theme="light"] .modal-body .form-textarea:focus,
[data-theme="light"] .modal-body textarea.form-input:focus {
    background: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.14) !important;
}

.modal-footer {
    padding: 1.1rem 1.75rem !important;
    background: rgba(15, 23, 42, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
    border-radius: 0 0 22px 22px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}

[data-theme="light"] .modal-footer {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0 !important;
}

/* Selector segmentado limpio dentro de modales */
.modal-segment-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.35rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .modal-segment-group {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.modal-segment-option {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    margin: 0;
    transition: all 0.18s ease;
    border: 1px solid transparent;
}

.modal-segment-option:has(input:checked) {
    background: rgba(37, 99, 235, 0.18);
    color: #60a5fa;
    border-color: rgba(59, 130, 246, 0.35);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .modal-segment-option:has(input:checked) {
    background: #ffffff;
    color: #1d4ed8;
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
}

.modal-subcard {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1rem;
}

[data-theme="light"] .modal-subcard {
    background: #f8fafc;
    border-color: #e2e8f0;
}

/* ── Tarjetas KPI clicables y Modal de Detalle Rápido ── */
.stat-card-clickable {
    cursor: pointer;
    user-select: none;
}

.stat-card-clickable:focus-visible {
    outline: 2px solid #166db0;
    outline-offset: 2px;
}

.stat-card-hint {
    font-size: 0.74rem;
    font-weight: 600;
    color: #166db0;
    opacity: 0.75;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    white-space: nowrap;
    flex-shrink: 0;
    transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] .stat-card-hint,
:root:not([data-theme="light"]) .stat-card-hint {
    color: #38bdf8;
}

.stat-card-clickable:hover .stat-card-hint,
.stat-card-clickable:focus-visible .stat-card-hint {
    opacity: 1;
    transform: translateX(2px);
}

.kpi-modal-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.kpi-modal-toolbar .form-input {
    flex: 1;
    min-width: 200px;
}

.kpi-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 52vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.kpi-detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    padding: 0.7rem 0.9rem;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.kpi-detail-row:hover {
    background: rgba(30, 41, 59, 0.65);
    border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="light"] .kpi-detail-row {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme="light"] .kpi-detail-row:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.kpi-detail-emp {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.kpi-detail-emp-info {
    min-width: 0;
}

.kpi-detail-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-detail-sub {
    font-size: 0.76rem;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.kpi-detail-time {
    font-family: monospace;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kpi-detail-delay {
    font-size: 0.73rem;
    font-weight: 700;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.14);
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
}
