@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700&display=swap');

:root {
    --bg-primary: #fafafa;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: rgba(15, 23, 42, 0.04);
    --border-subtle: rgba(0, 0, 0, 0.07);
    --border-hover: rgba(0, 0, 0, 0.14);

    --text-primary: #0a0a0a;
    --text-secondary: #52525b;
    --text-muted: #8b8b93;

    --accent: #2563eb;
    --accent-glow: rgba(37, 99, 235, 0.18);
    --accent-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);

    --status-success: #16a34a;
    --status-warning: #d97706;
    --status-danger: #dc2626;
    --status-info: #0284c7;

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="dark"] {
    --bg-primary: #060709;
    --bg-surface: #0e1015;
    --bg-elevated: #141720;
    --bg-card: #0e121b;
    --bg-hover: rgba(255, 255, 255, 0.04);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);

    --text-primary: #f8fafc;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.28);
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);

    --status-success: #22c55e;
    --status-warning: #f59e0b;
    --status-danger: #ef4444;
    --status-info: #38bdf8;
}

* {
    box-sizing: border-box;
}

body {
    background:
        radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(124, 58, 237, 0.03) 0%, transparent 40%),
        var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    letter-spacing: -0.01em;
    margin: 0;
    min-height: 100vh;
    transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}

[data-theme="dark"] body {
    background:
        radial-gradient(circle at 15% 0%, rgba(59, 130, 246, 0.07) 0%, transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(139, 92, 246, 0.05) 0%, transparent 45%),
        #060709;
    color: var(--text-primary);
}

/* ==========================================================================
   ATMÓSFERA AMBIENTAL GLOBAL (CONTINUIDAD VISUAL INMERSIVA)
   ========================================================================== */
.cca-global-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transition: opacity 0.4s ease;
}

/* Cuadrícula táctica sutil */
.cca-global-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 25%, rgba(0, 0, 0, 0.9) 0%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 25%, rgba(0, 0, 0, 0.9) 0%, transparent 85%);
}

/* Orbes ambientales difuminados y optimizados con GPU */
.cca-global-glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    will-change: transform;
    transform: translate3d(0, 0, 0);
    opacity: 0.18;
    animation: globalOrbFloat 22s ease-in-out infinite alternate;
}

.cca-global-glow-orb--violet {
    width: 600px;
    height: 600px;
    top: -120px;
    left: 20%;
    background: radial-gradient(circle, #7c3aed 0%, rgba(124, 58, 237, 0) 70%);
}

.cca-global-glow-orb--indigo {
    width: 650px;
    height: 650px;
    bottom: -150px;
    right: 5%;
    background: radial-gradient(circle, #4f46e5 0%, rgba(79, 70, 229, 0) 70%);
    animation-duration: 28s;
    animation-delay: -7s;
}

@keyframes globalOrbFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(50px, -35px, 0) scale(1.06); }
    100% { transform: translate3d(-40px, 45px, 0) scale(0.95); }
}

/* Comportamiento en Modo Claro */
[data-theme="light"] .cca-global-atmosphere {
    opacity: 0.05; /* Se atenúa casi por completo para no ensuciar fondos claros */
}

h1,
h2,
h3,
h4 {
    font-family: 'Manrope', sans-serif;
    letter-spacing: -0.02em;
    font-weight: 600;
}

/* --- Superficie con glassmorphism --- */
.cca-glass {
    background: #ffffff;
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 20px;
    box-shadow:
        0 0 0 1px rgba(37, 99, 235, 0.1),
        0 0 40px rgba(37, 99, 235, 0.15),
        0 20px 50px rgba(0, 0, 0, 0.12);
}

.cca-glass:hover {
    border-color: var(--border-hover);
}

/* ==========================================================================
   SIDEBAR CONSOLA OSCURA PREMIUM (COCKPIT HÍBRIDO)
   ========================================================================== */
.cca-sidebar {
    background: #080a10 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.4) !important;
    color: #94a3b8;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(16px);
    padding: 1.25rem 1.1rem;
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    transition: width 0.2s var(--ease);
    z-index: 100;
}

/* Borde y sombra nítida cuando el contenido está en Modo Claro */
[data-theme="light"] .cca-sidebar {
    border-right: 1px solid rgba(15, 23, 42, 0.12) !important;
    box-shadow: 6px 0 28px rgba(15, 23, 42, 0.08) !important;
}

/* Microinteracción de deslizamiento en enlaces inactivos */
.cca-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: #94a3b8;
    text-decoration: none;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.15rem;
    font-size: 0.88rem;
    transition: background-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.cca-sidebar a:hover {
    transform: translateX(3px);
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: #ffffff !important;
}

/* Ítem Activo con Bisel y Resplandor Multicapa */
.cca-sidebar a.active {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
    box-shadow: 0 4px 18px rgba(124, 58, 237, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28) !important;
    color: #ffffff !important;
    transform: none !important;
}

/* --- Acordeón de Categorías en Sidebar --- */
.cca-sidebar__category {
    margin-bottom: 0.35rem;
}

.cca-sidebar__category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: transparent;
    border: none;
    color: #64748b;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.cca-sidebar__category-header:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.03);
}

