:root {
            --nika-primary: #0284c7;
            --nika-dark: #0f172a;
            --nika-deep: #0a192f;
            --nika-accent: #38bdf8;
            --bg-body: #f1f5f9;
            --border: #cbd5e1;
            --text-main: #0f172a;
            --text-muted: #475569;
            --success: #16a34a;
            --success-light: #dcfce7;
            --warning: #ca8a04;
            --warning-light: #fef9c3;
            --danger: #dc2626;
            --danger-light: #fef2f2;
            --card-bg: #ffffff;
            --sidebar-bg: #0a192f;
            --sidebar-text: #e2e8f0;
            --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
            --violet: #a855f7;
            --rank-admin: #ef4444;
        }

        /* Desplazamiento suave para anclas */
        html { scroll-behavior: smooth; }

        body.dark-mode {
            --nika-primary: #38bdf8; --nika-dark: #f8fafc; --nika-deep: #020617; --nika-accent: #0ea5e9;
            --bg-body: #090d16; --border: #1e293b; --text-main: #f8fafc; --text-muted: #94a3b8;
            --card-bg: #111827; --sidebar-bg: #020617; --sidebar-text: #cbd5e1;
            --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
        }

        * { box-sizing: border-box; margin: 0; padding: 0; }
        body { font-family: 'Plus Jakarta Sans', sans-serif; background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; display: flex; min-height: 100vh; overflow-x: hidden; transition: 0.3s ease; flex-direction: column; }

        /* ================= BARRA LATERAL ================= */
        .sidebar { width: 300px; background: linear-gradient(180deg, var(--sidebar-bg) 0%, #020617 100%); color: var(--sidebar-text); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh; z-index: 1100; box-shadow: 5px 0 25px rgba(0,0,0,0.2); transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: rgba(56,189,248,0.35) transparent; }
        .sidebar::-webkit-scrollbar { width: 6px; }
        .sidebar::-webkit-scrollbar-thumb { background: rgba(56,189,248,0.35); border-radius: 10px; }
        .sidebar.collapsed { transform: translateX(-100%); }
        /* Overlay táctil para cerrar el sidebar al tocar afuera en móvil */
        .sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(2,6,23,0.55); z-index: 1050; opacity: 0; transition: opacity 0.25s ease; }
        .sidebar-brand-box { padding: 22px 20px; margin: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 12px; text-align: center; }
        .sidebar-brand-box h2 { font-size: 1.4rem; font-weight: 800; color: #ffffff; letter-spacing: -0.5px; margin-bottom: 2px; }
        .sidebar-brand-box span { font-size: 0.72rem; font-weight: 700; color: var(--nika-accent); text-transform: uppercase; letter-spacing: 1.5px; }

        .sidebar-menu { list-style: none; padding: 10px 16px; }
        .sidebar-category { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: #64748b; padding: 12px 16px 6px 16px; }
        .sidebar-menu li { margin-bottom: 4px; }
        .sidebar-link { display: flex; align-items: center; gap: 12px; padding: 11px 16px; color: var(--sidebar-text); text-decoration: none; font-size: 0.88rem; font-weight: 600; border-radius: 8px; transition: all 0.2s ease; background: transparent; border: none; width: 100%; cursor: pointer; text-align: left; }
        .sidebar-link:hover { background: rgba(56, 189, 248, 0.12); color: var(--nika-accent); transform: translateX(4px); }

        .sidebar-user-card { background: rgba(2, 132, 199, 0.15); border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 10px; padding: 10px 14px; margin: 0 16px 10px 16px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: 0.2s; }
        .sidebar-user-card:hover { background: rgba(2, 132, 199, 0.25); }
        .sidebar-user-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--nika-accent); background: #0f172a; }
        .sidebar-user-info h4 { font-size: 0.85rem; color: #ffffff; font-weight: 700; line-height: 1.2; }
        .sidebar-user-info span { font-size: 0.72rem; color: var(--nika-accent); }

        /* ================= ESTADO VACÍO AUXILIAR (FASE C) ================= */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            text-align: center;
            color: var(--text-muted);
            padding: 18px 12px;
            font-size: 0.8rem;
        }
        .empty-state strong { color: var(--text-main); font-size: 0.85rem; }
        .empty-state span { color: var(--text-muted); }

        /* ================= CONTENEDOR PRINCIPAL ================= */
        .main-content { flex: 1; display: flex; flex-direction: column; margin-left: 300px; min-width: 0; transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1); width: calc(100% - 300px); }
        .main-content.expanded { margin-left: 0; width: 100%; }
        .top-header { background: var(--card-bg); border-bottom: 1px solid var(--border); padding: clamp(10px, 2vw, 15px) clamp(16px, 4vw, 35px); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1000; box-shadow: 0 4px 20px rgba(0,0,0,0.03); width: 100%; gap: 10px; }

        /* Botón hamburguesa: pill con gradiente en desktop, icono animado destacado en móvil */
        .toggle-sidebar-btn { background: linear-gradient(135deg, rgba(2,132,199,0.12) 0%, rgba(56,189,248,0.12) 100%); color: var(--nika-primary); border: 1px solid rgba(2,132,199,0.25); padding: 10px 18px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 0.85rem; display: inline-flex; align-items: center; gap: 10px; transition: all 0.25s ease; box-shadow: 0 2px 10px rgba(2,132,199,0.08); }
        .toggle-sidebar-btn:hover { background: var(--nika-primary); color: white; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(2,132,199,0.3); }
        .toggle-sidebar-btn:active { transform: translateY(0) scale(0.97); }
        .toggle-sidebar-btn .hamburger-icon { display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 20px; height: 16px; flex-shrink: 0; }
        .toggle-sidebar-btn .hamburger-icon span { display: block; width: 100%; height: 2.5px; border-radius: 3px; background: currentColor; transition: transform 0.3s ease, opacity 0.3s ease; }
        .toggle-sidebar-btn .toggle-label { white-space: nowrap; }
        body.sidebar-open .toggle-sidebar-btn .hamburger-icon span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
        body.sidebar-open .toggle-sidebar-btn .hamburger-icon span:nth-child(2) { opacity: 0; }
        body.sidebar-open .toggle-sidebar-btn .hamburger-icon span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

        .account-btn { background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%); color: white; border: none; padding: 9px 18px; border-radius: 8px; cursor: pointer; font-weight: 700; font-size: clamp(0.8rem, 1.6vw, 0.88rem); box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25); transition: transform 0.2s; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
        .account-btn:hover { transform: translateY(-1px); }

        /* Contenedor central unificado, con padding fluido */
        .container { max-width: min(1100px, 92vw); margin: clamp(20px, 4vw, 40px) auto; padding: 0 clamp(14px, 3vw, 30px); flex: 1; width: 100%; display: flex; flex-direction: column; box-sizing: border-box; }

        /* HERO & BRANDING */
        .central-branding { text-align: center; margin-bottom: 35px; position: relative; width: 100%; }
        .brand-badge-pill { display: inline-block; background: rgba(2, 132, 199, 0.1); color: var(--nika-primary); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2.5px; padding: 6px 18px; border-radius: 30px; margin-bottom: 14px; border: 1px solid rgba(2, 132, 199, 0.25); box-shadow: 0 4px 12px rgba(2,132,199,0.08); }
        .central-branding h1 { font-size: clamp(1.9rem, 5vw, 3.8rem); font-weight: 900; background: linear-gradient(135deg, var(--nika-dark) 0%, var(--nika-primary) 40%, var(--nika-accent) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -1.5px; margin-bottom: 8px; }
        .central-branding p { color: var(--text-muted); font-size: clamp(0.92rem, 2vw, 1.15rem); font-weight: 600; }

        /* ================= ESFERA MÉDICA CON LATIDO ================= */
        @keyframes medicalPulse {
            0% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4), inset 0 0 15px rgba(56, 189, 248, 0.2);
            }
            50% {
                transform: scale(1.03);
                box-shadow: 0 0 0 18px rgba(56, 189, 248, 0), inset 0 0 25px rgba(56, 189, 248, 0.4);
            }
            100% {
                transform: scale(1);
                box-shadow: 0 0 0 0 rgba(56, 189, 248, 0), inset 0 0 15px rgba(56, 189, 248, 0.2);
            }
        }

        .medical-pulse-container {
            width: 220px;
            height: 220px;
            margin: 0 auto 24px auto;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(56, 189, 248, 0.2) 0%, rgba(2, 132, 199, 0.08) 65%, transparent 100%);
            border: 2px solid rgba(56, 189, 248, 0.4);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            animation: medicalPulse 2.8s infinite ease-in-out;
            box-shadow: 0 10px 35px rgba(56, 189, 248, 0.25);
            backdrop-filter: blur(4px);
        }

        body.dark-mode .medical-pulse-container {
            background: radial-gradient(circle, rgba(56, 189, 248, 0.14) 0%, rgba(2, 132, 199, 0.05) 65%, transparent 100%);
            border-color: rgba(56, 189, 248, 0.3);
            box-shadow: 0 10px 40px rgba(56, 189, 248, 0.15);
        }

        .hero-banner { background: linear-gradient(135deg, #0a192f 0%, #0f172a 50%, #0284c7 100%); border-radius: 14px; padding: clamp(20px, 3.5vw, 32px) clamp(20px, 4vw, 40px); color: white; margin-bottom: 30px; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; border: 1px solid rgba(56, 189, 248, 0.15); width: 100%; box-sizing: border-box; }
        .hero-text h2 { font-size: clamp(1.25rem, 3vw, 1.55rem); font-weight: 700; margin-bottom: 6px; }
        .hero-text p { font-size: 0.92rem; color: #cbd5e1; max-width: 520px; }
        .hero-badge-box { background: rgba(255, 255, 255, 0.06); padding: 14px 20px; border-radius: 10px; border-left: 4px solid var(--nika-accent); font-size: 0.82rem; max-width: 320px; backdrop-filter: blur(5px); }
        .hero-badge-box strong { display: block; color: var(--nika-accent); margin-bottom: 4px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.5px; }

        /* QUICK ACCESS */
        .quick-access-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-bottom: 40px; width: 100%; }

        /* MODULOS: TABS POR AÑO + BENTO DE MATERIAS */
        .modulos-tabs { display: flex; gap: 10px; padding-bottom: 16px; margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); }
        .modulos-tabs::-webkit-scrollbar { display: none; }
        .year-tab-btn { background: var(--card-bg); border: 1px solid var(--border); color: var(--text-muted); padding: 10px 22px; border-radius: 10px; font-size: 0.9rem; font-weight: 800; cursor: pointer; transition: 0.2s; white-space: nowrap; }
        .year-tab-btn:hover { color: var(--nika-primary); border-color: var(--nika-primary); }
        .year-tab-btn.active { background: var(--nika-primary); border-color: var(--nika-primary); color: #fff; box-shadow: 0 4px 14px rgba(2,132,199,0.3); }
        .year-tab-btn .tab-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--success); margin-left: 7px; vertical-align: middle; }

        .year-content { display: none; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; animation: fadeInYear 0.35s ease; }
        .year-content.active { display: grid; }
        @keyframes fadeInYear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

        .subject-tile { position: relative; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 12px; transition: transform 0.25s cubic-bezier(0.4,0,0.2,1), box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease; overflow: hidden; }
        .subject-tile:hover { transform: translateY(-6px); border-color: var(--nika-primary); background: linear-gradient(180deg, rgba(2,132,199,0.05) 0%, var(--card-bg) 55%); box-shadow: 0 18px 34px -12px rgba(2, 132, 199, 0.28); }
        .subject-tile.tile-active { border-color: var(--nika-primary); box-shadow: 0 4px 18px -8px rgba(2,132,199,0.2); }
        .subject-tile.tile-active:hover { box-shadow: 0 20px 38px -12px rgba(2, 132, 199, 0.35); }
        .subject-tile-name { font-size: 1.05rem; font-weight: 800; color: var(--text-main); line-height: 1.35; letter-spacing: -0.2px; }
        .subject-tile-tag { align-self: flex-start; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; padding: 5px 12px; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; }
        .subject-tile-tag.tag-active { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); color: #ffffff; box-shadow: 0 3px 10px rgba(22,163,74,0.35); }
        .subject-tile-tag.tag-active::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ffffff; box-shadow: 0 0 0 3px rgba(255,255,255,0.35); }
        .subject-tile-tag.tag-dev { background: rgba(148,163,184,0.16); color: var(--text-muted); border: 1px solid rgba(148,163,184,0.25); backdrop-filter: blur(2px); }
        .subject-tile-btn { margin-top: auto; padding: 11px; border-radius: 9px; font-weight: 700; font-size: 0.85rem; text-align: center; border: none; cursor: pointer; transition: all 0.2s ease; }
        .subject-tile-btn.btn-enter { background: var(--nika-primary); color: #fff; box-shadow: 0 4px 12px rgba(2,132,199,0.3); }
        .subject-tile-btn.btn-enter:hover { background: var(--nika-dark); transform: translateY(-1px); }
        .subject-tile-btn.btn-disabled { background: transparent; border: 1px solid var(--border); color: var(--text-muted); }
        .quick-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; display: flex; align-items: center; gap: 15px; cursor: pointer; transition: all 0.25s ease; box-shadow: var(--shadow); color: var(--text-main); width: 100%; box-sizing: border-box; }
        .quick-card:hover { border-color: var(--nika-primary); transform: translateY(-3px); box-shadow: 0 12px 30px -10px rgba(2, 132, 199, 0.2); }
        .quick-icon { font-size: 1.6rem; background: rgba(2, 132, 199, 0.1); color: var(--nika-primary); padding: 10px; border-radius: 10px; }
        .quick-info h4 { font-size: 0.92rem; font-weight: 700; color: var(--nika-primary); margin-bottom: 2px; }
        .quick-info span { font-size: 0.78rem; color: var(--text-muted); }

        /* MÓDULOS */
        .section-title { font-size: 1.25rem; font-weight: 700; color: var(--text-main); margin-bottom: 20px; scroll-margin-top: 100px; width: 100%; }
        .module-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: clamp(16px, 2.5vw, 24px); margin-bottom: 40px; width: 100%; box-sizing: border-box; }
        .module-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: clamp(20px, 3vw, 30px); cursor: pointer; transition: all 0.3s ease; position: relative; box-shadow: var(--shadow); width: 100%; box-sizing: border-box; }
        .module-card:hover { transform: translateY(-6px); box-shadow: 0 20px 35px -10px rgba(2, 132, 199, 0.2); border-color: var(--nika-primary); }
        .module-card.active-module { border-left: 5px solid var(--nika-primary); }
        .module-status { position: absolute; top: 20px; right: 20px; font-size: 0.66rem; padding: 5px 12px; border-radius: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; }
        .status-active { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); color: #ffffff; box-shadow: 0 3px 10px rgba(22,163,74,0.35); }
        .status-dev { background: rgba(148,163,184,0.16); color: var(--text-muted); border: 1px solid rgba(148,163,184,0.25); }

        /* Barra de progreso sutil dentro de la tarjeta de módulo activo */
        .module-progress-track { width: 100%; height: 6px; background: var(--bg-body); border-radius: 10px; overflow: hidden; margin: 10px 0 6px 0; }
        .module-progress-fill { height: 100%; background: linear-gradient(90deg, var(--nika-primary), var(--nika-accent)); border-radius: 10px; }
        .module-progress-meta { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); font-weight: 700; margin-bottom: 14px; }

        /* Sidebar: accesos secundarios inferiores */
        .sidebar { overflow-y: auto; display: flex; flex-direction: column; }
        .sidebar-menu { flex: 0 1 auto; overflow-y: visible; }
        .sidebar-secondary-links { margin-top: auto; padding: 14px 16px 28px 16px; border-top: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
        .sidebar-secondary-links .sidebar-category { color: #475569; }
        .sidebar-secondary-links .sidebar-link { font-size: 0.8rem; opacity: 0.85; }

        /* Bloque de acción principal debajo del lema */
        .action-hub { margin-bottom: 40px; width: 100%; box-sizing: border-box; }
        .continuity-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: clamp(16px, 3vw, 22px) clamp(18px, 3.5vw, 26px); box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; width: 100%; box-sizing: border-box; }
        .continuity-info h4 { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 800; margin-bottom: 6px; }
        .continuity-info span.continuity-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); display: block; margin-bottom: 10px; }
        .continuity-progress-wrap { min-width: 220px; }
        .continuity-progress-track { width: 100%; height: 8px; background: var(--bg-body); border-radius: 10px; overflow: hidden; }
        .continuity-progress-fill { height: 100%; background: linear-gradient(90deg, var(--nika-primary), var(--nika-accent)); border-radius: 10px; }
        .continuity-progress-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 6px; font-weight: 700; }
        .btn-continue-action { background: var(--nika-primary); color: white; font-weight: 700; border: none; padding: 12px 22px; border-radius: 10px; cursor: pointer; font-size: 0.9rem; white-space: nowrap; transition: background 0.2s; }
        .btn-continue-action:hover { background: var(--nika-dark); }

        .action-buttons-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; width: 100%; box-sizing: border-box; }
        /* Dashboard: exactamente 4 mosaicos (Sala de Estudio · Desafiar · Simuladores · NikaFarma) */
        .action-buttons-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
        .action-buttons-grid--4 .action-btn-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 2px; padding: 24px 18px; }
        .action-btn-card--sim { border-color: rgba(2, 132, 199, 0.45); background: linear-gradient(160deg, var(--card-bg) 60%, rgba(56, 189, 248, 0.10)); }
        @media (max-width: 900px) { .action-buttons-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
        @media (max-width: 520px) { .action-buttons-grid--4 { grid-template-columns: 1fr; } }
        .action-btn-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.25s ease; box-shadow: var(--shadow); width: 100%; box-sizing: border-box; }
        .action-btn-card:hover { transform: translateY(-4px); border-color: var(--nika-primary); box-shadow: 0 14px 28px -10px rgba(2,132,199,0.25); }
        .action-btn-card .action-icon { font-size: 2rem; margin-bottom: 8px; }
        .action-btn-card h4 { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
        .action-btn-card span { font-size: 0.78rem; color: var(--text-muted); }

        /* Widget de Comunidad */
        .community-widget { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 40px; width: 100%; box-sizing: border-box; }
        .community-widget-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
        .community-widget-header h4 { font-size: 0.95rem; font-weight: 800; color: var(--text-main); }
        .community-widget-header a { font-size: 0.78rem; color: var(--nika-primary); font-weight: 700; cursor: pointer; text-decoration: none; }
        .online-friends-list { display: flex; flex-direction: column; gap: 10px; }
        .online-friend-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; transition: background 0.2s; cursor: pointer; }
        .online-friend-item:hover { background: var(--bg-body); }
        .online-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(22,163,74,0.18); flex-shrink: 0; }
        .online-friend-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; background: #e2e8f0; flex-shrink: 0; }
        .online-friend-name { font-size: 0.85rem; font-weight: 600; color: var(--text-main); }
        .online-friend-meta { font-size: 0.72rem; color: var(--text-muted); }
        .community-widget-empty { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 12px 0; }

        /* ===== Mi Rendimiento Académico: grilla unificada ===== */
        .perf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr)); gap: 16px; margin-top: 14px; }
        .perf-tile { position: relative; overflow: hidden; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); text-align: left; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
        .perf-tile:hover { transform: translateY(-3px); }
        .perf-tile--olvido { cursor: pointer; flex-direction: column; align-items: center; text-align: center; }
        .perf-tile--olvido .perf-tile-icon { margin-bottom: 4px; }
        .perf-tile-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; color: #fff; }
        .perf-tile-body { flex: 1; min-width: 0; }
        .perf-tile-body--wide { width: 100%; }
        .perf-tile-value { font-size: 1.5rem; font-weight: 900; color: var(--text-main); line-height: 1.15; }
        .perf-tile-value--sm { font-size: 1.05rem; line-height: 1.25; }
        .perf-tile-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
        .perf-tile-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }
        .perf-tile-meta--ellipsis { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .perf-tile-placeholder { font-size: 1.4rem; color: var(--text-muted); }

        .perf-tile--exams .perf-tile-icon { background: linear-gradient(135deg, #0284c7, #38bdf8); box-shadow: 0 6px 14px -4px rgba(2,132,199,0.55); }
        .perf-tile--exams:hover { border-color: #0284c7; box-shadow: 0 14px 30px -12px rgba(2,132,199,0.35); }
        .perf-tile--accuracy .perf-tile-icon { background: linear-gradient(135deg, #16a34a, #4ade80); box-shadow: 0 6px 14px -4px rgba(22,163,74,0.55); }
        .perf-tile--accuracy:hover { border-color: #16a34a; box-shadow: 0 14px 30px -12px rgba(22,163,74,0.35); }
        .perf-tile--streak .perf-tile-icon { background: linear-gradient(135deg, #f97316, #fbbf24); box-shadow: 0 6px 14px -4px rgba(249,115,22,0.55); }
        .perf-tile--streak:hover { border-color: #f97316; box-shadow: 0 14px 30px -12px rgba(249,115,22,0.35); }
        .perf-tile--fav .perf-tile-icon { background: linear-gradient(135deg, #7c3aed, #a78bfa); box-shadow: 0 6px 14px -4px rgba(124,58,237,0.55); }
        .perf-tile--fav:hover { border-color: #7c3aed; box-shadow: 0 14px 30px -12px rgba(124,58,237,0.35); }
        .perf-tile--olvido .perf-tile-icon { background: linear-gradient(135deg, #64748b, #94a3b8); box-shadow: 0 6px 14px -4px rgba(100,116,139,0.55); }
        .perf-tile--olvido:hover { border-color: #64748b; box-shadow: 0 14px 30px -12px rgba(100,116,139,0.35); }

        /* ===== Mosaicos de tiempo de estudio (Mi Rendimiento Académico) ===== */
        .perf-time-tile { position: relative; overflow: hidden; background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 18px 18px 16px; display: flex; gap: 14px; align-items: flex-start; box-shadow: var(--shadow); text-align: left; transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; }
        .perf-time-tile:hover { transform: translateY(-3px); }
        .perf-time-tile-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; color: #fff; }
        .perf-time-tile--total .perf-time-tile-icon { background: linear-gradient(135deg, #e11d48, #fb7185); box-shadow: 0 6px 14px -4px rgba(225,29,72,0.55); }
        .perf-time-tile--hoy .perf-time-tile-icon { background: linear-gradient(135deg, #f59e0b, #fbbf24); box-shadow: 0 6px 14px -4px rgba(245,158,11,0.55); }
        .perf-time-tile--total:hover { border-color: #e11d48; box-shadow: 0 14px 30px -12px rgba(225,29,72,0.35); }
        .perf-time-tile--hoy:hover { border-color: #f59e0b; box-shadow: 0 14px 30px -12px rgba(245,158,11,0.35); }
        .perf-time-tile-body { flex: 1; min-width: 0; }
        .perf-time-tile-value { font-size: 1.5rem; font-weight: 900; color: var(--text-main); line-height: 1.15; }
        .perf-time-tile-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
        .perf-time-tile-progress-track { width: 100%; height: 6px; border-radius: 10px; background: var(--bg-body); margin-top: 10px; overflow: hidden; }
        .perf-time-tile-progress-fill { height: 100%; border-radius: 10px; background: linear-gradient(90deg, #e11d48, #fb7185); transition: width .8s cubic-bezier(0.22, 1, 0.36, 1); }
        .perf-time-tile--hoy .perf-time-tile-progress-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
        .perf-time-tile-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

        /* ===== Tarjeta "Sobre el Creador" ===== */
        #about-creator-modal.modal-overlay { padding: 20px; box-sizing: border-box; }
        .creator-card { position: relative; width: min(420px, 100%); background: var(--card-bg); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 60px -15px rgba(0,0,0,0.4); border: 1px solid var(--border); max-height: 90vh; overflow-y: auto; }
        .creator-card-close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 30px; height: 30px; border-radius: 50%; border: none; background: rgba(255,255,255,0.18); color: #fff; font-size: 0.85rem; cursor: pointer; backdrop-filter: blur(4px); }
        .creator-card-hero { height: 108px; background: linear-gradient(135deg, #0a192f 0%, #0f172a 45%, #0284c7 100%); position: relative; }
        .creator-card-hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 85% 20%, rgba(56,189,248,0.35), transparent 55%); }
        .creator-card-avatar { position: absolute; left: 24px; bottom: -34px; width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg, #0284c7, #0369a1); display: flex; align-items: center; justify-content: center; font-size: 34px; border: 4px solid var(--card-bg); box-shadow: 0 10px 24px rgba(2,132,199,0.35); overflow: hidden; }
        .creator-card-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
        .creator-card-avatar-fallback { display: none; width: 100%; height: 100%; align-items: center; justify-content: center; font-size: 34px; }
        .creator-card-verified { position: absolute; bottom: -2px; right: -2px; width: 22px; height: 22px; background: #16a34a; border: 3px solid var(--card-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px; font-weight: 900; }
        .creator-card-body { padding: 46px 26px 26px; text-align: left; }
        .creator-card-name { font-size: 1.3rem; font-weight: 900; color: var(--text-main); margin-bottom: 2px; }
        .creator-card-role { font-size: 0.78rem; font-weight: 800; color: var(--nika-primary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; }
        .creator-card-bio { font-size: 0.85rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 18px; }
        .creator-card-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 18px; }
        .creator-stat { background: var(--bg-body); border: 1px solid var(--border); border-radius: 10px; padding: 10px 6px; text-align: center; }
        .creator-stat strong { display: block; font-size: 0.85rem; color: var(--text-main); font-weight: 800; }
        .creator-stat span { font-size: 0.63rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; }
        .creator-card-socials { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
        .creator-social { display: flex; align-items: center; justify-content: center; padding: 11px 14px; border-radius: 10px; color: #fff; text-decoration: none; font-size: 0.82rem; font-weight: 700; transition: transform 0.2s; }
        .creator-social:hover { transform: translateY(-2px); }
        .creator-social--ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); box-shadow: 0 4px 12px rgba(220,39,67,0.25); }
        .creator-social--tt { background: #000; box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
        .creator-card-support { background: var(--bg-body); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
        .creator-card-support-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 0.74rem; color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; }
        .creator-card-support-tag { background: #e0f2fe; color: #0284c7; padding: 2px 8px; border-radius: 6px; font-weight: 700; text-transform: none; letter-spacing: 0; }
        .creator-card-support-row { display: flex; align-items: center; justify-content: space-between; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; }
        .creator-card-support-row strong { font-family: monospace; letter-spacing: 1px; color: var(--text-main); }
        .creator-card-support-row button { background: var(--nika-primary); color: #fff; border: none; padding: 7px 12px; border-radius: 7px; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
        .creator-card-cafecito { display: flex; justify-content: center; align-items: center; padding: 4px 0 2px; }
        .creator-card-donate-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px 16px; border-radius: 11px; background: #009ee3; color: #fff; text-decoration: none; font-size: 0.88rem; font-weight: 800; box-shadow: 0 8px 18px -6px rgba(0,158,227,0.55); transition: transform .2s ease, box-shadow .2s ease; }
        .creator-card-donate-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 22px -6px rgba(0,158,227,0.65); }

        .sidebar-link--donar { color: #009ee3 !important; }

        /* Nota: el CSS de .nika-pomo-bar ya no vive acá — pomodoroBar.js lo
           inyecta en runtime para que la barra funcione igual en campus.html
           y en examen.html (que no enlaza este archivo). */

        /* ===== Invitación de Pomodoro sincronizado (tarjeta flotante) ===== */
        .nika-pomo-invite { position: fixed; bottom: 20px; right: 20px; z-index: 4000; width: min(300px, calc(100vw - 32px)); background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 20px 45px -10px rgba(0,0,0,0.4); padding: 16px 18px; animation: nikaInviteIn .3s ease; }
        @keyframes nikaInviteIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
        .nika-pomo-invite-title { font-size: 0.9rem; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
        .nika-pomo-invite-sub { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 12px; }
        .nika-pomo-invite-actions { display: flex; gap: 8px; }
        .nika-pomo-invite-actions button { flex: 1; border: none; border-radius: 8px; padding: 8px 10px; font-size: 0.78rem; font-weight: 700; cursor: pointer; }
        .nika-pomo-invite-accept { background: var(--nika-primary); color: #fff; }
        .nika-pomo-invite-reject { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border) !important; }


        /* ===== Elección de Pomodoro: Unirme / Invitarlo al mío ===== */
        .nika-pomo-choice-overlay { position: fixed; inset: 0; background: rgba(6,10,20,0.6); z-index: 4100; display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(2px); }
        .nika-pomo-choice-card { width: min(340px, 100%); background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 24px 22px; text-align: center; box-shadow: 0 25px 55px -12px rgba(0,0,0,0.4); animation: nikaInviteIn .25s ease; }
        .nika-pomo-choice-icon { font-size: 2rem; margin-bottom: 8px; }
        .nika-pomo-choice-title { font-size: 1.02rem; font-weight: 800; color: var(--text-main); margin-bottom: 4px; }
        .nika-pomo-choice-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 18px; }
        .nika-pomo-choice-actions { display: flex; flex-direction: column; gap: 8px; }
        .nika-pomo-choice-btn { border: none; border-radius: 10px; padding: 11px 14px; font-size: 0.85rem; font-weight: 700; cursor: pointer; background: var(--bg-body); color: var(--text-main); }
        .nika-pomo-choice-btn--primary { background: var(--nika-primary); color: #fff; }
        .nika-pomo-choice-btn--ghost { background: transparent; color: var(--text-muted); }

        /* ===== Recorrido Guiado (Onboarding Tour) ===== */
        .nika-tour-overlay { position: fixed; inset: 0; background: rgba(6,10,20,0.55); z-index: 9998; }
        .nika-tour-spotlight { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(6,10,20,0.72); z-index: 9999; pointer-events: none; transition: top .35s ease, left .35s ease, width .35s ease, height .35s ease; border: 2px solid var(--nika-primary); }
        .nika-tour-tooltip { position: fixed; z-index: 10000; width: min(320px, calc(100vw - 32px)); background: var(--card-bg); color: var(--text-main); border-radius: 14px; padding: 18px 20px; box-shadow: 0 20px 45px -10px rgba(0,0,0,0.45); border: 1px solid var(--border); transition: top .35s ease, left .35s ease; }
        .nika-tour-progress { font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; color: var(--nika-primary); margin-bottom: 6px; }
        .nika-tour-tooltip h4 { font-size: 1.02rem; font-weight: 800; margin-bottom: 6px; color: var(--text-main); }
        .nika-tour-tooltip p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 14px; }
        .nika-tour-dots { display: flex; gap: 5px; margin-bottom: 14px; }
        .nika-tour-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border); transition: all .2s ease; }
        .nika-tour-dot.active { background: var(--nika-primary); width: 16px; border-radius: 4px; }
        .nika-tour-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
        .nika-tour-skip { background: none; border: none; color: var(--text-muted); font-size: 0.78rem; font-weight: 700; cursor: pointer; padding: 6px 2px; }
        .nika-tour-prev { background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; font-size: 0.8rem; font-weight: 700; cursor: pointer; }
        .nika-tour-next { background: var(--nika-primary); color: #fff; border: none; border-radius: 8px; padding: 8px 14px; font-size: 0.8rem; font-weight: 700; cursor: pointer; box-shadow: 0 6px 14px -4px rgba(2,132,199,0.5); }
        @media (max-width: 640px) { .nika-tour-tooltip { padding: 16px; } .creator-card-stats { grid-template-columns: 1fr 1fr 1fr; } }
        .module-icon { font-size: 2.3rem; margin-bottom: 14px; }
        .module-title { font-size: 1.2rem; font-weight: 800; color: var(--text-main); margin-bottom: 6px; }
        .module-desc { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 20px; }
        .btn-module { display: inline-flex; align-items: center; justify-content: center; width: 100%; padding: 11px 16px; background: rgba(2, 132, 199, 0.1); color: var(--nika-primary); font-weight: 700; border-radius: 8px; border: none; cursor: pointer; transition: all 0.2s ease; font-size: 0.9rem; }
        .module-card:hover .btn-module { background: var(--nika-primary); color: white; }

        /* ================= PANEL DE ADMINISTRACIÓN ================= */
        .admin-dashboard { display: none; margin-top: 20px; width: 100%; }
        .admin-header { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 25px 30px; margin-bottom: 24px; box-shadow: var(--shadow); border-left: 6px solid var(--danger); display: flex; justify-content: space-between; align-items: center; width: 100%; box-sizing: border-box; }
        .admin-header h2 { font-size: 1.5rem; font-weight: 900; color: var(--nika-dark); margin-bottom: 5px; }
        .admin-header p { color: var(--text-muted); font-size: 0.95rem; }
        
        .admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px; margin-bottom: 30px; width: 100%; box-sizing: border-box; }
        .admin-stat-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; box-shadow: var(--shadow); width: 100%; box-sizing: border-box; }
        .admin-stat-card h4 { font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: 8px; font-weight: 800; }
        .admin-stat-card .stat-val { font-size: 2.2rem; font-weight: 900; color: var(--nika-primary); }

        .admin-panels-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; box-sizing: border-box; }
        @media (max-width: 900px) { .admin-panels-grid { grid-template-columns: 1fr; } }
        
        .admin-panel-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; width: 100%; box-sizing: border-box; }
        .admin-panel-header { padding: 16px 20px; background: var(--bg-body); border-bottom: 1px solid var(--border); font-weight: 800; color: var(--nika-dark); font-size: 1.1rem; display: flex; justify-content: space-between; align-items: center; }
        .admin-panel-body { padding: 0; max-height: 400px; overflow-y: auto; }

        /* Lista de Erratas */
        .admin-list-item { padding: 16px 20px; border-bottom: 1px solid var(--border); transition: background 0.2s; }
        .admin-list-item:hover { background: var(--bg-body); }
        .admin-list-item:last-child { border-bottom: none; }
        
        .errata-meta { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 700; }
        .errata-q { font-size: 0.95rem; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
        .errata-justif { font-size: 0.85rem; color: var(--text-muted); background: rgba(0,0,0,0.03); padding: 10px; border-radius: 6px; font-style: italic; margin-bottom: 12px; border-left: 3px solid var(--nika-primary); }
        
        .status-badge { display: inline-block; padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 800; cursor: pointer; border: 1px solid transparent; }
        .status-badge.pending { background: var(--warning-light); color: var(--warning); border-color: #fef08a; }
        .status-badge.fixed { background: var(--success-light); color: var(--success); border-color: #bbf7d0; }
        .status-badge.rejected { background: var(--danger-light); color: var(--danger); border-color: #fecaca; }

        /* MODALES */
        .modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.65); display: none; justify-content: center; align-items: center; z-index: 3000; backdrop-filter: blur(4px); }
        .modal-content { background: var(--card-bg); border-radius: 14px; padding: 30px; width: 100%; max-width: 440px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35); border: 1px solid var(--border); max-height: 90vh; overflow-y: auto; }
        .modal-tabs { display: flex; background: rgba(2, 132, 199, 0.1); border-radius: 8px; padding: 4px; margin-bottom: 20px; }
        .modal-tab-btn { flex: 1; padding: 8px 4px; border: none; background: transparent; color: var(--text-muted); font-weight: 700; font-size: 0.80rem; border-radius: 6px; cursor: pointer; transition: all 0.2s; }
        .modal-tab-btn.active { background: var(--nika-primary); color: white; }
        .form-group { margin-bottom: 14px; }
        .form-group label { display: block; font-size: 0.82rem; font-weight: 700; margin-bottom: 4px; color: var(--text-main); }
        .form-input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-body); color: var(--text-main); font-family: inherit; font-size: 0.9rem; outline: none; }
        .form-input:focus { border-color: var(--nika-primary); }
        .modal-footer-btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
        
        .footer { background-color: var(--card-bg); border-top: 1px solid var(--border); color: var(--text-muted); padding: 22px 30px; text-align: center; font-size: 0.85rem; margin-top: auto; width: 100%; flex-shrink: 0; box-sizing: border-box; }
        .footer span { color: var(--nika-primary); font-weight: 700; }
        
        /* TOAST MEJORADO (FASE C) */
        #toast {
            position: fixed;
            bottom: 30px;
            right: 30px;
            max-width: min(420px, calc(100vw - 32px));
            background: var(--card-bg);
            color: var(--text-main);
            padding: 14px 18px;
            border-radius: 12px;
            box-shadow: 0 12px 30px rgba(0,0,0,0.18);
            border: 1px solid var(--border);
            font-weight: 700;
            font-size: 0.88rem;
            transform: translateY(100px);
            opacity: 0;
            transition: transform 0.3s ease, opacity 0.3s ease;
            z-index: 4000;
            display: flex;
            align-items: center;
            gap: 10px;
        }
        #toast.show {
            transform: translateY(0);
            opacity: 1;
        }
        #toast::before {
            content: "";
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--nika-primary);
            flex-shrink: 0;
        }
        #toast.toast-success::before { background: var(--success); }
        #toast.toast-error::before { background: var(--danger); }
        #toast.toast-warning::before { background: var(--warning); }
        #toast.toast-info::before { background: var(--nika-primary); }

        #toast.toast-success { border-color: rgba(34,197,94,0.45); }
        #toast.toast-error { border-color: rgba(248,113,113,0.5); }
        #toast.toast-warning { border-color: rgba(250,204,21,0.5); }
        #toast.toast-info { border-color: rgba(56,189,248,0.45); }

        /* NIKA BRAND ASSETS */
        .nika-asset-img { display: block; margin: 0 auto; object-fit: contain; image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges; }
        .sidebar-brand-box { padding: 16px 20px; display: flex; flex-direction: column; align-items: center; }
        .sidebar-brand-logo { display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
        .sidebar-brand-logo .nika-isotipo { height: 52px; max-height: 54px; min-height: 48px; width: auto; }
        .central-branding-logo-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 14px; }
        .hero-n-logo { height: 75px; max-height: 80px; min-height: 65px; width: auto; }
        .hero-text-logo { max-width: 180px; width: 100%; height: auto; }

        /* =====================================================================
           SISTEMA REUTILIZABLE: PREGUNTAS, OPCIONES (CHOICES) Y ARENA DE DUELOS
           ==================================================================== */
        .question-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: clamp(18px, 4vw, 32px); box-shadow: var(--shadow); width: 100%; box-sizing: border-box; margin-bottom: clamp(16px, 3vw, 24px); }
        .question-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; font-size: clamp(0.72rem, 1.6vw, 0.8rem); color: var(--text-muted); font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 14px; }
        .question-text { font-size: clamp(1rem, 2.6vw, 1.25rem); font-weight: 700; line-height: 1.5; color: var(--text-main); margin-bottom: clamp(16px, 3vw, 24px); }
        .choices-grid { display: flex; flex-direction: column; gap: 12px; width: 100%; }
        .choice-btn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--bg-body); border: 1.5px solid var(--border); border-radius: 12px; padding: clamp(14px, 2.5vw, 16px) clamp(16px, 3vw, 20px); font-size: clamp(0.9rem, 2.2vw, 1rem); font-weight: 600; color: var(--text-main); cursor: pointer; transition: all 0.2s ease; min-height: 52px; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
        .choice-btn:hover { border-color: var(--nika-primary); background: rgba(2,132,199,0.06); }
        .choice-btn:active { transform: scale(0.99); }
        .choice-btn .choice-letter { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(2,132,199,0.1); color: var(--nika-primary); font-weight: 800; font-size: 0.85rem; }
        .choice-btn.is-correct { border-color: var(--success); background: var(--success-light); }
        .choice-btn.is-incorrect { border-color: var(--danger); background: var(--danger-light); }
        .exam-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: clamp(16px, 3vw, 24px); }
        .exam-toolbar .btn-module { width: auto; padding: 10px 18px; min-height: 44px; }

        /* Arena de Duelos 1vs1 */
        .versus-arena { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(12px, 3vw, 24px); width: 100%; box-sizing: border-box; }
        .versus-arena .versus-vs { font-weight: 900; font-size: clamp(1.1rem, 3vw, 1.6rem); color: var(--nika-primary); text-align: center; }
        .versus-player-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: clamp(14px, 3vw, 20px); text-align: center; box-shadow: var(--shadow); }

        @media (max-width: 640px) {
            .versus-arena { grid-template-columns: 1fr; }
            .versus-arena .versus-vs { order: 2; }
        }

        /* =====================================================================
           RESPONSIVE PROFUNDO — BREAKPOINTS GLOBALES
           ==================================================================== */
        @media (max-width: 900px) {
            .main-content { margin-left: 0; width: 100%; }
            .main-content.expanded { margin-left: 0; width: 100%; }
            .sidebar { box-shadow: 10px 0 35px rgba(0,0,0,0.35); }

            body.sidebar-open .sidebar-overlay { display: block; opacity: 1; }

            .toggle-sidebar-btn { padding: 12px 16px; border-radius: 14px; box-shadow: 0 4px 14px rgba(2,132,199,0.18); }
            .toggle-sidebar-btn .toggle-label { display: none; }
            .toggle-sidebar-btn .hamburger-icon { width: 22px; height: 17px; }

            .account-btn { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }

            .admin-panels-grid { grid-template-columns: 1fr; }
        }

        @media (max-width: 600px) {
            body { overflow-x: hidden; }
            .top-header { padding: 10px 14px; }
            .toggle-sidebar-btn { padding: 11px 14px; }
            .account-btn { padding: 9px 12px; font-size: 0.8rem; }

            .container { padding: 0 14px; margin: 18px auto; }

            .central-branding { margin-bottom: 24px; }
            .medical-pulse-container { width: 160px; height: 160px; }
            .hero-n-logo { height: 56px; }
            .hero-text-logo { max-width: 130px; }

            .hero-banner { flex-direction: column; align-items: stretch; text-align: center; }
            .hero-badge-box { max-width: 100%; }

            .continuity-card { flex-direction: column; align-items: stretch; text-align: center; }
            .continuity-progress-wrap { min-width: 0; }
            .btn-continue-action { width: 100%; padding: 14px 22px; }

            .action-buttons-grid { grid-template-columns: 1fr; }
            .action-btn-card { padding: 18px; }

            .module-grid { grid-template-columns: 1fr; }
            .module-card { padding: 22px; }

            .community-widget { padding: 16px 18px; }
        }

        /* Modales */
        .modal-content { padding: 22px 18px; max-width: 94vw; max-height: 92vh; border-radius: 12px; }
        .modal-footer-btns { flex-direction: column-reverse; gap: 8px; }
        .modal-footer-btns button { width: 100%; min-height: 46px; }
        .modal-tab-btn { padding: 10px 4px; font-size: 0.75rem; }

        .footer { padding: 16px 14px; font-size: 0.78rem; }

        #toast { left: 16px; right: 16px; bottom: 16px; text-align: center; }

        .question-card { padding: 16px; border-radius: 14px; }
        .choice-btn { min-height: 56px; padding: 14px 16px; }

        /* Pantallas muy angostas */
        @media (max-width: 380px) {
            .central-branding h1 { letter-spacing: -1px; }
            .sidebar { width: 86vw; max-width: 320px; }
        }

        /* Accesibilidad: preferencia de menos movimiento */
        @media (prefers-reduced-motion: reduce) {
            *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
        }

        /* ================= CARD DE ESTADO EN MODAL PERFIL ================= */
        .modal-profile-status-card {
            background: var(--bg-body, #f8fafc);
            border: 1px solid var(--border, #e2e8f0);
            border-radius: 12px;
            padding: 16px 18px;
            margin: 15px 0 20px 0;
            transition: all 0.3s ease;
        }

        body.dark-mode .modal-profile-status-card {
            background: #0d1527;
            border-color: #1e293b;
        }

        .status-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .status-tag {
            font-size: 0.72rem;
            font-weight: 800;
            letter-spacing: 0.8px;
            color: var(--nika-primary, #0284c7);
        }

        .status-percentage {
            font-size: 0.82rem;
            font-weight: 800;
            color: var(--text-main, #0f172a);
        }

        .status-bar-track {
            width: 100%;
            height: 6px;
            background: var(--border, #e2e8f0);
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 10px;
        }

        body.dark-mode .status-bar-track {
            background: #1e293b;
        }

        .status-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #0284c7, #38bdf8);
            border-radius: 10px;
            transition: width 0.4s ease;
        }

        .status-motivational-text {
            font-size: 0.82rem;
            color: var(--text-muted, #64748b);
            line-height: 1.4;
            margin: 0;
        }
        
        /* Mover el Asistente a la derecha para no pisar la barra lateral en campus.html */
        #nika-assistant-btn {
            left: auto !important;
            right: 20px !important;
        }
        #nika-assistant-panel {
            left: auto !important;
            right: 20px !important;
        }
        /* ================= SKELETON LOADERS (Chat / Foro / Ranking) ================= */
        @keyframes nikaShimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }
        .skeleton-block {
            background: linear-gradient(90deg, var(--border) 25%, rgba(148,163,184,0.35) 37%, var(--border) 63%);
            background-size: 400% 100%;
            animation: nikaShimmer 1.4s ease infinite;
            border-radius: 8px;
        }
        body.dark-mode .skeleton-block {
            background: linear-gradient(90deg, #1e293b 25%, rgba(56,189,248,0.15) 37%, #1e293b 63%);
            background-size: 400% 100%;
        }
        .skeleton-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
        .skeleton-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
        .skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
        .skeleton-line { height: 10px; }
        .skeleton-line.short { width: 40%; }
        .skeleton-line.medium { width: 70%; }
        .skeleton-line.long { width: 92%; }
        .skeleton-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; }

        /* Barra superior del Pomodoro (pomodoroBar.js): contenedor centrado
           del texto (logo, fase, tiempo, compañero), con los controles afuera. */
        .barra-enfoque { display: flex; justify-content: center; align-items: center; width: 100%; gap: 10px; min-width: 0; }

        /* ================================================================
           CHAT PRIVADO — Bandeja (dm-inbox-modal) y Conversación 1 a 1
           (private-chat-modal), estilo Messenger/Instagram DM.
           Usa exclusivamente variables de la paleta Nika (--nika-primary,
           --card-bg, --bg-body, --border, --text-main, --text-muted) para
           heredar el dark mode automáticamente vía body.dark-mode.
           ================================================================ */

        /* ---- Bandeja de mensajes ---- */
        .pc-inbox-content { max-width: 420px; padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 78vh; }
        .pc-inbox-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
        .pc-inbox-header h3 { font-size: 1.1rem; font-weight: 800; color: var(--nika-dark); margin: 0; }
        .dm-inbox-list { overflow-y: auto; padding: 8px; flex: 1; }
        .dm-inbox-item { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 12px; cursor: pointer; transition: background 0.18s ease; }
        .dm-inbox-item:hover { background: var(--bg-body); }
        .dm-inbox-item:active { background: rgba(2,132,199,0.1); }
        .dm-inbox-avatar-wrap { position: relative; flex-shrink: 0; }
        .dm-inbox-avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; background: var(--bg-body); border: 1px solid var(--border); display: block; }
        .dm-inbox-dot { position: absolute; bottom: -1px; right: -1px; width: 12px; height: 12px; border-radius: 50%; background: #94a3b8; border: 2.5px solid var(--card-bg); transition: background 0.2s; }
        .dm-inbox-dot.is-online { background: #22c55e; }
        .dm-inbox-body { flex: 1; min-width: 0; }
        .dm-inbox-name { font-size: 0.92rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .dm-inbox-meta { font-size: 0.76rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
        .dm-inbox-badge { flex-shrink: 0; background: var(--nika-primary); color: #fff; font-size: 0.68rem; font-weight: 800; border-radius: 20px; padding: 2px 8px; min-width: 20px; text-align: center; box-shadow: 0 2px 6px rgba(2,132,199,0.35); }

        /* ---- Ventana de conversación ---- */
        .pc-content { max-width: 440px; padding: 0; display: flex; flex-direction: column; height: min(600px, 84vh); overflow: hidden; }

        .pc-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0; background: var(--card-bg); }
        .pc-icon-btn { background: transparent; border: none; cursor: pointer; color: var(--text-muted); font-size: 1rem; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; transition: background 0.15s ease, color 0.15s ease; flex-shrink: 0; }
        .pc-icon-btn:hover { background: rgba(2,132,199,0.12); color: var(--nika-primary); }
        .pc-back-btn { display: none; } /* solo visible en mobile, ver media query */
        .pc-header-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--bg-body); border: 1px solid var(--border); flex-shrink: 0; }
        .pc-header-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
        .pc-header-name { font-size: 0.95rem; font-weight: 800; color: var(--nika-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .pc-header-status { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
        .pc-header-status.is-online { color: #16a34a; }
        body.dark-mode .pc-header-status.is-online { color: #4ade80; }

        .pc-messages { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 3px; background: var(--bg-body); scroll-behavior: smooth; }
        .pc-loading-state, .pc-empty-state { text-align: center; color: var(--text-muted); font-size: 0.82rem; margin: auto; padding: 20px; }

        .pc-day-divider { text-align: center; font-size: 0.68rem; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin: 14px 0 10px; position: relative; }

        .chat-bubble-row { display: flex; margin: 3px 0; max-width: 100%; }
        .chat-bubble-row.mine { justify-content: flex-end; }
        .chat-bubble-row.theirs { justify-content: flex-start; }

        .chat-bubble { max-width: 76%; padding: 9px 13px; font-size: 0.87rem; line-height: 1.4; word-wrap: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.06); position: relative; }
        .chat-bubble.mine { background: linear-gradient(135deg, var(--nika-primary), var(--nika-accent)); color: #fff; border-radius: 16px 16px 4px 16px; }
        .chat-bubble.theirs { background: var(--card-bg); color: var(--text-main); border: 1px solid var(--border); border-radius: 16px 16px 16px 4px; }
        .chat-bubble.pending { opacity: 0.68; }

        .chat-bubble-meta { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 3px; font-size: 0.62rem; opacity: 0.85; }
        .chat-bubble.mine .chat-bubble-meta { color: rgba(255,255,255,0.85); }
        .chat-bubble.theirs .chat-bubble-meta { color: var(--text-muted); justify-content: flex-start; }

        /* Tarjeta de pregunta compartida dentro del chat */
        .chat-question-card { max-width: 84%; border-radius: 14px; padding: 12px 14px; font-size: 0.82rem; line-height: 1.4; border: 1px solid var(--border); background: var(--card-bg); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
        .chat-bubble-row.mine .chat-question-card { border-color: rgba(255,255,255,0.35); background: linear-gradient(135deg, rgba(2,132,199,0.14), rgba(56,189,248,0.14)); }
        .chat-question-card-head { display: flex; align-items: center; gap: 6px; font-weight: 800; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.4px; color: var(--nika-primary); margin-bottom: 6px; }
        .chat-question-card-body { color: var(--text-main); font-weight: 600; }

        .pc-typing-indicator { display: flex; align-items: center; gap: 4px; padding: 8px 13px; }
        .pc-typing-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); opacity: 0.5; animation: nikaTypingDot 1.2s infinite ease-in-out; }
        .pc-typing-indicator span:nth-child(2) { animation-delay: 0.15s; }
        .pc-typing-indicator span:nth-child(3) { animation-delay: 0.3s; }
        @keyframes nikaTypingDot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-4px); opacity: 1; } }

        .pc-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--card-bg); flex-shrink: 0; }
        .pc-composer-input { flex: 1; resize: none; max-height: 110px; min-height: 40px; padding: 10px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-main); font-family: inherit; font-size: 0.88rem; line-height: 1.3; outline: none; transition: border-color 0.15s ease; }
        .pc-composer-input:focus { border-color: var(--nika-primary); }
        .pc-send-btn { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer; background: linear-gradient(135deg, var(--nika-primary), var(--nika-accent)); color: #fff; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.15s ease, opacity 0.15s ease; box-shadow: 0 3px 10px rgba(2,132,199,0.35); }
        .pc-send-btn:hover { transform: scale(1.06); }
        .pc-send-btn:active { transform: scale(0.94); }
        .pc-send-btn:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

        /* ---- Ticks: Enviado ✓ gris · Recibido ✓✓ gris · Leído ✓✓ azul ---- */
        .chat-bubble-tick { display: inline-flex; align-items: center; line-height: 0; padding: 2px 5px; border-radius: 999px; transition: color 0.25s ease; }
        .chat-bubble-tick svg { width: 16px; height: 11px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
        /* Sobre el degradé azul de .mine un tick azul no se vería: va en una "píldora" clara */
        .chat-bubble.mine .chat-bubble-tick { background: rgba(255,255,255,0.92); }
        .tick-sent, .tick-delivered { color: #94a3b8; }
        .tick-read { color: #0ea5e9; }
        .tick-anim { animation: nikaTickPop 0.3s ease-out; }
        @keyframes nikaTickPop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

        /* ================================================================
           CHAT PRIVADO — ventana flotante (estilo Messenger web) + FAB
           #private-chat-modal deja de ser un modal "bloqueante": el overlay
           se vuelve transparente y sin backdrop, y .chat-container (el
           .pc-content de adentro) se ancla fija en la esquina inferior
           derecha, para poder seguir navegando el resto del Campus con el
           chat abierto al costado.
           ================================================================ */
        #private-chat-modal.modal-overlay {
            background: transparent;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
            pointer-events: none; /* el fondo no bloquea clicks; solo bloquea el chat-container de adentro */
            align-items: flex-end;
            justify-content: flex-end;
            padding: 0;
        }
        #private-chat-modal.modal-overlay .chat-container {
            pointer-events: auto;
        }

        .chat-container {
            position: fixed;
            bottom: 90px; /* justo por encima del botón del asistente/robot (bottom:20px;right:20px) */
            right: 20px;
            width: 320px;
            height: 420px;
            z-index: 9999;
            max-width: calc(100vw - 24px);
            max-height: calc(100vh - 24px);
            margin: 0;
            border-radius: 16px;
            box-shadow: 0 12px 32px rgba(0,0,0,0.28);
            overflow: hidden;
        }

        /* Estado MINIMIZADO: ni el modal-overlay ni el chat-container pueden
           dejar ninguna capa (ni siquiera transparente) tapando al FAB. Se
           fuerza display:none + pointer-events:none con !important porque
           este estado se togglea por JS agregando/quitando esta clase, y
           necesita ganarle a los estilos inline y de layout de arriba. */
        #private-chat-modal.modal-overlay.pc-minimizado {
            display: none !important;
            pointer-events: none !important;
        }
        #private-chat-modal.modal-overlay.pc-minimizado .chat-container {
            display: none !important;
            pointer-events: none !important;
        }
        @media (max-width: 480px) {
            .chat-container { right: 8px; bottom: 90px; width: calc(100vw - 16px); height: min(70vh, 520px); }
        }

        /* ---- Botón de Acción Flotante (FAB) del chat ----
           bottom:90px lo deja apilado justo arriba del botón del asistente/
           robot (bottom:20px;right:20px), sin superponerse ni taparlo. */
        .chat-fab {
            position: fixed;
            bottom: 90px;
            right: 20px;
            width: 56px;
            height: 56px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            background: linear-gradient(135deg, var(--nika-primary), var(--nika-accent));
            color: #fff;
            font-size: 25px; /* ícono/emoji entre 24px y 26px */
            line-height: 1;
            display: none; /* se muestra por JS solo si hay sesión iniciada */
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
            z-index: 9998;
            transition: transform 0.18s ease, box-shadow 0.18s ease;
        }
        .chat-fab svg { width: 25px; height: 25px; display: block; }
        .chat-fab:hover { transform: scale(1.07); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38); }
        .chat-fab:active { transform: scale(0.95); }
        /* Estado ABIERTO: el chat está a la vista, así que el FAB se apaga
           por completo (si no, quedan los dos superpuestos en la misma
           esquina). Se fuerza con !important porque JS togglea esta clase
           encima del display:flex que pone actualizarVisibilidadChatFab(). */
        .chat-fab.pc-fab-oculto {
            display: none !important;
            pointer-events: none !important;
        }
        /* Estado MINIMIZADO: el FAB vuelve a estar activo y clickeable. */
        .chat-fab.pc-fab-visible {
            display: flex !important;
            pointer-events: auto !important;
        }
        .chat-fab .chat-fab-badge {
            position: absolute;
            top: -2px;
            right: -2px;
            background: var(--danger, #dc2626);
            color: #fff;
            font-size: 0.65rem;
            font-weight: 800;
            border-radius: 20px;
            padding: 1px 6px;
            min-width: 18px;
            text-align: center;
            box-shadow: 0 2px 6px rgba(0,0,0,0.25);
            display: none;
        }
        .chat-fab.has-minimized .chat-fab-badge { display: block; }

        /* ================================================================
           COMUNIDAD & AMIGOS + PERFIL PÚBLICO — mismo lenguaje visual
           que el chat privado (tarjetas redondeadas, variables Nika,
           dark mode automático vía var(--...)).
           ================================================================ */

        /* ---- Modal "Comunidad & Amigos" ---- */
        .friends-card { max-width: 460px; padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 82vh; }
        .friends-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 12px; }
        .friends-card-title { font-size: 1.15rem; font-weight: 800; color: var(--nika-dark); margin: 0 0 4px; }
        .friends-card-sub { font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.4; }

        .friends-tabs { display: flex; gap: 6px; padding: 0 14px 12px; flex-shrink: 0; }
        .friends-tab-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border: none; background: var(--bg-body); color: var(--text-muted); font-weight: 700; font-size: 0.78rem; border-radius: 10px; cursor: pointer; transition: all 0.18s ease; }
        .friends-tab-btn:hover { color: var(--nika-primary); }
        .friends-tab-btn.active { background: var(--nika-primary); color: #fff; box-shadow: 0 4px 12px rgba(2,132,199,0.3); }
        .friends-tab-count { background: rgba(255,255,255,0.25); color: inherit; font-size: 0.68rem; font-weight: 800; border-radius: 20px; padding: 1px 7px; min-width: 18px; }
        .friends-tab-btn:not(.active) .friends-tab-count { background: rgba(2,132,199,0.14); color: var(--nika-primary); }
        .friends-tab-badge { background: var(--danger); color: #fff; font-size: 0.65rem; font-weight: 800; border-radius: 20px; padding: 1px 7px; min-width: 16px; display: none; }

        .friends-list-scroll { overflow-y: auto; padding: 4px 12px 16px; flex: 1; }

        .friend-card, .friend-request-card { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; transition: background 0.15s ease; }
        .friend-card:hover, .friend-request-card:hover { background: var(--bg-body); }
        .friend-card-avatar-wrap { position: relative; flex-shrink: 0; }
        .friend-card-avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--bg-body); border: 1px solid var(--border); display: block; }
        .friend-card-body { flex: 1; min-width: 0; }
        .friend-card-name { font-size: 0.87rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .friend-card-meta { font-size: 0.73rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
        .friend-card-actions, .friend-request-actions { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }

        .friend-action-btn { width: 32px; height: 32px; border-radius: 50%; border: none; background: rgba(2,132,199,0.1); color: var(--nika-primary); font-size: 0.85rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: transform 0.15s ease, background 0.15s ease; }
        .friend-action-btn:hover { transform: scale(1.08); background: rgba(2,132,199,0.2); }
        .friend-action-btn.danger { background: var(--danger-light); color: var(--danger); }
        .friend-action-btn.accept { background: #dcfce7; color: #16a34a; }
        body.dark-mode .friend-action-btn.accept { background: rgba(34,197,94,0.18); color: #4ade80; }

        .friends-add-btn { flex-shrink: 0; border: none; cursor: pointer; background: var(--nika-primary); color: #fff; font-weight: 700; font-size: 0.75rem; padding: 7px 14px; border-radius: 20px; transition: transform 0.15s ease, background 0.15s ease; }
        .friends-add-btn:hover { background: var(--nika-dark); transform: translateY(-1px); }
        .friends-add-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

        .friends-search-box { display: flex; align-items: center; gap: 8px; margin: 0 12px 10px; padding: 9px 12px; border-radius: 20px; background: var(--bg-body); border: 1px solid var(--border); }
        .friends-search-icon { font-size: 0.85rem; opacity: 0.6; flex-shrink: 0; }
        .friends-search-input { flex: 1; border: none; background: transparent; outline: none; color: var(--text-main); font-family: inherit; font-size: 0.85rem; }

        .friends-empty-state { text-align: center; padding: 30px 20px; color: var(--text-muted); }
        .friends-empty-icon { font-size: 2.2rem; margin-bottom: 10px; }
        .friends-empty-state p { font-size: 0.85rem; margin: 0 0 14px; }

        /* ================================================================
           COMUNIDAD & AMIGOS — rediseño oscuro premium (dark glassmorphism)
           Fijo a paleta oscura siempre (no depende de body.dark-mode) para
           que el modal de red social se vea "pro" también en modo claro.
           ================================================================ */
        .friends-card {
            background: #0f172a;
            border: 1px solid rgba(148, 163, 184, 0.15);
            color: #f1f5f9;
        }
        .friends-card-title { color: #ffffff; }
        .friends-card-sub { color: #94a3b8; }
        .friends-card .pc-icon-btn { background: rgba(255,255,255,0.08); color: #f1f5f9; }
        .friends-card .pc-icon-btn:hover { background: rgba(255,255,255,0.16); }

        .friends-card .friends-tab-btn { background: rgba(255,255,255,0.06); color: #94a3b8; }
        .friends-card .friends-tab-btn:hover { color: #38bdf8; }
        .friends-card .friends-tab-btn.active { background: linear-gradient(135deg, #0284c7, #0ea5e9); color: #fff; box-shadow: 0 4px 14px rgba(14,165,233,0.35); }
        .friends-card .friends-tab-btn:not(.active) .friends-tab-count { background: rgba(56,189,248,0.16); color: #38bdf8; }

        .friends-card .friend-card:hover,
        .friends-card .friend-request-card:hover { background: rgba(255,255,255,0.05); }
        .friends-card .friend-card-avatar { background: #1e293b; border: 1px solid rgba(148,163,184,0.25); }
        .friends-card .friend-card-name { color: #f1f5f9; }
        .friends-card .friend-card-meta { color: #94a3b8; }
        .friends-card .friend-action-btn { background: rgba(56,189,248,0.12); color: #38bdf8; }
        .friends-card .friend-action-btn:hover { background: rgba(56,189,248,0.22); }
        .friends-card .friend-action-btn.danger { background: rgba(239,68,68,0.15); color: #f87171; }
        .friends-card .friends-add-btn { background: linear-gradient(135deg, #0284c7, #0ea5e9); }

        .friends-card .friends-search-box { background: rgba(255,255,255,0.06); border: 1px solid rgba(148,163,184,0.18); }
        .friends-card .friends-search-input { color: #f1f5f9; }
        .friends-card .friends-search-input::placeholder { color: #64748b; }

        .friends-card .friends-empty-state { color: #94a3b8; }

        /* Glow + color por rango: Admin = rojo, Premium (NikaMed+) = violeta, Free = azul */
        .friend-card-avatar.rank-admin   { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,.35), 0 0 14px rgba(239,68,68,.65); }
        .friend-card-avatar.rank-premium { border-color: #a855f7 !important; box-shadow: 0 0 0 2px rgba(168,85,247,.35), 0 0 14px rgba(192,132,252,.65); }
        .friend-card-avatar.rank-free    { border-color: #0ea5e9 !important; box-shadow: 0 0 0 2px rgba(14,165,233,.3),  0 0 12px rgba(56,189,248,.55); }

        .friend-card-name.rank-admin   { color: #ef4444; }
        .friend-card-name.rank-premium { color: #a855f7; }
        .friend-card-name.rank-free    { color: #38bdf8; }

        .friend-card-rank-badge { display: block; font-size: 0.66rem; font-weight: 700; margin-top: 2px; letter-spacing: 0.2px; }
        .friend-card-rank-badge.rank-admin   { color: #ef4444; }
        .friend-card-rank-badge.rank-premium { color: #a855f7; }
        .friend-card-rank-badge.rank-free    { color: #38bdf8; }

        /* ============ Reutilizable: jerarquía visual de rangos para avatares
           chicos (Chat Global, Foro, Ranking) — mismo criterio de color que
           .friend-card-avatar / .pp-avatar más arriba. ============ */
        .social-avatar-sm { border: 1px solid var(--border); }
        .social-avatar-sm.rank-admin   { border-color: #ef4444 !important; box-shadow: 0 0 0 2px rgba(239,68,68,.35), 0 0 10px rgba(239,68,68,.65); }
        .social-avatar-sm.rank-premium { border-color: #a855f7 !important; box-shadow: 0 0 0 2px rgba(168,85,247,.35), 0 0 10px rgba(192,132,252,.65); }
        .social-avatar-sm.rank-free    { border-color: #0ea5e9 !important; box-shadow: 0 0 0 2px rgba(14,165,233,.3),  0 0 9px rgba(56,189,248,.55); }

        .social-name.rank-admin   { color: #ef4444; }
        .social-name.rank-premium { color: #a855f7; }
        .social-name.rank-free    { color: #38bdf8; }

        .social-rank-badge { display: inline-block; font-size: 0.62rem; font-weight: 700; padding: 1px 6px; border-radius: 8px; border: 1px solid; margin-left: 4px; vertical-align: middle; white-space: nowrap; }
        .social-rank-badge.rank-admin   { background: rgba(239,68,68,0.14); color: #ef4444; border-color: rgba(239,68,68,0.3); }
        .social-rank-badge.rank-premium { background: rgba(168,85,247,0.14); color: #a855f7; border-color: rgba(168,85,247,0.3); }
        .social-rank-badge.rank-free    { background: rgba(14,165,233,0.14); color: #38bdf8; border-color: rgba(14,165,233,0.3); }

        /* ================================================================
           MODAL ADMIN — Búsqueda de usuarios registrados (#admin-users-modal)
           Mismo lenguaje visual que .friends-card / .friends-search-box.
           ================================================================ */
        .admin-users-card { max-width: 460px; padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 82vh; }
        .admin-users-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 12px; }
        .admin-users-card-title { font-size: 1.1rem; font-weight: 800; color: var(--nika-dark); margin: 0 0 4px; }
        .admin-users-card-sub { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

        .admin-users-search-box { display: flex; align-items: center; gap: 8px; margin: 0 18px 12px; padding: 9px 12px; border-radius: 20px; background: var(--bg-body); border: 1px solid var(--border); }
        .admin-users-search-icon { font-size: 0.85rem; opacity: 0.6; flex-shrink: 0; }
        .admin-users-search-input { flex: 1; border: none; background: transparent; outline: none; color: var(--text-main); font-family: inherit; font-size: 0.85rem; }

        .admin-users-list { overflow-y: auto; padding: 4px 12px 16px; flex: 1; }
        .admin-user-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 12px; transition: background 0.15s ease; }
        .admin-user-row:hover { background: var(--bg-body); }
        .admin-user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--bg-body); border: 1px solid var(--border); flex-shrink: 0; }
        .admin-user-body { flex: 1; min-width: 0; }
        .admin-user-name { font-size: 0.87rem; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
        .admin-user-meta { font-size: 0.73rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
        .admin-user-role-badge { flex-shrink: 0; font-size: 0.65rem; font-weight: 800; border-radius: 20px; padding: 2px 9px; background: rgba(2,132,199,0.12); color: var(--nika-primary); }
        .admin-user-role-badge.is-admin { background: rgba(220,38,38,0.12); color: var(--danger, #dc2626); }

        /* Pastilla de "N amigos" dentro del modal de Mi Perfil */
        .friends-inline-pill { display: flex; align-items: center; justify-content: space-between; width: 100%; border: 1px solid var(--border); background: var(--bg-body); color: var(--text-main); font-weight: 700; font-size: 0.82rem; padding: 10px 14px; border-radius: 12px; cursor: pointer; margin-bottom: 16px; transition: border-color 0.15s ease, background 0.15s ease; }
        .friends-inline-pill:hover { border-color: var(--nika-primary); background: rgba(2,132,199,0.08); }
        .friends-inline-pill span.arrow { color: var(--nika-primary); font-weight: 800; }

        /* ---- Perfil Público ---- */
        /* ================================================================
           PERFIL PÚBLICO (#public-profile-modal) — dark glassmorphism premium
           Fondo fijo oscuro (independiente de body.dark-mode), blur de vidrio,
           glow por rango en la cabecera/avatar y grid de estadísticas.
           ================================================================ */
        #public-profile-modal.modal-overlay { background: rgba(2, 6, 23, 0.75); backdrop-filter: blur(6px); }
        .pp-card {
            max-width: 600px; padding: 0 0 28px; overflow: hidden; text-align: center; position: relative;
            background: rgba(15, 23, 42, 0.9);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border: 1px solid rgba(148, 163, 184, 0.18);
            box-shadow: 0 25px 60px -15px rgba(0,0,0,0.6);
            color: #f1f5f9;
        }
        .pp-close-btn { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,0.1); color: #fff; z-index: 2; }
        .pp-close-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
        .pp-back-btn { position: absolute; top: 14px; left: 14px; background: rgba(255,255,255,0.1); color: #fff; z-index: 2; font-size: 1.15rem; }
        .pp-back-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }

        /* Cabecera: fondo oscuro FORZADO (ya no usa var(--card-bg), que muta a
           blanco en modo claro) + glow sutil por rango. Fix cabecera blanca. */
        .pp-header {
            padding: 38px 32px 22px;
            background: #0f172a;
            border-bottom: 1px solid rgba(148, 163, 184, 0.12);
            transition: box-shadow 0.25s ease;
        }
        .pp-header.rank-admin   { box-shadow: inset 0 0 70px -18px rgba(239,68,68,0.4); }
        .pp-header.rank-premium { box-shadow: inset 0 0 70px -18px rgba(168,85,247,0.4); }
        .pp-header.rank-free    { box-shadow: inset 0 0 70px -18px rgba(14,165,233,0.35); }

        .pp-avatar-wrap { margin-bottom: 14px; }
        .pp-avatar { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 4px solid #0f172a; background: #1e293b; box-shadow: 0 6px 18px rgba(0,0,0,0.4); transition: box-shadow 0.2s ease, border-color 0.2s ease; }
        .pp-avatar.rank-admin   { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.35), 0 0 26px rgba(239,68,68,.75); }
        .pp-avatar.rank-premium { border-color: #a855f7; box-shadow: 0 0 0 3px rgba(168,85,247,.35), 0 0 26px rgba(192,132,252,.75); }
        .pp-avatar.rank-free    { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.3),  0 0 22px rgba(56,189,248,.65); }
        .pp-fullname { font-size: 1.3rem; font-weight: 800; color: #ffffff; margin: 12px 0 1px; transition: color 0.2s ease; }
        .pp-fullname.rank-admin   { color: #ef4444; }
        .pp-fullname.rank-premium { color: #a855f7; }
        .pp-fullname.rank-free    { color: #38bdf8; }
        .pp-username { font-size: 0.85rem; color: #94a3b8; font-weight: 600; }
        .pp-badges-row { margin: 12px 0 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
        .pp-badge { display: inline-block; background: rgba(56,189,248,0.14); color: #38bdf8; padding: 4px 13px; border-radius: 14px; font-size: 0.74rem; font-weight: 800; border: 1px solid rgba(56,189,248,0.25); }
        .pp-rank-badge.rank-admin   { background: rgba(239,68,68,0.14); color: #ef4444; border-color: rgba(239,68,68,0.3); }
        .pp-rank-badge.rank-premium { background: rgba(168,85,247,0.14); color: #a855f7; border-color: rgba(168,85,247,0.3); }
        .pp-rank-badge.rank-free    { background: rgba(14,165,233,0.14); color: #38bdf8; border-color: rgba(14,165,233,0.3); }

        .pp-bio { font-size: 0.85rem; color: #cbd5e1; line-height: 1.55; margin: 20px 32px 18px; text-align: left; }

        /* Grid de estadísticas: Año / ELO / Último acceso / Amigos + Primer acceso / Redes */
        .pp-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 32px 8px; }
        .pp-stat-card { background: rgba(255,255,255,0.05); border: 1px solid rgba(148,163,184,0.15); border-radius: 14px; padding: 14px 16px; text-align: left; display: flex; flex-direction: column; gap: 5px; }
        .pp-stat-card--wide { grid-column: 1 / -1; }
        .pp-stat-label { font-size: 0.68rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.4px; }
        .pp-stat-value { font-size: 0.9rem; font-weight: 700; color: #f1f5f9; }
        .pp-social-row { display: flex; gap: 14px; flex-wrap: wrap; }
        .pp-social-link { font-size: 0.85rem; font-weight: 700; color: #38bdf8; text-decoration: none; }
        .pp-social-link:hover { text-decoration: underline; }
        #pp-redes-empty { color: #64748b; font-weight: 600; }

        /* Tarjeta "Amigos" clickeable: despliega la mini-lista de amigos del perfil */
        .pp-stat-card--clickable { cursor: pointer; transition: background 0.15s ease, transform 0.15s ease; }
        .pp-stat-card--clickable:hover { background: rgba(255,255,255,0.09); transform: translateY(-1px); }
        .pp-stat-chevron { display: inline-block; margin-left: 3px; font-size: 0.7em; opacity: 0.6; transition: transform 0.2s ease; }
        .pp-stat-card--open .pp-stat-chevron { transform: rotate(180deg); }

        .pp-friends-list {
            margin: 4px 32px 0;
            background: rgba(15, 23, 42, 0.55);
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            border: 1px solid rgba(148,163,184,0.15);
            border-radius: 14px;
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            max-height: 220px;
            overflow-y: auto;
        }
        .pp-friends-list-empty { text-align: center; color: #94a3b8; font-size: 0.8rem; padding: 12px 6px; }
        .pp-friend-row {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 10px 12px;
            border-radius: 12px;
            background: rgba(255,255,255,0.03);
            border: 1px solid rgba(148,163,184,0.1);
            transition: background 0.15s ease;
        }
        .pp-friend-row:hover { background: rgba(255,255,255,0.07); }
        .pp-friend-row-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: #1e293b; border: 1px solid rgba(148,163,184,0.2); flex-shrink: 0; }
        .pp-friend-row-name { flex: 1; min-width: 0; font-size: 0.85rem; font-weight: 700; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 10px; }
        .pp-friend-row-add { flex-shrink: 0; margin-left: auto; border: none; cursor: pointer; background: linear-gradient(135deg, #0284c7, #0ea5e9); color: #fff; font-weight: 700; font-size: 0.72rem; padding: 6px 14px; border-radius: 16px; transition: transform 0.15s ease; white-space: nowrap; }
        .pp-friend-row-add:hover { transform: translateY(-1px); }

        .pp-actions-row { display: flex; justify-content: center; gap: 10px; margin: 22px 32px 0; flex-wrap: wrap; }
        .pp-btn { border: none; cursor: pointer; font-weight: 700; font-size: 0.85rem; padding: 11px 20px; border-radius: 24px; transition: transform 0.15s ease, opacity 0.15s ease; }
        .pp-btn:hover { transform: translateY(-1px); }
        .pp-btn:disabled { opacity: 0.55; cursor: default; transform: none; }
        .pp-btn-primary { background: linear-gradient(135deg, #0284c7, #0ea5e9); color: #fff; box-shadow: 0 4px 14px rgba(14,165,233,0.35); }
        .pp-btn-ghost { background: rgba(255,255,255,0.08); color: #f1f5f9; border: 1px solid rgba(148,163,184,0.2); }
        .pp-btn-ghost:hover { background: rgba(255,255,255,0.14); }

        @media (max-width: 640px) {
            .pp-card { max-width: 94vw; }
            .pp-header { padding: 30px 20px 18px; }
            .pp-bio, .pp-stats-grid, .pp-actions-row, .pp-friends-list { margin-left: 18px; margin-right: 18px; }
        }
        @media (max-width: 480px) {
            .pp-stats-grid { grid-template-columns: 1fr; }
        }

        /* ================= RESPONSIVO PROFUNDO: MODALES Y NOTIFICACIONES < 768px ================= */
        @media (max-width: 768px) {
            .modal-content { width: 95vw; max-width: 95vw; margin: 0 auto; padding: 20px 16px; max-height: 92vh; box-sizing: border-box; overflow-x: hidden; }
            #chat-modal .modal-content { height: min(560px, 85vh); }

            /* Chat privado a pantalla completa en mobile, como cualquier app de mensajería */
            .pc-content { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
            .pc-inbox-content { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
            .pc-back-btn { display: inline-flex; }
            .pc-close-btn { display: none; }
            .chat-bubble, .chat-question-card { max-width: 86%; }

            /* Notificaciones alineadas correctamente dentro de la pantalla en campus */
            .notification-dropdown, .dropdown-menu, .notif-box {
                left: 12px !important;
                right: 12px !important;
                width: auto !important;
                max-width: none !important;
                transform: none !important;
                box-sizing: border-box !important;
            }
        }

/* =====================================================================
   PANTALLA CLÍNICA — Chat multi-turno (Pase de Sala / Consultorio)
   Estética inmersiva y oscura fija (no depende de body.dark-mode), en
   línea con el motor de Shock Room. Sin reloj ni temporizador visible.
   ==================================================================== */
.clinica-screen {
    background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
    color: #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 45px -10px rgba(0, 0, 0, 0.6);
    width: 100%;
    max-width: 1200px; /* mismo ancho que .container / la grilla principal */
    margin: 0 auto;
}
.clinica-inner {
    display: flex;
    flex-direction: column;
    height: min(78vh, 780px);
    padding: 22px 30px 26px;
    box-sizing: border-box;
}

.clinica-topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.clinica-title {
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.3px;
    color: #f1f5f9;
}

/* Área central: historial de chat, ocupa todo el espacio disponible */
.clinica-chat-log {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px 4px 12px 2px;
    margin-bottom: 16px;
}

.clinica-bubble {
    max-width: 78%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
/* Usuario: tono azul, alineado a la derecha */
.clinica-bubble.rol-usuario {
    align-self: flex-end;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e0f2fe;
    border-bottom-right-radius: 4px;
}
/* IA: tono rojo/naranja cálido, alineado a la izquierda */
.clinica-bubble.rol-ia {
    align-self: flex-start;
    background: rgba(249, 115, 22, 0.14);
    border: 1px solid rgba(249, 115, 22, 0.35);
    color: #fed7aa;
    border-bottom-left-radius: 4px;
}
/* Sistema (avisos internos, placeholders): gris oscuro discreto */
.clinica-bubble.rol-sistema {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #94a3b8;
    font-style: italic;
    font-size: 0.88rem;
}

/* Área inferior: input amplio + acciones */
.clinica-input-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}
.clinica-textarea {
    width: 100%;
    resize: vertical;
    min-height: 110px;
    background: #0b0f19;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: #f1f5f9;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}
.clinica-textarea:focus { outline: none; border-color: #38bdf8; }

.clinica-input-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}
.clinica-mic-slot { display: flex; align-items: center; }

.clinica-btn-enviar {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #fff;
    border: none;
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s ease;
    margin-left: auto;
}
.clinica-btn-enviar:hover { transform: translateY(-2px); }
.clinica-btn-enviar:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

@media (max-width: 640px) {
    .clinica-inner { height: min(85vh, 720px); padding: 16px 16px 18px; }
    .clinica-bubble { max-width: 92%; }
}

/* =====================================================================
   HUB DE SIMULADORES (modal del mosaico "Simuladores")
   ===================================================================== */
#simuladores-hub-modal .sim-hub-content { max-width: 760px; padding: 26px; }
.sim-hub-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sim-hub-head h3 { font-size: 1.3rem; font-weight: 800; color: var(--text-main); margin: 0 0 4px; }
.sim-hub-head p { font-size: 0.82rem; color: var(--text-muted); margin: 0; }
.sim-hub-close { background: transparent; border: 1px solid var(--border); color: var(--text-muted); border-radius: 8px; width: 32px; height: 32px; cursor: pointer; font-size: 0.9rem; flex-shrink: 0; }
.sim-hub-close:hover { color: var(--danger); border-color: var(--danger); }
.sim-hub-plan { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: rgba(168, 85, 247, 0.08); border: 1px dashed rgba(168, 85, 247, 0.5); border-radius: 10px; padding: 9px 12px; margin-bottom: 14px; font-size: 0.8rem; color: var(--text-main); }
.sim-hub-plan-cta { color: #fff; background: linear-gradient(135deg, #7e22ce, #a855f7); border-radius: 999px; padding: 5px 12px; font-size: 0.74rem; font-weight: 800; text-decoration: none; white-space: nowrap; }
.sim-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sim-hub-item { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px; cursor: pointer; font-family: inherit; color: var(--text-main); transition: all 0.2s ease; }
.sim-hub-item:hover { transform: translateY(-2px); border-color: var(--nika-primary); box-shadow: 0 12px 24px -10px rgba(2, 132, 199, 0.3); }
.sim-hub-item:focus-visible { outline: 2px solid var(--nika-primary); outline-offset: 2px; }

/* 1. Para lectores de pantalla en los inputs */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 2. Para el cartel de advertencia en el Asistente Nika */
.nika-float-disclaimer {
    font-size: 0.68rem;
    line-height: 1.35;
    color: var(--text-dim, #94a3b8);
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 8px;
    padding: 6px 10px;
    margin: 0 0 8px 0;
}
.sim-hub-item--wide { grid-column: 1 / -1; background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), transparent); }
.sim-hub-item.is-locked { border-style: dashed; opacity: 0.8; }
.sim-hub-ico { font-size: 1.7rem; line-height: 1; flex-shrink: 0; }
.sim-hub-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sim-hub-title { font-size: 0.92rem; font-weight: 800; }
.sim-hub-ai { font-style: normal; font-size: 0.6rem; font-weight: 800; letter-spacing: 0.5px; color: var(--nika-primary); background: rgba(2, 132, 199, 0.12); border-radius: 5px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; }
.sim-hub-desc { font-size: 0.76rem; color: var(--text-muted); line-height: 1.35; }
.sim-hub-badge { align-self: flex-start; margin-top: 4px; font-size: 0.68rem; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.sim-hub-badge.is-free { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.sim-hub-badge.is-warn { background: rgba(202, 138, 4, 0.16); color: var(--warning); }
.sim-hub-badge.is-out { background: rgba(239, 68, 68, 0.12); color: var(--danger); }
.sim-hub-badge.is-vip { background: linear-gradient(135deg, #a855f7, #c084fc); color: #fff; }
@media (max-width: 560px) { .sim-hub-grid { grid-template-columns: 1fr; } #simuladores-hub-modal .sim-hub-content { padding: 20px 16px; } }

/* =====================================================================
   NIKAMED+ — distinción visual para cuentas vip / premium
   (la clase body.nika-vip la pone NikaAcceso.aplicarEstadoVip())
   ===================================================================== */
.account-btn-name { display: inline-block; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
@media (max-width: 640px) { .account-btn-name { max-width: 26vw; } }

.nika-vip-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 2px 8px; border-radius: 999px; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.3px; line-height: 1.4; white-space: nowrap; vertical-align: middle; color: #fff; background: linear-gradient(135deg, #a855f7 0%, #c084fc 100%); box-shadow: 0 0 10px rgba(168, 85, 247, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.35); flex-shrink: 0; }
/* El sidebar tiene una regla más específica para los <span> del bloque de usuario: se la gana */
.sidebar-user-info .nika-vip-badge { color: #fff; font-size: 0.6rem; }
.account-btn .nika-vip-badge { background: rgba(255, 255, 255, 0.22); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55); }

body.nika-vip .account-btn { background: linear-gradient(135deg, #7e22ce 0%, #a855f7 100%); box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.6), 0 4px 16px rgba(168, 85, 247, 0.45); }
body.nika-vip .sidebar-user-card { background: rgba(168, 85, 247, 0.16); border-color: rgba(192, 132, 252, 0.6); box-shadow: 0 0 18px -4px rgba(168, 85, 247, 0.55); }
body.nika-vip .sidebar-user-card:hover { background: rgba(168, 85, 247, 0.26); }
body.nika-vip .sidebar-user-avatar { border-color: #c084fc; box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.35), 0 0 12px rgba(192, 132, 252, 0.6); }
body.nika-vip .sidebar-user-info span:not(.nika-vip-badge) { color: #c084fc; }
body.nika-vip .action-btn-card:hover,
body.nika-vip .sim-hub-item:hover { border-color: #a855f7; box-shadow: 0 14px 28px -10px rgba(168, 85, 247, 0.4); }
body.nika-vip .action-btn-card--sim { border-color: rgba(168, 85, 247, 0.55); background: linear-gradient(160deg, var(--card-bg) 60%, rgba(168, 85, 247, 0.12)); }

/* ==========================================================
   Jerarquía Visual / Rangos de usuario (Fase 3)
   Clases inyectadas por aplicarRangoUsuario() en campus.html:
   .profile-admin (rojo), .profile-premium (violeta), .profile-free (azul).
   ========================================================== */

/* Nombre del usuario en el sidebar, coloreado según su rango */
#sidebar-user-name.profile-admin { color: var(--rank-admin, #ef4444); }
#sidebar-user-name.profile-premium { color: var(--violet, #a855f7); }
#sidebar-user-name.profile-free { color: var(--nika-primary); }

/* Etiqueta de rango (debajo del nombre, junto al ELO) */
.sidebar-user-rank { display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.2px; margin-top: 1px; }
.sidebar-user-rank.profile-admin { color: var(--rank-admin, #ef4444); }
.sidebar-user-rank.profile-premium { color: var(--violet, #a855f7); }
.sidebar-user-rank.profile-free { color: var(--nika-primary); }

/* Glow del avatar según rango */
#sidebar-avatar-img.profile-admin { border-color: var(--rank-admin, #ef4444); box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35), 0 0 12px rgba(239, 68, 68, 0.6); }
#sidebar-avatar-img.profile-premium { border-color: var(--violet, #a855f7); box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.35), 0 0 12px rgba(192, 132, 252, 0.6); }
#sidebar-avatar-img.profile-free { border-color: var(--nika-primary); box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.3), 0 0 10px rgba(56, 189, 248, 0.5); }

/* Logo dinámico: texto "Campus NikaMed" con degradado violeta para admin/premium */
.sidebar-brand-name { font-size: 1.05rem; font-weight: 800; color: #ffffff; letter-spacing: -0.3px; margin: 2px 0 0; }
.sidebar-brand-name--premium {
    background: linear-gradient(135deg, #a855f7 0%, #e9d5ff 50%, #c084fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.nika-vip .continuity-progress-fill { background: linear-gradient(90deg, #a855f7, #c084fc); }
body.nika-vip .btn-continue-action { background: linear-gradient(135deg, #7e22ce, #a855f7); }
body.nika-vip .btn-continue-action:hover { background: linear-gradient(135deg, #6b21a8, #9333ea); }
body.nika-vip .sim-hub-item--wide { background: linear-gradient(135deg, rgba(168, 85, 247, 0.10), transparent); }
body.nika-vip .sim-hub-ai { color: #a855f7; background: rgba(168, 85, 247, 0.14); }

/* ==========================================================
   PAYWALL VISUAL — Asistente Nika (NotebookLM) en estudio.html
   Blur/glassmorphism + candado sobre el chat cuando el plan
   efectivo del usuario (ver getNikaUserRole() en estudio.js)
   es 'free'. El acento usa var(--nika-primary), así que se
   adapta solo al azul de Cirugía o al rosa de Ginecología.
   ========================================================== */
#module-chat-body.module-chat-locked {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.2s ease;
}

.module-chat-paywall-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(248, 250, 252, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 5;
    border-radius: 10px;
}

.module-chat-paywall-card {
    max-width: 320px;
    text-align: center;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 16px;
    padding: 28px 24px;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.25);
}

.module-chat-paywall-lock {
    width: 52px;
    height: 52px;
    margin: 0 auto 14px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.12);
    color: #64748b;
}

.module-chat-paywall-text {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--text-main, #1e293b);
    margin: 0 0 18px 0;
}

.module-chat-paywall-text strong {
    color: var(--nika-dark, #0f172a);
}

.module-chat-paywall-btn {
    padding: 11px 22px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(120deg, var(--nika-accent, #38bdf8), var(--nika-primary, #0284c7));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.module-chat-paywall-btn:hover {
    opacity: 0.88;
}

/* ==========================================================
   BURBUJAS DE CHAT — Asistente Nika (NotebookLM) Premium
   Usan var(--nika-primary) / var(--nika-accent), así que
   heredan solas el azul de Cirugía o el rosa/violeta de
   Ginecología sin tocar ninguna paleta.
   ========================================================== */
.nika-chat-row {
    display: flex;
    width: 100%;
}
.nika-chat-row--user { justify-content: flex-end; }
.nika-chat-row--bot { justify-content: flex-start; }

.nika-chat-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.5;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.nika-chat-bubble--user {
    background: linear-gradient(120deg, var(--nika-accent, #38bdf8), var(--nika-primary, #0284c7));
    color: #fff;
    border-radius: 14px 14px 4px 14px;
}

.nika-chat-bubble--bot {
    background: #ffffff;
    border: 1px solid var(--border, #e2e8f0);
    color: var(--text-main, #1e293b);
    border-radius: 14px 14px 14px 4px;
}

.nika-chat-bubble--error {
    background: #fef2f2;
    border: 1px solid rgba(220, 38, 38, 0.25);
    color: #991b1b;
    border-radius: 14px 14px 14px 4px;
}

/* Indicador "escribiendo..." con puntitos animados */
.nika-chat-bubble--typing {
    display: flex;
    align-items: center;
    gap: 8px;
    font-style: italic;
    color: var(--text-muted, #64748b);
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
}

.nika-chat-typing-label {
    font-size: 0.8rem;
}

.nika-chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.nika-chat-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--nika-primary, #0284c7);
    opacity: 0.35;
    animation: nika-typing-bounce 1.1s infinite ease-in-out;
}

.nika-chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.nika-chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes nika-typing-bounce {
    0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* ==========================================================
   PLANIFICADOR DIARIO (TIMEBOXING) — Tabs dentro del modal
   "Agendar en mi calendario" (glassmorphism oscuro).
   Los acentos usan var(--nika-primary)/var(--nika-accent),
   así heredan azul en Cirugía y rosa/violeta en Ginecología.
   ========================================================== */

/* ---- Tabs superiores: "Próximo Examen" / "Organizá tu Día" ----
   Formato píldora integrada, tipo segmented-control premium: cápsula
   gris oscura semi-transparente + una píldora interna que cambia a
   degradado --nika-primary al estar activa. Todo scopeado bajo
   #modal-agendar-repaso para blindarlo de cualquier reset genérico
   de "button" que pueda vivir en otra parte de la hoja de estilos. */
#modal-agendar-repaso .nika-agendar-tabs {
    display: flex;
    gap: 4px;
    background: rgba(15, 23, 42, 0.55); /* cápsula gris oscura semi-transparente */
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    padding: 5px;
    margin-bottom: 20px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

#modal-agendar-repaso .nika-agendar-tab-btn {
    flex: 1;
    padding: 9px 10px;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                color 0.25s ease,
                box-shadow 0.35s ease,
                transform 0.15s ease;
}

#modal-agendar-repaso .nika-agendar-tab-btn:hover:not(.active) {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.08);
}

#modal-agendar-repaso .nika-agendar-tab-btn:active {
    transform: scale(0.97);
}

/* Pestaña activa: cápsula redondeada + degradado --nika-primary. */
#modal-agendar-repaso .nika-agendar-tab-btn.active {
    border-radius: 99px;
    background: linear-gradient(120deg, var(--nika-accent, #38bdf8), var(--nika-primary, #0284c7));
    color: #0b1329;
    box-shadow: 0 4px 14px -4px rgba(0, 0, 0, 0.45);
}

.nika-agendar-tab-panel {
    animation: nika-tab-fade 0.25s ease;
}

@keyframes nika-tab-fade {
    from { opacity: 0; transform: translateY(2px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- Botón "+ Agregar Bloque" ----
   Mismo look & feel que "Guardar en mi Calendario": ancho completo,
   redondeado 9px, texto centrado, degradado --nika-accent → --nika-primary. */
#modal-agendar-repaso .nika-agendar-tab-add-btn {
    display: block;
    width: 100%;
    padding: 11px;
    border: none;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--nika-accent, #38bdf8), var(--nika-primary, #0284c7));
    color: #0b1329;
    font-weight: 800;
    font-size: 0.82rem;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s ease, transform 0.15s ease;
}

#modal-agendar-repaso .nika-agendar-tab-add-btn:hover {
    opacity: 0.9;
}

#modal-agendar-repaso .nika-agendar-tab-add-btn:active {
    transform: scale(0.98);
}

/* ---- Inputs de hora (Planificador Diario) ----
   Sin esto, el navegador pinta el ícono/selector del input "time" con
   su esquema de color CLARO por defecto (de ahí el azul brillante
   sobre fondo oscuro). color-scheme:dark le avisa al navegador que
   dibuje el picker y el ícono nativo en modo oscuro, a tono con el
   resto del modal glassmorphism. */
#modal-agendar-repaso input[type="time"] {
    width: 100%;
    padding: 9px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    font-size: 0.82rem;
    color-scheme: dark;
    transition: border-color 0.2s ease, background 0.2s ease;
}

#modal-agendar-repaso input[type="time"]:focus {
    outline: none;
    border-color: var(--nika-primary, #0284c7);
    background: rgba(255, 255, 255, 0.08);
}

/* Ícono nativo del selector de hora en WebKit/Chromium: lo aclaramos
   para que se vea bien sobre el fondo oscuro del modal. */
#modal-agendar-repaso input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(1.4);
    cursor: pointer;
}

/* ---- Fila de bloque horario en la lista del día ---- */
.nika-timeblock-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 9px;
    transition: opacity 0.2s ease;
}

.nika-timeblock-row.is-done {
    opacity: 0.6;
}

.nika-timeblock-checkbox {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    accent-color: var(--nika-primary, #0284c7);
    cursor: pointer;
}

.nika-timeblock-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.nika-timeblock-hora {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--nika-accent, #38bdf8);
    letter-spacing: 0.02em;
}

.nika-timeblock-tarea {
    font-size: 0.82rem;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nika-timeblock-row.is-done .nika-timeblock-tarea {
    text-decoration: line-through;
    text-decoration-color: rgba(226, 232, 240, 0.55);
    color: #94a3b8;
}

.nika-timeblock-delete {
    flex-shrink: 0;
    border: none;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    width: 26px;
    height: 26px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s ease;
}

.nika-timeblock-delete:hover {
    background: rgba(239, 68, 68, 0.28);
}
