@font-face {
    font-family: 'Manrope';
    font-style: normal;
    font-weight: 200 800;
    font-display: swap;
    src: url('./assets/fonts/manrope-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --bg-deep: #05060b;
    --sidebar-bg: rgba(10, 11, 18, 0.85);
    --card-bg: rgba(255, 255, 255, 0.03);
    --accent-primary: #8a2be2;
    --accent-secondary: #00f2fe;
    --accent-neon: #ff00ff;
    --text-white: #ffffff;
    --text-muted: #a0a2b8; /* Aumentado ligeramente para mejor legibilidad */
    --glass-border: rgba(255, 255, 255, 0.08);
    --sidebar-width: 280px;
    --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.4);
}

/* Scrollbar global */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100vw;
    background-color: var(--bg-deep);
    color: var(--text-white);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Mesh Gradient Background */
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(280, 49%, 15%, 1) 0, transparent 50%),
        radial-gradient(at 100% 100%, hsla(225, 39%, 10%, 1) 0, transparent 50%),
        radial-gradient(at 0% 100%, hsla(339, 49%, 10%, 1) 0, transparent 50%);
}

body.hud-active {
    overflow: hidden !important;
}

body.is-dragging {
    user-select: none !important;
    -webkit-user-select: none !important;
}

#app {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

/* Focus Rings Accesibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.profile-option:focus-visible,
.nav-item:focus-visible,
.filter-chip:focus-visible,
.search-trigger:focus-visible,
.filter-trigger:focus-visible {
    outline: 2px solid var(--accent-secondary);
    outline-offset: 2px;
}

/* Sidebar Styles */
.sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Profile Switcher Premium Styles */
.profile-container {
    padding: 0 0.5rem;
}

.profile-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    opacity: 0.6;
}

.profile-switcher {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    padding: 4px;
    gap: 4px;
}

.profile-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.6rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
}

.profile-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.profile-tab.active .profile-icon {
    opacity: 1;
    color: var(--accent-secondary);
}

/* New TopBar Profile Switcher Styles */
.profile-avatar-wrapper {
    position: relative;
    cursor: pointer;
}

.profile-avatar-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 800;
    font-size: 1.3rem;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
}

.profile-avatar-circle.online {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.4);
}