.cca-sidebar__category.is-open .cca-sidebar__category-header {
    color: #94a3b8;
}

.cca-sidebar__category-title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.cca-sidebar__category-title i {
    font-size: 0.78rem;
    width: 16px;
    text-align: center;
    color: #475569;
    transition: color 0.2s var(--ease);
}

.cca-sidebar__category.is-open .cca-sidebar__category-title i,
.cca-sidebar__category-header:hover .cca-sidebar__category-title i {
    color: var(--accent);
}

.cca-sidebar__category-chevron {
    font-size: 0.62rem;
    color: #475569;
    transition: transform 0.25s var(--ease), color 0.2s var(--ease);
}

.cca-sidebar__category.is-open .cca-sidebar__category-chevron {
    transform: rotate(90deg);
    color: #94a3b8;
}

.cca-sidebar__category-items {
    display: none;
    flex-direction: column;
    padding-left: 0.4rem;
    margin-left: 0.65rem;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    margin-top: 0.15rem;
    margin-bottom: 0.25rem;
}

.cca-sidebar__category.is-open .cca-sidebar__category-items {
    display: flex;
    animation: ccaSidebarFadeIn 0.2s ease-out;
}

.cca-sidebar__category-items a {
    padding: 0.45rem 0.75rem;
    font-size: 0.87rem;
    margin-bottom: 0.1rem;
}

@keyframes ccaSidebarFadeIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Flyout title oculto en modo normal/expandido */
.cca-sidebar__flyout-title {
    display: none;
}


.cca-main {
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

/* --- Tarjetas --- */
.cca-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 10px 24px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    transition: border-color 0.2s var(--ease), box-shadow 0.25s var(--ease), transform 0.2s var(--ease);
}

.cca-card:hover {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1), 0 0 30px rgba(37, 99, 235, 0.12), 0 10px 24px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.cca-kpi__value {
    font-family: 'Manrope', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cca-kpi__label {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 0.3rem;
}

/* --- Badges --- */
.cca-badge {
    display: inline-block;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.cca-badge--success {
    background: rgba(16, 185, 129, 0.14);
    color: #047857;
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.35);
}

.cca-badge--warning {
    background: rgba(245, 158, 11, 0.14);
    color: #b45309;
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
}

.cca-badge--danger {
    background: rgba(239, 68, 68, 0.14);
    color: #b91c1c;
    border-color: rgba(239, 68, 68, 0.4);
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
}

.cca-badge--info {
    background: rgba(59, 130, 246, 0.14);
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
}

.cca-badge--neutral {
    background: rgba(113, 113, 122, 0.14);
    color: #3f3f46;
    border-color: rgba(113, 113, 122, 0.4);
    box-shadow: 0 0 18px rgba(113, 113, 122, 0.35);
}

.cca-badge--purple {
    background: rgba(124, 58, 237, 0.14) !important;
    color: #581c87 !important;
    border-color: rgba(124, 58, 237, 0.45) !important;
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.22);
}

.cca-card a[href] {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s var(--ease), text-shadow 0.2s var(--ease);
}

.cca-card a[href]:hover {
    color: var(--accent);
    text-shadow: 0 0 12px rgba(37, 99, 235, 0.4);
}

.cca-btn,
.cca-btn--outline {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* --- Progreso --- */
.cca-progress {
    background: rgba(0, 0, 0, 0.06);
    border-radius: 999px;
    height: 6px;
    overflow: hidden;
}

.cca-progress__fill {
    background: var(--accent-gradient);
    height: 100%;
    border-radius: 999px;
    transition: width 0.4s var(--ease);
}

/* --- Formularios --- */
.cca-input {
    background: #ffffff;
    border: 2px solid rgba(15, 23, 42, 0.15);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.9rem;
    width: 100%;
    font-size: 0.9rem;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.cca-input::placeholder {
    color: var(--text-muted);
}

.cca-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.cca-btn {
    background: #0a0a0a;
    color: #fff;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0.7rem 1.2rem;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15), 0 0 20px rgba(37, 99, 235, 0.25);
    transition: box-shadow 0.25s var(--ease), transform 0.2s var(--ease);
}

.cca-btn:hover {
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4), 0 0 30px rgba(37, 99, 235, 0.5);
    transform: translateY(-1px);
}

.cca-btn i {
    color: var(--accent);
}

.cca-btn--primary {
    background: #0f172a;
    color: #ffffff;
}

.cca-btn--primary:hover {
    background: #1e293b;
    color: #ffffff;
}

.cca-btn--outline {
    background: transparent;
    border: 2px solid #0f172a;
    color: #0f172a;
    font-weight: 700;
}

.cca-btn--outline:hover {
    border-color: #0f172a;
    background: #09090b;
    color: #ffffff;
}

select.cca-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a1a1aa' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.2rem;
    cursor: pointer;
}

select.cca-input option {
    background-color: var(--bg-elevated);
    color: var(--text-primary);
}



/* --- Date picker oscuro --- */
input[type="date"].cca-input {
    color-scheme: light;
}

/* El ícono del calendario nativo hereda el filtro de color-scheme,
   pero por si algún navegador no lo respeta del todo: */
