/* CSS OPTIMIZADO - Velocidad y Estética */
        :root {
            --primary: #2c3e50;
            --secondary: #e67e22;
            --bg-color: #fdfbf7;
            --surface: #ffffff;
            --text-main: #333333;
            --text-muted: #666666;
            --border: #e0e0e0;
            --radius: 12px;
            --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }

        body {
            background-color: var(--bg-color);
            color: var(--text-main);
            line-height: 1.6;
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden;
        }

        header {
            background-color: var(--primary);
            color: white;
            padding: 0.8rem 1.2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 100;
            flex-shrink: 0;
        }

        header h1 {
            font-size: 1.3rem;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        main {
            display: flex;
            flex: 1;
            max-width: 1600px;
            margin: 0 auto;
            width: 100%;
            overflow: hidden;
            position: relative;
        }

        /* Sidebar Navegación */
        aside {
            width: 350px;
            background: var(--surface);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            flex-shrink: 0;
            transition: transform 0.3s ease;
        }

        .sidebar-tabs {
            display: flex;
            border-bottom: 1px solid var(--border);
            background: #f8f9fa;
        }

        .sidebar-tabs button {
            flex: 1;
            padding: 12px 5px;
            border: none;
            background: transparent;
            cursor: pointer;
            font-weight: 600;
            color: var(--text-muted);
            font-size: 0.85rem;
            transition: 0.2s;
            border-bottom: 3px solid transparent;
        }

        .sidebar-tabs button.active {
            background: var(--surface);
            color: var(--primary);
            border-bottom-color: var(--primary);
        }

        .import-group {
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 10px;
            background: #f8f9fa;
            border-bottom: 1px solid var(--border);
        }

        .btn-ui {
            border: none;
            padding: 8px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
            font-size: 0.8rem;
            transition: 0.2s;
            color: white;
            text-align: left;
        }

        .btn-p {
            background-color: var(--primary);
        }

        .btn-s {
            background-color: var(--secondary);
        }

        .btn-u {
            background-color: #2980b9;
        }

        .btn-x {
            background-color: #e74c3c;
        }

        .btn-ui:hover {
            opacity: 0.9;
            transform: translateX(2px);
        }

        #sidebar-content {
            padding: 8px;
            overflow-y: auto;
            flex: 1;
            scrollbar-width: thin;
        }

        /* Arbol Visual */
        details {
            margin-bottom: 2px;
        }

        summary {
            cursor: pointer;
            padding: 8px 10px;
            font-weight: 600;
            border-radius: 6px;
            transition: 0.1s;
            list-style: none;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.9rem;
        }

        summary:hover {
            background: #f0f4f8;
        }

        summary::before {
            content: '▶';
            font-size: 0.6rem;
            transition: 0.1s;
            color: var(--text-muted);
        }

        details[open]>summary::before {
            transform: rotate(90deg);
        }

        .tree-item {
            padding: 6px 10px 6px 28px;
            cursor: pointer;
            border-radius: 6px;
            font-size: 0.85rem;
            transition: 0.1s;
            margin: 1px 0;
        }

        .tree-item:hover {
            background: #f0f4f8;
            color: var(--primary);
        }

        .tree-item.active {
            background: #e3f2fd;
            color: var(--primary);
            font-weight: bold;
        }

        /* Contenido Central */
        section.content {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: var(--bg-color);
            position: relative;
            overflow: hidden;
        }

        #scrollable-content {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
            scroll-behavior: smooth;
        }

        .content-header {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 0.5rem;
            flex-shrink: 0;
        }

        .btn-back {
            background: var(--surface);
            color: var(--text-muted);
            border: 1px solid var(--border);
            padding: 6px 12px;
            border-radius: 8px;
            cursor: pointer;
            font-weight: bold;
            box-shadow: var(--shadow);
            font-size: 0.85rem;
        }

        .btn-back:hover {
            color: var(--primary);
            border-color: var(--primary);
        }

        /* Tracker Flotante */
        .sticky-tracker {
            position: sticky;
            top: -16px;
            background: var(--primary);
            color: white;
            border-radius: 10px;
            padding: 10px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 50;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
            margin: 0 0 15px 0;
        }

        .tracker-info {
            font-weight: bold;
            font-size: 1rem;
        }

        .tracker-nav {
            display: flex;
            gap: 5px;
        }

        .tracker-nav button {
            background: rgba(255, 255, 255, 0.15);
            border: none;
            padding: 5px 12px;
            border-radius: 6px;
            cursor: pointer;
            color: white;
            font-weight: bold;
        }

        /* Lectura */
        .reading-container {
            background: var(--surface);
            padding: 2.5rem;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
            max-width: 900px;
            margin: 0 auto;
            min-height: 100%;
        }

        .verse-card {
            background: var(--surface);
            padding: 2rem;
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            border: 1px solid var(--border);
            text-align: center;
            margin-bottom: 1rem;
        }

        /* Estilos para Tags y Referencias Cruzadas */
        .verse-tags {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            margin-top: 15px;
        }

        .verse-tags span {
            background: #e0f2f1;
            color: #00796b;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        .verse-cross-ref {
            margin-top: 12px;
            font-size: 0.85rem;
            color: var(--text-muted);
            background: #f8f9fa;
            padding: 8px;
            border-radius: 8px;
            border: 1px dashed var(--border);
        }

        .verse-text-span {
            cursor: pointer;
            padding: 2px 4px;
            border-radius: 4px;
            transition: 0.1s;
            position: relative;
            display: inline;
        }

        .verse-text-span:hover {
            background-color: #fff9c4;
        }

        .verse-text-span.active-reading {
            background-color: #e1f5fe;
            box-shadow: 0 0 0 2px #03a9f4;
        }

        .verse-num {
            font-size: 0.75em;
            font-weight: 800;
            color: var(--secondary);
            vertical-align: super;
            margin-right: 4px;
        }

        .study-section-title {
            font-size: 1.1rem;
            color: var(--primary);
            border-bottom: 2px solid var(--border);
            padding-bottom: 4px;
            margin: 1.5rem 0 0.8rem 0;
            font-weight: bold;
        }

        /* Notas */
        .has-persp-dot {
            display: inline-block;
            width: 8px;
            height: 8px;
            background: var(--primary);
            border-radius: 50%;
            margin-left: 3px;
            vertical-align: middle;
        }

        .has-persp-dot.base {
            background: var(--secondary);
        }

        .tooltiptext {
            visibility: hidden;
            width: 300px;
            background: #2c3e50;
            color: white;
            padding: 12px;
            border-radius: 8px;
            position: absolute;
            z-index: 100;
            bottom: 130%;
            left: 50%;
            transform: translateX(-50%);
            opacity: 0;
            transition: 0.2s;
            font-size: 0.85rem;
            pointer-events: none;
            text-align: left;
        }

        .verse-text-span:hover .tooltiptext {
            visibility: visible;
            opacity: 1;
        }

        .level-note-card {
            background: #fff8e1;
            border-left: 5px solid var(--secondary);
            padding: 12px;
            border-radius: 6px;
            margin-bottom: 12px;
            font-size: 0.95rem;
        }

        .level-note-card.personal {
            background: #f0f4f8;
            border-left-color: #2196f3;
        }

        /* Editor */
        .global-editor {
            background: var(--surface);
            padding: 15px;
            border-radius: var(--radius);
            border: 2px dashed var(--primary);
            margin-top: 15px;
            max-width: 900px;
            margin-left: auto;
            margin-right: auto;
        }

        .editor-container {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 10px;
        }

        .editor-container input,
        .editor-container textarea {
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            font-size: 0.95rem;
            width: 100%;
        }

        .btn-save-note {
            background: var(--primary);
            color: white;
            border: none;
            padding: 10px;
            border-radius: 6px;
            cursor: pointer;
            font-weight: bold;
        }

        .perspective-selector {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 10px;
        }

        .btn-persp {
            padding: 0.5rem 1rem;
            background: var(--surface);
            border: 1px solid var(--border);
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.85rem;
            color: var(--text-main);
            font-weight: 500;
        }

        .btn-persp.active {
            background: var(--primary);
            color: white;
            border-color: var(--primary);
        }

        .btn-persp.base-study {
            border-color: var(--secondary);
            color: var(--secondary);
        }

        .btn-persp.base-study.active {
            background: var(--secondary);
            color: white;
        }

        .perspective-content {
            background: var(--surface);
            padding: 1.2rem;
            border-radius: var(--radius);
            border: 1px solid var(--border);
            margin-bottom: 1rem;
            animation: fadeIn 0.3s;
        }

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

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

        .progress-toast {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: var(--primary);
            color: white;
            padding: 12px 20px;
            border-radius: 10px;
            z-index: 1000;
            font-weight: bold;
            display: none;
            border-left: 5px solid var(--secondary);
            font-size: 0.9rem;
        }

        @media (max-width: 768px) {
            aside {
                display: none;
            }

            .reading-container {
                padding: 1.2rem;
            }
        }