/* ====================================================================
   ESTILOS GENERALES Y CONFIGURACIÓN DEL TEMA (SINCRO)
   ==================================================================== */

:root {
    /* Paleta de colores - Premium Dark Mode */
    --bg-main: #0b0f19;
    --bg-surface: rgba(22, 30, 49, 0.7);
    --bg-surface-solid: #151d30;
    --bg-card: rgba(30, 41, 67, 0.45);
    
    --border-light: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(6, 182, 212, 0.5);
    
    --color-primary: #06b6d4; /* Cian vibrante */
    --color-primary-hover: #0891b2;
    --color-secondary: #a855f7; /* Púrpura */
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    /* Estados */
    --status-pending: #818cf8;    /* Indigo */
    --status-progress: #f59e0b;   /* Ambar */
    --status-completed: #10b981;  /* Esmeralda */
    --status-blocked: #ef4444;    /* Rojo */
    
    /* Sombras y Efectos */
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(16px);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Tipografía */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Contenedor de pantallas */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.96);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    background-color: var(--bg-main);
}

.screen.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    z-index: 10;
}

/* Ocultación de elementos */
.hidden {
    display: none !important;
}

/* ====================================================================
   PANTALLA DE LOGIN (Glassmorphic)
   ==================================================================== */

#login-screen {
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top right, rgba(6, 182, 212, 0.15), transparent 40%),
                radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.15), transparent 40%),
                var(--bg-main);
}

.login-container {
    width: 90%;
    max-width: 400px;
    padding: 2.5rem 2rem;
    background: var(--bg-surface);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    box-shadow: var(--shadow-premium);
    text-align: center;
    animation: fadeInScale 0.5s ease-out;
}

.login-header {
    margin-bottom: 2rem;
}

.logo-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.4);
}

.logo-icon {
    font-size: 32px;
    color: var(--text-primary);
    animation: rotateSlow 8s linear infinite;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, #ffffff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* Formularios e Inputs */
.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 20px;
}

.form-control, .input-with-icon input {
    width: 100%;
    padding: 12px 14px 12px 42px;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    outline: none;
    transition: var(--transition-smooth);
}

.form-control {
    padding-left: 14px;
}

.form-control:focus, .input-with-icon input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
    background-color: rgba(15, 23, 42, 0.85);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition-smooth);
}

.btn-primary {
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
    color: #0f172a;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
    border-radius: 8px;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    gap: 4px;
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline-primary:hover {
    background-color: rgba(6, 182, 212, 0.1);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.3);
}

.error-message {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    padding: 10px;
    border-radius: 10px;
    font-size: 13px;
    margin-bottom: 1.25rem;
    animation: shake 0.3s ease-in-out;
}

.login-footer {
    margin-top: 1.5rem;
    font-size: 12px;
    color: var(--text-muted);
}

/* ====================================================================
   PANTALLA DE LA APLICACIÓN (DISEÑO BASE)
   ==================================================================== */

.app-header {
    display: none !important;
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    box-shadow: 0 2px 10px rgba(6, 182, 212, 0.2);
}

.badge-role {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--border-light);
    color: var(--text-secondary);
    display: inline-block;
    margin-top: 2px;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: var(--transition-smooth);
}

.btn-icon:hover {
    background-color: var(--border-light);
    color: var(--text-primary);
}

/* Contenido Principal con scroll */
.app-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem 1.25rem 5rem 1.25rem; /* Margen inferior para nav */
    background: radial-gradient(circle at bottom right, rgba(168, 85, 247, 0.05), transparent 45%),
                radial-gradient(circle at top left, rgba(6, 182, 212, 0.05), transparent 45%),
                var(--bg-main);
}