input[type="date"].cca-input::-webkit-calendar-picker-indicator {
    filter: none;
    cursor: pointer;
}

.cca-sidebar__toggle {
    position: absolute;
    top: 1.2rem;
    right: -12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #1e293b;
    border: 1px solid var(--border-subtle);
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
    z-index: 10;
}

.cca-sidebar__toggle:hover {
    background: rgba(0, 0, 0, 0.08);
}

/* --- Estado colapsado --- */
body.cca-sidebar-collapsed .cca-sidebar {
    width: 76px !important;
    padding: 1.25rem 0.4rem !important;
    overflow: visible !important;
    z-index: 1000 !important;
}

body.cca-sidebar-collapsed .cca-sidebar__nav {
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

body.cca-sidebar-collapsed .cca-sidebar__brand-text,
body.cca-sidebar-collapsed .cca-sidebar__user-info,
body.cca-sidebar-collapsed .cca-sidebar__recorder-btn span {
    display: none !important;
}

/* --- Brand / Logo Horizontal en Sidebar --- */
.cca-sidebar__brand {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.35rem 0.4rem !important;
    margin-bottom: 1.85rem !important;
    text-decoration: none !important;
    border-radius: var(--radius-sm) !important;
    transition: all 0.2s var(--ease) !important;
    user-select: none !important;
}

.cca-sidebar__brand:hover {
    background: rgba(255, 255, 255, 0.04) !important;
}

.cca-sidebar__brand-icon {
    width: 38px !important;
    height: 38px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
    filter: drop-shadow(0 2px 8px rgba(124, 58, 237, 0.28)) !important;
    transition: transform 0.2s var(--ease) !important;
}

.cca-sidebar__brand:hover .cca-sidebar__brand-icon {
    transform: scale(1.05) !important;
}

.cca-sidebar__brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    line-height: 1.15;
}

.cca-sidebar__brand-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.015em;
    white-space: nowrap;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.cca-sidebar__brand-sub {
    font-size: 0.62rem;
    font-weight: 600;
    color: #a78bfa;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-top: 2px;
    white-space: nowrap;
}

/* Compatibilidad anterior */
.cca-sidebar__logo-full { display: block; }
.cca-sidebar__logo-icon { display: none; }

/* Logo: contraído → centrado y solo icono */
body.cca-sidebar-collapsed .cca-sidebar__brand {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 0.25rem 0 !important;
    margin-bottom: 1.6rem !important;
    width: 100% !important;
}

body.cca-sidebar-collapsed .cca-sidebar__brand-icon {
    width: 36px !important;
    height: 36px !important;
    margin: 0 auto !important;
}

body.cca-sidebar-collapsed .cca-sidebar__logo-full { display: none; }
body.cca-sidebar-collapsed .cca-sidebar__logo-icon { display: block; }

/* --- Categorías en modo contraído: Iconos centrados 44x44 --- */
body.cca-sidebar-collapsed .cca-sidebar__category {
    position: relative !important;
    display: flex !important;
    justify-content: center !important;
    width: 100% !important;
    margin-bottom: 0.5rem !important;
    z-index: 10;
}

body.cca-sidebar-collapsed .cca-sidebar__category:hover {
    z-index: 99;
}

body.cca-sidebar-collapsed .cca-sidebar__category-header {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.07) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-header:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.18) !important;
    transform: translateY(-1px);
}

body.cca-sidebar-collapsed .cca-sidebar__category-header:hover .cca-sidebar__category-title i {
    color: #ffffff !important;
}