.profile-avatar-circle.offline {
    border-color: #ff4444;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.4);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

.profile-avatar-wrapper:hover .profile-avatar-circle {
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(138, 43, 226, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.profile-avatar-circle.online {
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.6);
    border: 2px solid #00ff00;
}

.profile-avatar-circle.offline {
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    border: 2px solid #ff0000;
    animation: blink-red 1s infinite;
}

@keyframes blink-red {
    0% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
        border-color: rgba(255, 0, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 0, 0, 1);
        border-color: rgba(255, 0, 0, 1);
    }

    100% {
        box-shadow: 0 0 5px rgba(255, 0, 0, 0.4);
        border-color: rgba(255, 0, 0, 0.5);
    }
}

.profile-dropdown-menu {
    position: absolute;
    top: 55px;
    right: 0;
    background: rgba(20, 20, 30, 0.8);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 0.8rem;
    width: 180px;
    z-index: 1000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-section-title {
    font-size: 0.6rem;
    font-weight: 900;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    padding: 0 0.5rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.profile-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.profile-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}

.profile-option.active {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
}

.profile-option.active span {
    color: white;
    font-weight: 700;
}

.profile-option span {
    font-size: 0.9rem;
    color: var(--text-muted);
}


.nav-group {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.nav-item {
    padding: 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-white);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.item-active-pill {
    width: 4px;
    height: 20px;
    background: var(--accent-primary);
    border-radius: 10px;
}

/* Main Content Styles */
.main-content {
    padding: 2.5rem 3.5rem;
    overflow-y: auto;
    position: relative;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

.welcome-text h1 {
    font-family: 'Manrope', sans-serif;
    font-size: 2.2rem;
    margin-bottom: 0.3rem;
}

.welcome-text p {
    color: var(--text-muted);
}

/* Task Cards Grid */
.task-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.premium-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    height: 100%;
    box-sizing: border-box;
}

.premium-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.card-priority {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.priority-high {
    background: rgba(255, 46, 99, 0.15);
    color: #ff2e63;
    border: 1px solid rgba(255, 46, 99, 0.3);
}

.priority-medium {
    background: rgba(0, 242, 254, 0.15);
    color: #00f2fe;
    border: 1px solid rgba(0, 242, 254, 0.3);
}

.priority-low {
    background: rgba(138, 43, 226, 0.15);
    color: #8a2be2;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.card-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(138, 43, 226, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    width: 90%;
    max-width: 500px;
    background: var(--sidebar-bg);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.modal-title {
    font-family: 'Manrope', sans-serif;
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.btn-submit {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    border: none;
    border-radius: 16px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    box-shadow: 0 10px 25px rgba(0, 242, 254, 0.3);
}

/* Stats Widgets */
.stats-container {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.03);
    padding: 1.5rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
}

.stat-item {
    margin-bottom: 1rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-secondary);
    transition: width 1s ease;
}

/* Completed Animation */
.premium-card.done {
    border-color: var(--accent-secondary) !important;
    box-shadow: 0 0 30px rgba(0, 242, 254, 0.4), inset 0 0 15px rgba(0, 242, 254, 0.2) !important;
    background: rgba(0, 242, 254, 0.05) !important;
}

.premium-card.done .card-title {
    opacity: 0.7;
    text-decoration: line-through;
    color: var(--text-muted);
}

.premium-card.done:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 35px rgba(0, 242, 254, 0.5), inset 0 0 20px rgba(0, 242, 254, 0.3) !important;
}

/* Navigation Refinement */
.nav-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.nav-container::-webkit-scrollbar {
    width: 4px;
}

.nav-container::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.nav-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-label {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-left: 1rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    opacity: 0.6;
}

.nav-group-items {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.nav-item.sub-item {
    margin-left: 0.5rem;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    border-radius: 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--accent-secondary);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-secondary);
}

.empty {
    font-size: 0.75rem;
    font-style: italic;
    opacity: 0.4;
    padding-left: 1rem;
}

.nav-item.active .dot {
    background: var(--accent-neon);
    box-shadow: 0 0 15px var(--accent-neon);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Nested Groups Refinement */
.nav-nested-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.5rem;
}

.group-header {
    background: transparent !important;
    opacity: 0.8;
}

.nested-items {
    margin-left: 1.5rem;
    border-left: 1px solid var(--glass-border);
    padding-left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.dot.small {
    width: 4px;
    height: 4px;
    opacity: 0.6;
}

/* Custom Checkmark Color */
.premium-card.done .btn-check {
    color: var(--accent-secondary) !important;
}

/* 3D Flip Styles */
.card-container {
    perspective: 1500px;
    height: 400px;
    /* Fixed height to prevent grid jumping */
    position: relative;
    z-index: 1;
    /* Ensure children don't bleed out during flip */
    overflow: visible;
}

.card-container:has(.flipped) {
    z-index: 100;
    /* Bring flipped card to front */
}

.card-flipper {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-flipper.flipped {
    transform: rotateY(180deg) scale(1.02);
}

.card-front,
.card-back {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform: rotateY(180deg);
    backface-visibility: hidden;
    background: #0a0b12;
    /* Solid background to prevent ghosting */
    border: 1px solid var(--accent-primary);
    border-radius: 24px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 1;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 30px rgba(138, 43, 226, 0.3);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.card-back::-webkit-scrollbar {
    width: 4px;
}

.card-back::-webkit-scrollbar-thumb {
    background: var(--accent-primary);
    border-radius: 10px;
}

.edit-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    padding-top: 0.5rem;
}

.edit-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.btn-mini {
    flex: 1;
    padding: 0.8rem;
    border-radius: 12px;
    border: none;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-input.mini {
    padding: 0.7rem;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    width: 100%;
    box-sizing: border-box;
}

.form-input.mini:focus {
    border-color: var(--accent-secondary);
    outline: none;
}

/* Fix for dark mode select options (Global) */
.form-input option {
    background-color: #0f1019;
    color: white;
    padding: 10px;
}

.btn-save {
    background: var(--accent-secondary);
    color: var(--bg-deep);
}

.btn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-white);
}

.btn-save:hover {
    box-shadow: 0 0 20px var(--accent-secondary);
    transform: translateY(-2px);
}

.btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-save:hover {
    box-shadow: 0 0 15px var(--accent-secondary);
}


/* Mission Tree Explorer (Mindmap) Styles */
.jarvis-hud {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: radial-gradient(circle at 50% 50%, rgba(15, 18, 35, 0.75), rgba(5, 6, 11, 0.92));
    backdrop-filter: blur(60px) saturate(200%);
    z-index: 2147483647 !important;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.jarvis-hud.active {
    opacity: 1;
    visibility: visible;
}

.tree-svg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.4s ease;
}

.tree-connector {
    stroke: #00f2fe;
    /* Bright Turquoise */
    stroke-width: 2.5;
    fill: none;
    stroke-dasharray: 2000;
    stroke-dashoffset: 2000;
    opacity: 0;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.8));
}

.jarvis-hud.active .tree-connector {
    opacity: 1;
    /* Animation handled by GSAP for precision */
}

.tree-main-card-cloned {
    position: fixed !important;
    z-index: 2147483647 !important;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    /* MUST be auto for dragging */
    cursor: grab;
    height: auto !important;
    max-height: 90vh;
}

.tree-main-card-cloned:active {
    cursor: grabbing;
}

.tree-observaciones-title {
    position: absolute;
    top: 60px;
    left: 65%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent-secondary);
    opacity: 0;
    transition: opacity 0.8s ease;
    pointer-events: none;
    z-index: 1000;
    text-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.tree-observaciones-title.visible {
    opacity: 1;
}

.tree-node {
    position: absolute;
    width: 320px;
    background: rgba(15, 18, 35, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.2rem 1.5rem 1.2rem 4rem;
    z-index: 1000;
    opacity: 0;
    pointer-events: auto;
    display: flex;
    align-items: center;
    min-height: 60px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.jarvis-hud.active .tree-node.visible {
    opacity: 1;
}

/* GSAP will target this class for the pulse effect */
.node-pulse-active {
    border-color: #00f2fe !important;
    box-shadow: 0 0 40px rgba(0, 242, 254, 0.6), inset 0 0 20px rgba(0, 242, 254, 0.4) !important;
}

.node-drag-handle {
    position: absolute;
    right: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.node-drag-handle:hover {
    opacity: 0.8;
}

.node-drag-handle:active {
    cursor: grabbing;
}

.tree-node.visible {
    opacity: 1;
}

.tree-node.is-done {
    border-color: rgba(0, 242, 254, 0.4);
    background: rgba(0, 242, 254, 0.05);
}

.tree-node.is-focused {
    border-color: var(--accent-secondary);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.3), inset 0 0 10px rgba(0, 242, 254, 0.1);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(0) scale(1.02);
}

.tree-node.is-done .tree-node-content {
    text-decoration: line-through;
    opacity: 0.6;
    color: var(--accent-secondary);
}

.node-checker {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.05);
}

.node-checker:hover {
    border-color: var(--accent-secondary);
    background: rgba(0, 242, 254, 0.1);
}

.node-checker.checked {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.5);
    color: var(--bg-deep);
}

.node-checker svg {
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.node-checker.checked svg {
    opacity: 1;
    transform: scale(1);
}

.tree-node-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    outline: none;
    transition: all 0.3s ease;
    min-width: 50px;
}

.tree-node-content:focus {
    color: white;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.tree-node-index {
    position: absolute;
    top: -10px;
    left: -10px;
    width: 24px;
    height: 24px;
    background: var(--accent-secondary);
    color: var(--bg-deep);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
}

.close-hud-btn {
    position: absolute;
    bottom: 3rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    color: black;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 100px;
    font-weight: 700;
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
}

.btn-tree-close:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

/* Advanced Search & Filtering Styles */
.search-container {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    padding: 6px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 42px;
    height: 42px;
    /* overflow: hidden removed to allow dropdown visibility */
    position: relative;
    z-index: 1001;
}

.search-container.expanded {
    width: 350px;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-secondary);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2), 0 10px 30px rgba(0, 0, 0, 0.3);
}