/* Sección de Vistas (SPA tabs) */
.tab-view {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-view.active {
    display: block;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.view-header h2 {
    font-size: 22px;
    font-weight: 600;
}

/* ====================================================================
   VISTA: DASHBOARD
   ==================================================================== */

.welcome-banner {
    margin-bottom: 1.5rem;
}

.welcome-banner h2 {
    font-size: 24px;
    font-weight: 700;
}

.welcome-banner p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Tarjeta de Progreso */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.card-progress {
    background: linear-gradient(135deg, rgba(22, 30, 49, 0.9), rgba(30, 41, 67, 0.7));
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.progress-info h3 {
    font-size: 16px;
    font-weight: 600;
}

.progress-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.progress-percentage {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-primary);
}

.progress-bar-container {
    height: 10px;
    background-color: rgba(15, 23, 42, 0.6);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(to right, var(--color-primary), var(--color-secondary));
    border-radius: 5px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* Grid de métricas */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    #card-my-tasks {
        grid-column: span 2;
    }
}

.metric-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

#card-my-tasks:hover {
    background: var(--border-light);
    transform: translateY(-2px);
    transition: transform var(--transition-smooth), background var(--transition-smooth);
}

.metric-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.metric-icon.pending {
    background-color: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.metric-icon.progress {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.metric-icon.assigned {
    background-color: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

.metric-data h4 {
    font-size: 18px;
    font-weight: 700;
}

.metric-data p {
    font-size: 11px;
    color: var(--text-secondary);
}

.section-title {
    margin-bottom: 10px;
}

.section-title h3 {
    font-size: 16px;
    color: var(--text-primary);
    font-weight: 600;
}

/* ====================================================================
   VISTA: TAREAS (DISEÑO JERÁRQUICO MULTINIVEL)
   ==================================================================== */

.filters-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 1.25rem;
    scrollbar-width: none; /* Ocultar scrollbar en Firefox */
    -webkit-overflow-scrolling: touch; /* Desplazamiento inercial suave en iOS */
}

.filters-scroll::-webkit-scrollbar {
    display: none; /* Ocultar scrollbar en Chrome/Safari */
}

.filter-chip {
    padding: 6px 14px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--transition-smooth);
    flex-shrink: 0; /* Prevenir que se encojan y permitir desbordamiento */
}

.filter-chip.active {
    background-color: var(--color-primary);
    color: #0f172a;
    border-color: var(--color-primary);
}

.tasks-tree-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Item de tarea en el árbol */
.task-node {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    margin-bottom: 4px;
    transition: var(--transition-smooth);
}

.task-node.has-subtasks {
    border-left: 3px solid var(--color-secondary);
}

.task-node-header {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 10px;
}

/* Control expandible */
.task-expander {
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    transition: transform 0.2s ease;
}

.task-expander.expanded {
    transform: rotate(90deg);
    color: var(--color-secondary);
}

/* Checklist Checkbox */
.task-checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.task-checkbox {
    font-size: 22px;
    user-select: none;
    transition: var(--transition-smooth);
}

.task-checkbox.completada {
    color: var(--status-completed);
}

.task-checkbox.pendiente {
    color: var(--text-muted);
}

.task-info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.task-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.task-title.completed {
    text-decoration: line-through;
    color: var(--text-muted);
}

.task-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.task-badge-status {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.task-badge-status.pendiente { background-color: rgba(129, 140, 248, 0.15); color: #a5b4fc; }
.task-badge-status.en_progreso { background-color: rgba(245, 158, 11, 0.15); color: #fde047; }
.task-badge-status.completada { background-color: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.task-badge-status.bloqueada { background-color: rgba(239, 104, 104, 0.15); color: #fca5a5; }

.task-date-info {
    display: flex;
    align-items: center;
    gap: 2px;
}

.task-date-info .material-symbols-outlined {
    font-size: 12px;
}

/* Subtareas anidadas */
.subtasks-container {
    padding-left: 20px;
    margin-top: 2px;
    border-left: 1px dashed rgba(255, 255, 255, 0.1);
    display: none;
}

.subtasks-container.expanded {
    display: block;
}

/* ====================================================================
   VISTA: CALENDARIO
   ==================================================================== */

.calendar-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.calendar-nav h3 {
    font-size: 18px;
    font-weight: 600;
}

.calendar-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 12px;
    margin-bottom: 1.5rem;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.calendar-day:hover {
    background-color: var(--border-light);
}

.calendar-day.empty {
    opacity: 0.15;
    pointer-events: none;
}

.calendar-day.today {
    border: 1.5px solid var(--color-primary);
    color: var(--color-primary);
    font-weight: 700;
}

.calendar-day.selected {
    background-color: var(--color-primary) !important;
    color: #0f172a !important;
    font-weight: 700;
}

/* Puntos de tareas/eventos */
.day-dots {
    display: flex;
    justify-content: center;
    gap: 2px;
    position: absolute;
    bottom: 4px;
    width: 100%;
}

.dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
}

.dot.task { background-color: var(--color-secondary); }
.dot.event { background-color: var(--color-primary); }

/* Listado de agenda del día */
.agenda-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 1.25rem;
}

.agenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 8px;
}

.agenda-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.agenda-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Item de la agenda */
.agenda-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    padding: 10px 12px;
    border-radius: 10px;
    border-left: 3px solid var(--text-muted);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.agenda-item:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.agenda-item.item-task { border-left-color: var(--color-secondary); }
.agenda-item.item-event { border-left-color: var(--color-primary); }
.agenda-item.item-cita { border-left-color: var(--status-progress); }

.agenda-time {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
    min-width: 45px;
}

.agenda-info {
    flex: 1;
}

.agenda-title {
    font-size: 13px;
    font-weight: 500;
}

.agenda-desc {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ====================================================================
   VISTA: EQUIPO
   ==================================================================== */

.team-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.team-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.team-card:hover {
    border-color: var(--color-primary);
    transform: translateY(-1px);
}

.team-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.team-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--bg-surface-solid);
    color: var(--color-primary);
    border: 1px solid var(--border-light);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: 700;
}

.team-details h4 {
    font-size: 14px;
    font-weight: 600;
}

.team-details p {
    font-size: 11px;
    color: var(--text-secondary);
}

.team-role-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.role-admin { background-color: rgba(239, 68, 68, 0.15); color: #fca5a5; }
.role-gerente { background-color: rgba(168, 85, 247, 0.15); color: #d8b4fe; }
.role-supervisor { background-color: rgba(245, 158, 11, 0.15); color: #fde047; }
.role-editor { background-color: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.role-visitante { background-color: rgba(100, 116, 139, 0.15); color: #cbd5e1; }

/* ====================================================================
   BARRA DE NAVEGACIÓN INFERIOR (BOTTOM NAV - App Like)
   ==================================================================== */

.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 64px;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: var(--glass-blur);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 40;
    padding: 0 8px;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: 500;
    width: 60px;
    height: 100%;
    transition: var(--transition-smooth);
}

.nav-item.active {
    color: var(--color-primary);
}

.nav-item span.material-symbols-outlined {
    font-size: 24px;
    transition: transform 0.2s ease;
}

.nav-item.active span.material-symbols-outlined {
    transform: translateY(-2px);
    font-variation-settings: 'FILL' 1; /* Rellenar el icono */
}

.nav-profile-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 10px;
    font-weight: 500;
    width: 60px;
    height: 100%;
    transition: var(--transition-smooth);
}

.nav-profile-item:hover {
    color: var(--text-primary);
}

.user-avatar-mini {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    font-weight: 700;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 9px;
    box-shadow: 0 1px 4px rgba(6, 182, 212, 0.3);
    text-transform: uppercase;
    transition: transform 0.2s ease;
}

.nav-profile-item:hover .user-avatar-mini {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.5);
}

/* ====================================================================
   MODALES Y HOJAS INFERIORES (BOTTOM SHEETS)
   ==================================================================== */

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    transition: opacity 0.3s ease;
}

.modal-backdrop.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-sheet {
    width: 100%;
    max-width: 500px;
    max-height: 90%;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-light);
    border-radius: 24px 24px 0 0;
    box-shadow: var(--shadow-premium);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.hidden .modal-sheet {
    animation: slideDown 0.3s ease-in forwards;
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

/* Layout en filas para formularios */
.form-row {
    display: flex;
    gap: 1rem;
}

.form-row .col {
    flex: 1;
}

.form-control, select.form-control {
    padding: 10px 12px;
}

/* Checkbox listas de selección */
.user-select-list {
    background-color: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px;
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-select-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
}

.user-select-item:hover {
    background-color: var(--border-light);
}

.user-select-item:has(input:checked) {
    font-weight: 600;
    color: var(--color-primary);
    background-color: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.3);
}

.user-select-item input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 1.5rem;
}

/* Rango de progreso personalizado */
.form-range {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    accent-color: var(--color-primary);
    background-color: rgba(15, 23, 42, 0.6);
    margin-top: 10px;
}

/* ====================================================================
   SECCIÓN DE COMENTARIOS Y ANOTACIONES
   ==================================================================== */

.annotations-section {
    margin-top: 2rem;
    border-top: 1px solid var(--border-light);
    padding-top: 1.5rem;
}

.annotations-section h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Burbuja de comentario */
.comment-bubble {
    background-color: rgba(255, 255, 255, 0.03);
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: relative;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-author {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-primary);
}

.comment-date {
    font-size: 9px;
    color: var(--text-muted);
}

.comment-content {
    font-size: 13px;
    line-height: 1.4;
}

.btn-delete-comment {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: none;
}

.comment-bubble:hover .btn-delete-comment {
    display: block;
}

.btn-delete-comment:hover {
    color: #ef4444;
}

/* Barra de entrada de comentario */
.comment-input-area {
    display: flex;
    gap: 8px;
}

.comment-input-area input {
    flex: 1;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 13px;
    outline: none;
}

.comment-input-area input:focus {
    border-color: var(--color-primary);
}

.btn-icon-primary {
    width: 38px;
    height: 38px;
    background: var(--color-primary);
    border: none;
    border-radius: 10px;
    color: #0f172a;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

/* ====================================================================
   ANIMACIONES (MICRO-INTERACCIONES)
   ==================================================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Loading state spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 14px;
}

.empty-state {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 13px;
    border: 1px dashed var(--border-light);
    border-radius: 12px;
}

/* ====================================================================
   INTERRUPTOR DE VISTAS DEL CALENDARIO Y DISEÑO DEL TIMELINE
   ==================================================================== */

.calendar-toggle-view {
    display: flex;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 1.25rem;
}

.calendar-toggle-view .toggle-btn {
    flex: 1;
    padding: 8px 12px;
    background: none;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.calendar-toggle-view .toggle-btn.active {
    background-color: var(--color-primary);
    color: #0f172a;
}

.timeline-wrapper {
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.timeline-grid {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: max-content;
}

.timeline-row {
    display: grid;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.timeline-row.timeline-header {
    border-bottom: 2px solid var(--border-light);
    padding-bottom: 10px;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.timeline-header-cell {
    text-align: center;
    width: 36px;
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.timeline-header-cell.today-col {
    color: var(--color-primary);
    font-weight: 700;
}

.timeline-task-title {
    position: sticky;
    left: 0;
    background-color: #121a2e; /* Color sólido oscuro para tapar el scroll por detrás */
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    width: 140px;
    min-width: 140px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    color: var(--text-primary);
    z-index: 10;
    cursor: pointer;
    transition: var(--transition-smooth);
    border-right: 1px solid var(--border-light);
}

.timeline-task-title:hover {
    color: var(--color-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

/* Modificaciones responsivas para el Timeline Semanal */
.timeline-grid.weekly .timeline-task-title {
    width: 110px;
    min-width: 110px;
}

.timeline-grid.weekly .timeline-header-cell {
    width: 55px;
}

.timeline-bar-wrapper {
    position: relative;
    height: 28px;
    display: flex;
    align-items: center;
}

.timeline-bar {
    height: 20px;
    border-radius: 6px;
    position: relative;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    overflow: hidden;
    width: 100%;
}

.timeline-bar:hover {
    transform: scaleY(1.08);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Colores de las barras según estado */
.timeline-bar.pendiente {
    background-color: rgba(129, 140, 248, 0.15);
    border: 1px solid rgba(129, 140, 248, 0.4);
}
.timeline-bar.en_progreso {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.4);
}
.timeline-bar.completada {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
}
.timeline-bar.bloqueada {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Relleno de progreso interno de la barra */
.timeline-bar-progress {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1;
    opacity: 0.2;
}
.timeline-bar-progress.pendiente { background-color: var(--status-pending); }
.timeline-bar-progress.en_progreso { background-color: var(--status-progress); }
.timeline-bar-progress.completada { background-color: var(--status-completed); }
.timeline-bar-progress.bloqueada { background-color: var(--status-blocked); }

.timeline-bar-label {
    position: relative;
    z-index: 2;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 4px;
}