/* Categoría activa destacada */
body.cca-sidebar-collapsed .cca-sidebar__category.is-active-category .cca-sidebar__category-header {
    background: var(--accent-gradient) !important;
    border-color: transparent !important;
    box-shadow: 0 4px 16px var(--accent-glow) !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category.is-active-category .cca-sidebar__category-title i {
    color: #ffffff !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-title {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    width: 100% !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-title i {
    font-size: 1.1rem !important;
    margin: 0 !important;
    width: auto !important;
    color: #94a3b8;
    transition: color 0.2s var(--ease);
}

body.cca-sidebar-collapsed .cca-sidebar__category-name,
body.cca-sidebar-collapsed .cca-sidebar__category-chevron {
    display: none !important;
}

/* --- Flyout flotante elegante al pasar el mouse por la categoría --- */
body.cca-sidebar-collapsed .cca-sidebar__category-items {
    display: none !important;
    position: absolute !important;
    left: 100% !important;
    top: -4px !important;
    margin-left: 10px !important;
    min-width: 220px !important;
    width: max-content !important;
    max-width: 280px !important;
    background: #0b0f19 !important;
    backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    padding: 0.6rem !important;
    z-index: 99999 !important;
    flex-direction: column !important;
    border-left: none !important;
}

/* Puente invisible anti-dropout entre el botón y el flyout */
body.cca-sidebar-collapsed .cca-sidebar__category-items::before {
    content: '';
    position: absolute;
    top: 0;
    left: -14px;
    width: 16px;
    height: 100%;
}

/* Despliegue con microanimación */
body.cca-sidebar-collapsed .cca-sidebar__category:hover .cca-sidebar__category-items {
    display: flex !important;
    animation: ccaFlyoutFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes ccaFlyoutFadeIn {
    from {
        opacity: 0;
        transform: translateX(-6px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Cabecera del flyout */
body.cca-sidebar-collapsed .cca-sidebar__flyout-title {
    display: flex !important;
    align-items: center !important;
    gap: 0.55rem !important;
    padding: 0.4rem 0.65rem 0.5rem 0.65rem !important;
    margin-bottom: 0.35rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    color: #a78bfa !important;
    white-space: nowrap !important;
}

body.cca-sidebar-collapsed .cca-sidebar__flyout-title i {
    font-size: 0.8rem !important;
    color: #a78bfa !important;
}

/* Items individuales dentro del Flyout */
body.cca-sidebar-collapsed .cca-sidebar__category-items a {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: auto !important;
    padding: 0.55rem 0.75rem !important;
    margin: 0.1rem 0 !important;
    border-radius: 8px !important;
    gap: 0.7rem !important;
    color: #cbd5e1 !important;
    font-size: 0.86rem !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: all 0.15s ease !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-items a i {
    font-size: 0.9rem !important;
    width: 18px !important;
    text-align: center !important;
    color: #94a3b8 !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-items a .cca-sidebar__label {
    display: inline !important;
    color: inherit !important;
    white-space: nowrap !important;
    flex-grow: 1 !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-items a .cca-sidebar__badge {
    display: inline-flex !important;
    margin-left: auto !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-items a:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-items a:hover i {
    color: #ffffff !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-items a.active {
    background: var(--accent-gradient) !important;
    color: #ffffff !important;
    box-shadow: 0 3px 12px var(--accent-glow) !important;
}

body.cca-sidebar-collapsed .cca-sidebar__category-items a.active i {
    color: #ffffff !important;
}

body.cca-sidebar-collapsed .cca-sidebar__toggle i {
    transform: rotate(180deg);
}

/* Evita el "flash" de contenido sin transición en la primera carga */
body:not(.cca-sidebar-ready) .cca-sidebar {
    transition: none;
}

/* ==========================================================================
   NOTIFICACIONES TOAST PREMIUM (GLASSMORPHISM DE CLASE MUNDIAL)
   ========================================================================== */
#cca-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.cca-toast {
    pointer-events: auto;
    min-width: 320px;
    max-width: 420px;
    padding: 0.95rem 1.25rem;
    border-radius: 14px;
    background: rgba(14, 18, 27, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 0.85rem;
    color: #f8fafc;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.cca-toast.removing {
    animation: toastSlideOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Bisel superior iluminado según el tipo de toast */
.cca-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1.5px;
    background: var(--toast-accent, #8b5cf6);
    box-shadow: 0 0 10px var(--toast-accent, #8b5cf6);
}

/* Variantes cromáticas */
.cca-toast--success {
    --toast-accent: #10b981;
    border-color: rgba(16, 185, 129, 0.25);
}

.cca-toast--success .cca-toast-icon {
    color: #34d399;
    background: rgba(16, 185, 129, 0.12);
}

.cca-toast--error {
    --toast-accent: #ef4444;
    border-color: rgba(239, 68, 68, 0.28);
}

.cca-toast--error .cca-toast-icon {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
}

.cca-toast--warning {
    --toast-accent: #f59e0b;
    border-color: rgba(245, 158, 11, 0.28);
}

.cca-toast--warning .cca-toast-icon {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.12);
}

.cca-toast--info {
    --toast-accent: #6366f1;
    border-color: rgba(99, 102, 241, 0.25);
}

.cca-toast--info .cca-toast-icon {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.12);
}

/* Icono contenedor en pastilla circular */
.cca-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Modo claro para los toasts */
[data-theme="light"] .cca-toast {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    border-color: rgba(226, 232, 240, 0.9);
    box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.12);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastSlideOut {
    to {
        opacity: 0;
        transform: translateX(20px) scale(0.95);
    }
}

/* --- Modal de confirmación --- */
#cca-confirm-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

#cca-confirm-modal .cca-glass {
    max-width: 400px;
    width: 100%;
    padding: 1.8rem;
}

.cca-multiselect {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 0.4rem;
    max-height: 220px;
    overflow-y: auto;
}

.cca-multiselect__item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.87rem;
    color: var(--text-secondary);
    transition: background-color 0.15s var(--ease);
}

.cca-multiselect__item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.cca-multiselect__item input[type="checkbox"] {
    display: none;
}

.cca-multiselect__check {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid var(--border-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease);
}

.cca-multiselect__check i {
    font-size: 0.62rem;
    color: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s var(--ease), transform 0.15s var(--ease);
}

.cca-multiselect__item input:checked~.cca-multiselect__check {
    background: var(--accent-gradient);
    border-color: transparent;
}

.cca-multiselect__item input:checked~.cca-multiselect__check i {
    opacity: 1;
    transform: scale(1);
}

.cca-multiselect__item input:checked~span:last-child {
    color: var(--text-primary);
}

.cca-tab {
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
}

.cca-tab:hover {
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.cca-tab--active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
}

/* --- KPIs --- */
.cca-kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    border-top: 3px solid transparent;
    padding: 1.4rem 1.5rem;
    position: relative;
    transition: transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}

.cca-kpi-card:hover {
    transform: translateY(-3px);
}

.cca-kpi-card__icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.cca-kpi-card--blue {
    border-top-color: #2563eb;
}

.cca-kpi-card--blue .cca-kpi-card__icon {
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.3);
}

.cca-kpi-card--blue:hover {
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15), 0 0 30px rgba(37, 99, 235, 0.2);
}

.cca-kpi-card--amber {
    border-top-color: #d97706;
}

.cca-kpi-card--amber .cca-kpi-card__icon {
    background: rgba(217, 119, 6, 0.1);
    color: #d97706;
    box-shadow: 0 0 16px rgba(217, 119, 6, 0.3);
}

.cca-kpi-card--amber:hover {
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.15), 0 0 30px rgba(217, 119, 6, 0.2);
}

.cca-kpi-card--purple {
    border-top-color: #7c3aed;
}

.cca-kpi-card--purple .cca-kpi-card__icon {
    background: rgba(124, 58, 237, 0.1);
    color: #7c3aed;
    box-shadow: 0 0 16px rgba(124, 58, 237, 0.3);
}

.cca-kpi-card--purple:hover {
    box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.15), 0 0 30px rgba(124, 58, 237, 0.2);
}

.cca-kpi-card--red {
    border-top-color: #dc2626;
}

.cca-kpi-card--red .cca-kpi-card__icon {
    background: rgba(220, 38, 38, 0.1);
    color: #dc2626;
    box-shadow: 0 0 16px rgba(220, 38, 38, 0.3);
}

.cca-kpi-card--red:hover {
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15), 0 0 30px rgba(220, 38, 38, 0.2);
}