.search-container.has-query {
    border-color: var(--accent-neon);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.2);
}

.search-results-badge {
    position: absolute;
    right: 45px;
    top: -10px;
    background: var(--accent-neon);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 10px;
    box-shadow: 0 0 10px var(--accent-neon);
    pointer-events: none;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Onboarding Overlay */
.onboarding-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 11, 18, 0.95);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s ease;
}

.onboarding-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.onboarding-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 32px;
    padding: 3rem;
    width: 100%;
    max-width: 450px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.onboarding-header h2 {
    font-size: 2rem;
    margin: 1.5rem 0 0.5rem;
    background: linear-gradient(to right, #fff, var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboarding-header p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.icon-selector {
    margin: 2rem 0;
    text-align: left;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.icon-option {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
}

.icon-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-secondary);
}

.icon-option.active {
    background: rgba(0, 242, 254, 0.1);
    border-color: var(--accent-secondary);
    color: var(--accent-secondary);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.2);
}

.search-shortcut-hint {
    position: absolute;
    right: 12px;
    font-size: 0.6rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.search-container.expanded .search-shortcut-hint {
    opacity: 0;
}

.search-trigger {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.search-container.expanded .search-trigger {
    color: var(--accent-secondary);
}

.search-input {
    background: none;
    border: none;
    color: white;
    padding: 0 10px;
    font-size: 0.9rem;
    width: 100%;
    outline: none;
    font-family: inherit;
}

.filter-trigger {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.filter-trigger:hover,
.filter-trigger.active {
    color: var(--accent-secondary);
    background: rgba(255, 255, 255, 0.05);
}

.filter-dropdown-menu {
    position: absolute;
    top: 55px;
    right: 0;
    width: 320px;
    background: rgba(10, 11, 18, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 1.8rem;
    z-index: 1000;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
    will-change: transform, opacity;
}

.filter-dropdown-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
}

.filter-options-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border) transparent;
    -webkit-overflow-scrolling: touch;
}

.filter-options-scroll::-webkit-scrollbar {
    height: 5px;
}

.filter-options-scroll::-webkit-scrollbar-button {
    display: none;
}

.filter-options-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.filter-options-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.2);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.filter-options-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
    box-shadow: 0 0 15px var(--accent-secondary);
}