.cca-kpi-card--pink {
    border-top-color: #db2777;
}

.cca-kpi-card--pink .cca-kpi-card__icon {
    background: rgba(219, 39, 119, 0.1);
    color: #db2777;
    box-shadow: 0 0 16px rgba(219, 39, 119, 0.3);
}

.cca-kpi-card--pink:hover {
    box-shadow: 0 0 0 1px rgba(219, 39, 119, 0.15), 0 0 30px rgba(219, 39, 119, 0.2);
}

.cca-alert-banner {
    position: relative;
    background: rgba(220,38,38,.03);
    border: 1px solid rgba(220,38,38,.1);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 1px rgba(220,38,38,.06), 0 0 40px rgba(220,38,38,.1);
    padding: 1.1rem 1.5rem 1.1rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.cca-alert-banner::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 10px;
    bottom: 10px;
    width: 4px;
    border-radius: 999px;
    background: #dc2626;
    box-shadow: 0 0 10px rgba(220,38,38,.6);
}

.cca-list-row {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 0.8rem 0.6rem;
    margin: 0 -0.6rem;
    border-radius: 8px;
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.15s var(--ease);
}

.cca-list-row:hover {
    background: rgba(37,99,235,0.03);
}

.cca-list-row:last-child {
    border-bottom: none;
}

/* --- Botón Launcher Recorder Pro --- */
.cca-sidebar__recorder-btn {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.52rem 0.85rem;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.035) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s var(--ease);
    box-shadow: none !important;
}

.cca-sidebar__recorder-btn i {
    font-size: 0.82rem;
    color: #f43f5e;
    filter: drop-shadow(0 0 6px rgba(244, 63, 94, 0.5));
    transition: transform 0.2s ease;
}

.cca-sidebar__recorder-btn .cca-recorder-ext-icon {
    margin-left: auto;
    font-size: 0.68rem;
    color: #64748b;
    filter: none;
    transition: transform 0.2s ease, color 0.2s ease;
}

.cca-sidebar__recorder-btn:hover {
    background: rgba(244, 63, 94, 0.08) !important;
    border-color: rgba(244, 63, 94, 0.3) !important;
    color: #ffffff;
}

.cca-sidebar__recorder-btn:hover i:first-child {
    transform: scale(1.15);
}

.cca-sidebar__recorder-btn:hover .cca-recorder-ext-icon {
    color: #f43f5e;
    transform: translate(2px, -2px);
}

/* --- Tarjeta de Información de Usuario --- */
.cca-sidebar__user-card {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 0.6rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.cca-sidebar__user-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.cca-sidebar__user-avatar {
    position: relative !important;
    overflow: visible !important;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.76rem;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 0 10px var(--accent-glow);
    user-select: none;
}

.cca-user-status-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #10b981;
    border: 2px solid #080a10;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}

.cca-sidebar__user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.cca-sidebar__user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #f1f5f9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.cca-sidebar__user-email {
    font-size: 0.7rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
    margin-top: 0.15rem;
}

/* Botonera de acciones de usuario integrada */
.cca-sidebar__user-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
}

.cca-sidebar__action-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: transparent;
    border: none;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    flex-shrink: 0;
    transition: all 0.2s var(--ease);
}

.cca-sidebar__action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}

#cca-theme-toggle-btn:hover {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

:root:not([data-theme="dark"]) #cca-theme-toggle-btn:hover {
    background: rgba(124, 58, 237, 0.12);
    color: #7c3aed;
}

.cca-sidebar__action-btn--logout:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #f87171;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

/* Modo colapsado para Recorder Pro y Tarjeta de Usuario */
body.cca-sidebar-collapsed .cca-sidebar__footer {
    align-items: center !important;
    padding-top: 0.75rem !important;
    gap: 0.65rem !important;
}

body.cca-sidebar-collapsed .cca-sidebar__recorder-btn {
    width: 42px !important;
    height: 42px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    margin: 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
}

body.cca-sidebar-collapsed .cca-sidebar__recorder-btn i {
    font-size: 0.9rem !important;
    margin: 0 !important;
}

body.cca-sidebar-collapsed .cca-sidebar__recorder-btn .cca-recorder-ext-icon {
    display: none !important;
}

body.cca-sidebar-collapsed .cca-sidebar__user-card {
    padding: 0.5rem 0.25rem !important;
    justify-content: center !important;
    align-items: center !important;
    flex-direction: column !important;
    gap: 0.45rem !important;
    width: 46px !important;
    margin: 0 auto !important;
    border-radius: 24px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

body.cca-sidebar-collapsed .cca-sidebar__user-avatar {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.75rem !important;
    margin: 0 auto !important;
}

body.cca-sidebar-collapsed .cca-sidebar__user-actions {
    margin: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 0.25rem !important;
    width: 100% !important;
}

body.cca-sidebar-collapsed .cca-sidebar__user-actions form {
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

body.cca-sidebar-collapsed .cca-sidebar__action-btn {
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto !important;
}

body.cca-sidebar-collapsed .cca-sidebar__action-btn i {
    font-size: 0.85rem !important;
    margin: 0 !important;
}

input[type="range"].cca-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(0,0,0,0.08);
    outline: none;
    cursor: pointer;
}

input[type="range"].cca-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 0 0 3px #fff, 0 0 12px rgba(37,99,235,0.5);
    cursor: pointer;
    transition: transform 0.15s var(--ease);
}

input[type="range"].cca-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

input[type="range"].cca-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    background: var(--accent-gradient);
    box-shadow: 0 0 0 3px #fff, 0 0 12px rgba(37,99,235,0.5);
    cursor: pointer;
}

input[type="range"].cca-range::-moz-range-progress {
    background: var(--accent-gradient);
    height: 6px;
    border-radius: 999px;
}

.cca-icon-btn--danger {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}

.cca-icon-btn--danger:hover {
    background: rgba(239,68,68,0.1);
    color: #dc2626;
}

.cca-site-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.9rem;
    background: rgba(0,0,0,0.02);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s var(--ease), background-color 0.15s var(--ease);
}

.cca-site-card:hover {
    border-color: rgba(37,99,235,0.25);
    background: rgba(37,99,235,0.03);
}

/* --- Menús desplegables de cambio de estado (Status Menu) --- */
.status-menu {
    z-index: 9999 !important;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    background: #ffffff69 !important;
    backdrop-filter: blur(20px) !important;
    border-radius: 10px !important;
}

.task-card.is-menu-open,
.task-card:has(.status-menu[style*="display: block"]),
tr:has(.status-menu[style*="display: block"]),
.cca-card:has(.status-menu[style*="display: block"]) {
    z-index: 250 !important;
    position: relative !important;
}

/* ==========================================================================
   TEMA OSCURO (DARK PREMIUM DESIGN SYSTEM)
   ========================================================================== */

[data-theme="dark"] .cca-glass {
    background: #0e1015;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 30px rgba(59, 130, 246, 0.12),
        0 20px 50px rgba(0, 0, 0, 0.65);
}

[data-theme="dark"] .cca-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .cca-card:hover {
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.18), 0 0 30px rgba(59, 130, 246, 0.14), 0 10px 30px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .cca-kpi-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .cca-kpi-card:hover {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

[data-theme="dark"] .cca-kpi-card--purple .cca-kpi-card__icon {
    background: rgba(168, 85, 247, 0.16);
    color: #c084fc;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.35);
}

[data-theme="dark"] .cca-kpi-card--blue .cca-kpi-card__icon {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
    box-shadow: 0 0 18px rgba(59, 130, 246, 0.35);
}

[data-theme="dark"] .cca-kpi-card--amber .cca-kpi-card__icon {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    box-shadow: 0 0 18px rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .cca-kpi-card--red .cca-kpi-card__icon {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
    box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
}

[data-theme="dark"] .cca-kpi-card--pink .cca-kpi-card__icon {
    background: rgba(236, 72, 153, 0.16);
    color: #f472b6;
    box-shadow: 0 0 18px rgba(236, 72, 153, 0.35);
}

[data-theme="dark"] .cca-input {
    background: #0a0b10;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

[data-theme="dark"] .cca-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

[data-theme="dark"] select.cca-input {
    background-color: #0a0b10;
}

[data-theme="dark"] select.cca-input option {
    background-color: #12141c;
    color: #f8fafc;
}

[data-theme="dark"] .cca-btn {
    background: #151722;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22), 0 0 18px rgba(59, 130, 246, 0.18);
}

[data-theme="dark"] .cca-btn:hover {
    background: #1e2130;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.4), 0 0 26px rgba(59, 130, 246, 0.3);
}

[data-theme="dark"] .cca-btn--primary {
    background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35) !important;
}

[data-theme="dark"] .cca-btn--primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%) !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(124, 58, 237, 0.5) !important;
}