.filter-chip {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.filter-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.filter-chip.active {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-neon));
    color: white;
    border-color: var(--accent-neon);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.5);
    font-weight: 800;
    transform: scale(1.05);
}

.filter-grid-months {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.filter-chip.month {
    padding: 6px 0;
    text-align: center;
    font-size: 0.7rem;
}

.filter-quick-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-toggle-btn {
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.filter-toggle-btn.active {
    background: rgba(0, 242, 254, 0.1);
    color: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.btn-clear-filters {
    width: 100%;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.btn-clear-filters:hover {
    border-color: #ff4444;
    color: #ff4444;
    background: rgba(255, 68, 68, 0.05);
}

/* Refinement Styles */
.filter-chip.priority-high.active {
    background: rgba(255, 46, 99, 0.2);
    color: #ff2e63;
    border-color: #ff2e63;
    box-shadow: 0 0 15px rgba(255, 46, 99, 0.3);
}

.filter-chip.priority-medium.active {
    background: rgba(0, 242, 254, 0.2);
    color: #00f2fe;
    border-color: #00f2fe;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.3);
}

.filter-chip.priority-low.active {
    background: rgba(138, 43, 226, 0.2);
    color: #8a2be2;
    border-color: #8a2be2;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.3);
}

.filter-scroll-container::-webkit-scrollbar {
    width: 5px;
}

.filter-scroll-container::-webkit-scrollbar-button {
    display: none;
}

.filter-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}

.filter-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(0, 242, 254, 0.2);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
}

.filter-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-secondary);
    box-shadow: 0 0 15px var(--accent-secondary);
}

/* Toast System */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: rgba(10, 11, 18, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    padding: 12px 20px;
    border-radius: 12px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: translateX(-120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    border-left: 4px solid var(--accent-secondary);
}

.toast-success .toast-icon {
    color: var(--accent-secondary);
}

.toast-error {
    border-left: 4px solid #ff2e63;
}

.toast-error .toast-icon {
    color: #ff2e63;
}
.protocol-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 0.5rem;
}

.template-item-new {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.btn-add-item {
    background: var(--accent-primary);
    color: white;
}
.btn-remove-item {
    background: #ff3d5a;
    color: white;
}
.btn-apply-protocol {
    background: var(--accent-secondary);
    color: var(--bg-deep);
}
.tree-subtasks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tree-subtask-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.tree-subtask-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tree-subtask-card .card-status {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.tree-subtasks-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 300px; /* O la altura que prefieras */
    overflow-y: auto;
    padding-right: 1rem; /* Espacio para el scrollbar */
}

/* Estilos para el scrollbar dentro del contenedor de subtareas */
.tree-subtasks-container::-webkit-scrollbar {
    width: 4px;
}

.tree-subtasks-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.tree-subtasks-container::-webkit-scrollbar-thumb {
    background: var(--accent-secondary);
    border-radius: 10px;
}