[data-theme="dark"] .cca-btn--primary i {
    color: #ffffff !important;
}

[data-theme="dark"] .cca-btn--outline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
}

[data-theme="dark"] .cca-btn--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

/* Badges de alta legibilidad en modo oscuro */
[data-theme="dark"] .cca-badge--success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.35);
    box-shadow: 0 0 14px rgba(74, 222, 128, 0.22);
}

[data-theme="dark"] .cca-badge--warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.35);
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.22);
}

[data-theme="dark"] .cca-badge--danger {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.45);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.28);
}

[data-theme="dark"] .cca-badge--info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.35);
    box-shadow: 0 0 14px rgba(96, 165, 250, 0.22);
}

[data-theme="dark"] .cca-badge--neutral {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.22);
    box-shadow: none;
}

[data-theme="dark"] .cca-badge--purple {
    background: rgba(168, 85, 247, 0.12) !important;
    color: #c084fc !important;
    border-color: rgba(192, 132, 252, 0.35) !important;
    box-shadow: 0 0 14px rgba(192, 132, 252, 0.22);
}

[data-theme="dark"] .status-menu {
    background: rgba(14, 16, 22, 0.92) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .cca-site-card {
    background: rgba(255, 255, 255, 0.025);
}

[data-theme="dark"] .cca-site-card:hover {
    border-color: rgba(59, 130, 246, 0.35);
    background: rgba(59, 130, 246, 0.08);
}

[data-theme="dark"] .cca-modal-overlay {
    background: rgba(0, 0, 0, 0.78) !important;
    backdrop-filter: blur(8px);
}

/* ==========================================================================
   SCROLLBAR INVISIBLE GLOBAL (CONSERVA SCROLL SUAVE EN AMBOS TEMAS)
   ========================================================================== */
/* Chrome, Edge, Safari, Opera */
html::-webkit-scrollbar,
body::-webkit-scrollbar,
::-webkit-scrollbar {
    width: 0px !important;
    height: 0px !important;
    background: transparent !important;
    display: none !important;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
::-webkit-scrollbar-thumb {
    background: transparent !important;
}
/* Firefox */
html,
body,
* {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important; /* IE y Edge Legacy */
}

/* Sincronización de controles nativos con el tema */
:root {
    color-scheme: light;
}
[data-theme="dark"] {
    color-scheme: dark;
}



/* ==========================================================================
   ESTRUCTURA BASE DEL CONTENIDO PRINCIPAL
   ========================================================================== */
.cca-main {
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   ATMÓSFERA AMBIENTAL GLOBAL (CONTINUIDAD VISUAL INMERSIVA)
   ========================================================================== */
.cca-global-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transition: opacity 0.4s ease;
}

/* Cuadrícula táctica sutil */
.cca-global-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 50% 25%, rgba(0, 0, 0, 0.9) 0%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 25%, rgba(0, 0, 0, 0.9) 0%, transparent 85%);
}

/* Orbes ambientales difuminados y optimizados con GPU */
.cca-global-glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(140px);
    will-change: transform;
    transform: translate3d(0, 0, 0);
    opacity: 0.18;
    animation: globalOrbFloat 22s ease-in-out infinite alternate;
}

.cca-global-glow-orb--violet {
    width: 600px;
    height: 600px;
    top: -120px;
    left: 20%;
    background: radial-gradient(circle, #7c3aed 0%, rgba(124, 58, 237, 0) 70%);
}

.cca-global-glow-orb--indigo {
    width: 650px;
    height: 650px;
    bottom: -150px;
    right: 5%;
    background: radial-gradient(circle, #4f46e5 0%, rgba(79, 70, 229, 0) 70%);
    animation-duration: 28s;
    animation-delay: -7s;
}

@keyframes globalOrbFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(50px, -35px, 0) scale(1.06); }
    100% { transform: translate3d(-40px, 45px, 0) scale(0.95); }
}

/* ==========================================================================
   ATMÓSFERA EN MODO CLARO (AURORA GLASS & LUMINOSIDAD NÓRDICA)
   ========================================================================== */
/* Orbes en Modo Claro con presencia perceptible y degradado de luz */
[data-theme="light"] .cca-global-atmosphere,
:root:not([data-theme="dark"]) .cca-global-atmosphere {
    opacity: 1;
}
[data-theme="light"] .cca-global-grid,
:root:not([data-theme="dark"]) .cca-global-grid {
    background-image: 
        linear-gradient(rgba(99, 102, 241, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.04) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: radial-gradient(ellipse at 50% 15%, rgba(0, 0, 0, 0.9) 0%, transparent 85%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 15%, rgba(0, 0, 0, 0.9) 0%, transparent 85%);
}
/* Orbe 1: Lavanda / Índigo Pastel visible detrás del contenido */
[data-theme="light"] .cca-global-glow-orb--violet,
:root:not([data-theme="dark"]) .cca-global-glow-orb--violet {
    width: 600px;
    height: 600px;
    top: -80px;
    left: 20%;
    background: radial-gradient(circle, rgba(124, 58, 237, 0.22) 0%, rgba(167, 139, 250, 0.10) 40%, transparent 70%);
    filter: blur(95px);
    opacity: 1;
}
/* Orbe 2: Azul Cielo / Cyan cristalino en la esquina inferior */
[data-theme="light"] .cca-global-glow-orb--indigo,
:root:not([data-theme="dark"]) .cca-global-glow-orb--indigo {
    width: 650px;
    height: 650px;
    bottom: -100px;
    right: 8%;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.20) 0%, rgba(99, 102, 241, 0.08) 45%, transparent 70%);
    filter: blur(105px);
    opacity: 1;
}

/* ==========================================================================
   NOTIFICACIONES TOAST (GLASSMORPHISM FLOTANTE EN MODO OSCURO Y CLARO)
   ========================================================================== */
#cca-toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

.cca-toast {
    pointer-events: auto;
    min-width: 320px;
    max-width: 440px;
    padding: 0.95rem 1.25rem;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    font-size: 0.88rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.3s ease;
}

/* Modo Oscuro (Base) */
.cca-toast {
    background: rgba(14, 18, 27, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05);
    color: #f8fafc;
}

/* Modo Claro: Cristal Blanco Ahumado con Sombra Suave */
[data-theme="light"] .cca-toast,
:root:not([data-theme="dark"]) .cca-toast {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.04);
    color: #0f172a;
}

/* Bisel superior iluminado dinámico */
.cca-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 15%;
    right: 15%;
    height: 1.5px;
    background: var(--toast-accent, #8b5cf6);
    box-shadow: 0 0 10px var(--toast-accent, #8b5cf6);
}

/* Variantes Cromáticas (Éxito, Error, Warning, Info) */
.cca-toast--success {
    --toast-accent: #10b981;
    border-color: rgba(16, 185, 129, 0.28);
}
.cca-toast--success .cca-toast-icon {
    color: #059669;
    background: rgba(16, 185, 129, 0.12);
}
[data-theme="dark"] .cca-toast--success .cca-toast-icon {
    color: #34d399;
}

.cca-toast--error {
    --toast-accent: #ef4444;
    border-color: rgba(239, 68, 68, 0.28);
}
.cca-toast--error .cca-toast-icon {
    color: #dc2626;
    background: rgba(239, 68, 68, 0.12);
}
[data-theme="dark"] .cca-toast--error .cca-toast-icon {
    color: #f87171;
}

.cca-toast--warning {
    --toast-accent: #f59e0b;
    border-color: rgba(245, 158, 11, 0.28);
}
.cca-toast--warning .cca-toast-icon {
    color: #d97706;
    background: rgba(245, 158, 11, 0.12);
}
[data-theme="dark"] .cca-toast--warning .cca-toast-icon {
    color: #fbbf24;
}

.cca-toast--info {
    --toast-accent: #6366f1;
    border-color: rgba(99, 102, 241, 0.28);
}
.cca-toast--info .cca-toast-icon {
    color: #4f46e5;
    background: rgba(99, 102, 241, 0.12);
}
[data-theme="dark"] .cca-toast--info .cca-toast-icon {
    color: #818cf8;
}

/* Píldora del Icono */
.cca-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}

/* Botón cerrar opcional dentro del toast */
.cca-toast-close {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.3rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}
.cca-toast-close:hover {
    color: currentColor;
}

/* Estado de salida */
.cca-toast.removing {
    opacity: 0;
    transform: translateY(-12px) scale(0.95);
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-16px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   SOPORTE GLOBAL DE FECHAS / CALENDARIOS EN MODO OSCURO
   ========================================================================== */

/* 1. Forzar al navegador a renderizar el popup del calendario en Modo Oscuro */
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="time"],
[data-theme="dark"] input[type="datetime-local"] {
    color-scheme: dark !important;
}

/* 2. Iluminar el icono nativo del calendario (WebKit / Chromium / Edge / Safari) - Alto Contraste */
/* Estado normal: Blanco puro y nítido (garantizado con brightness 0 + invert) */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: brightness(0) invert(0.9) !important; /* Blanco suave / plata brillante */
    opacity: 0.9 !important;
    cursor: pointer !important;
    padding: 3px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* Estado hover: Iluminación violeta con resplandor */
[data-theme="dark"] input[type="date"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="time"]::-webkit-calendar-picker-indicator:hover,
[data-theme="dark"] input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    filter: brightness(0) invert(1) drop-shadow(0 0 6px rgba(167, 139, 250, 0.8)) !important;
    opacity: 1 !important;
    transform: scale(1.15);
}

/* 3. Modo Claro: Asegurar que el icono sea gris oscuro y legible */
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="time"],
[data-theme="light"] input[type="datetime-local"] {
    color-scheme: light !important;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="time"]::-webkit-calendar-picker-indicator,
[data-theme="light"] input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.6;
}

[data-theme="light"] input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* 4. En caso de usar Flatpickr (si existe en el proyecto) */
[data-theme="dark"] .flatpickr-calendar {
    background: #0e121b !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7) !important;
    color: #f8fafc !important;
}

[data-theme="dark"] .flatpickr-day {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .flatpickr-day.selected {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
}
