/* ==========================================================================
   Educa Tech IA - Estilos Globales y Dashboard
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #1343a7;
    /* Azul Educa Tech */
    --secondary: #ff6600;
    /* Naranja Educa Tech IA */
    --primary-soft: #f0f4ff;
    --sidebar-bg: #ffffff;
    --page-bg: #f8fafc;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border: #f1f5f9;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.04);
    --radius-xl: 28px;
    --radius-l: 20px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--page-bg);
    color: var(--text-dark);
    display: flex;
    min-height: 100vh;
}

/* Sidebar Pro */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
}

/* Sidebar custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 12px !important;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent !important;
}

.sidebar::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--primary) 40%, transparent) !important;
    border-radius: 10px !important;
    border: 2px solid transparent !important;
    background-clip: content-box !important;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--primary) 60%, transparent) !important;
    background-clip: content-box !important;
}

.sidebar {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--primary) 40%, transparent) transparent;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 40px;
    padding: 0 10px;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #94a3b8;
    margin-bottom: 14px;
    padding-left: 12px;
    font-weight: 700;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.25s;
    margin-bottom: 6px;
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-item:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

/* Main Content area */
.main {
    flex: 1;
    margin-left: 260px;
    padding: 24px 48px 60px;
    min-width: 0;
}

/* Top Header Area */
.topbar,
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.welcome h2 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.welcome p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-bar {
    flex: 0 1 420px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-bar i {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    font-size: 1rem;
}

.search-bar input {
    width: 100%;
    padding: 12px 24px 12px 48px;
    border-radius: 40px;
    border: 1px solid var(--border);
    background: #fff;
    outline: none;
    font-size: 0.9rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    transition: all 0.3s;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(34, 79, 172, 0.1);
    width: 110%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.btn-upgrade {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 10px 24px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(34, 79, 172, 0.15);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px rgba(34, 79, 172, 0.25);
}

.user-profile {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--primary);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.user-profile:hover {
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Hero Custom */
.hero {
    background-color: var(--primary);
    background-image: radial-gradient(at 100% 0%, var(--secondary) 0%, transparent 50%);
    border-radius: var(--radius-xl);
    padding: 50px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(34, 79, 172, 0.2);
}

.hero-desc h1 {
    font-size: 2.4rem;
    margin-bottom: 12px;
}

.hero-desc p {
    opacity: 0.8;
    font-size: 1.1rem;
    max-width: 600px;
    margin-bottom: 25px;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.tab-btn {
    padding: 12px 24px;
    border-radius: 40px;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Tools Grid Area */
.grid-header {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: #1e293b;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.tool-card {
    background: #fff;
    border: 1.5px solid var(--primary-soft);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-l);
    padding: 22px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 180px;
}


.tool-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(34, 79, 172, 0.08);
    border-color: var(--primary);
    background: linear-gradient(to bottom, #ffffff, #fcfdff);
}

.tool-card:hover .tool-icon {
    background: var(--primary);
    color: white !important;
    transform: rotate(5deg) scale(1.1);
}

.tool-tag {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 0.58rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 40px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag-plan {
    background: #eef2ff;
    color: var(--primary);
}

.tag-eval {
    background: #ecfdf5;
    color: #10b981;
}

.tag-toe {
    background: #fff7ed;
    color: #f59e0b;
}

.tag-rural {
    background: #f0fdf4;
    color: #059669;
}

.tool-icon {
    font-size: 1.5rem;
    width: 46px;
    height: 46px;
    background: #f8fafc;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    transition: 0.3s;
}

.tool-card h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.2;
}

.tool-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.start-indicator {
    margin-top: auto;
    padding-top: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.8rem;
    opacity: 0;
    transform: translateX(-5px);
    transition: 0.3s;
}

.tool-card:hover .start-indicator {
    opacity: 1;
    transform: translateX(0);
}

.tool-credits {
    position: absolute;
    bottom: 18px;
    right: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 4px 10px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.tool-card:hover .tool-credits {
    background: #e0e7ff;
    color: #4f46e5;
    border-color: #c7d2fe;
    transform: scale(1.05);
}

.tool-credits i {
    color: #4f46e5;
    font-size: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes highlight-example-fade {
    0% {
        background-color: #fffbeb !important;
        /* Suave color de fondo ámbar */
        border-color: #f59e0b !important;
        /* Borde ámbar brillante (encendido) */
        box-shadow: 0 0 12px 3px rgba(245, 158, 11, 0.45), 0 0 0 4px rgba(245, 158, 11, 0.15) !important;
        /* Efecto neón / resplandor */
    }

    100% {
        background-color: #ffffff !important;
        border-color: #cbd5e1 !important;
        box-shadow: none !important;
    }
}

.highlight-example {
    background-color: #fffbeb !important;
    border-color: #f59e0b !important;
    box-shadow: 0 0 12px 3px rgba(245, 158, 11, 0.45), 0 0 0 4px rgba(245, 158, 11, 0.15) !important;
    animation: highlight-example-fade 2s ease-out !important;
}

/* Sidebar Footer / Credits */
.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.credit-card {
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* ==========================================================================
   Herramienta: Planificación Anual
   ========================================================================== */

/* ==========================================================================
   Herramienta: Planificación Anual (Premium Design)
   ========================================================================== */

.pa-tool-content {
    color: var(--text-dark);
}

.pa-tool-content .container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

/* Form Grid System */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.form-group label {
    width: 220px;
    flex-shrink: 0;
    justify-content: flex-end;
    text-align: right;
}

@media (max-width: 1280px) {
    .form-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .form-group label {
        width: 100%;
        justify-content: flex-start;
        text-align: left;
        margin-bottom: 2px;
    }
}

/* Premium Cards */
.pa-tool-content .card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.03);
    margin-bottom: 16px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.pa-tool-content .card:hover {
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

/* Section Badges */
.pa-tool-content .section-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 15px;
    border: 1px solid rgba(34, 79, 172, 0.1);
}

.pa-tool-content .section-label i {
    font-size: 1rem;
}

/* Inputs & Selects */
.pa-tool-content label {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pa-tool-content input[type="text"],
.pa-tool-content input[type="number"],
.pa-tool-content select,
.pa-tool-content textarea {
    width: 100%;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    padding: 10px 14px;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-dark);
    transition: all 0.2s ease;
}

.pa-tool-content input:hover,
.pa-tool-content select:hover,
.pa-tool-content textarea:hover {
    border-color: #94a3b8;
}

.pa-tool-content input:focus,
.pa-tool-content select:focus,
.pa-tool-content textarea:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(34, 79, 172, 0.1);
}

/* IA Textarea Special Styling */
.ia-field {
    font-size: 0.95rem !important;
    color: #334155 !important;
    line-height: 1.7 !important;
    overflow-x: auto;
}

.ia-field:focus {
    border-style: solid !important;
    border-color: var(--primary) !important;
}

/* Generate Button (The Hero Action) */
.btn-generate {
    background: linear-gradient(135deg, var(--primary), #4338ca);
    color: white;
    border: none;
    padding: 14px 40px;
    border-radius: 16px;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(34, 79, 172, 0.3);
    width: fit-content;
    min-width: 320px;
    margin: 25px auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-generate:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(34, 79, 172, 0.4);
    background: linear-gradient(135deg, #2e5ec7, #4f46e5);
}

.btn-generate:active {
    transform: translateY(0) scale(0.98);
}

/* Magic Loader - Futuristic Elegant Glassmorphism (Light Theme) */
#loader {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(248, 250, 252, 0.96) 0%, rgba(241, 245, 249, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #0f172a;
    font-weight: 700;
    transition: all 0.4s ease;
}

.loader-futuristic-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    max-width: 500px;
    width: 90%;
    padding: 40px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.loader-glow-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(19, 67, 167, 0.12) 0%, rgba(19, 67, 167, 0.03) 60%, transparent 100%);
    filter: blur(30px);
    pointer-events: none;
    z-index: 0;
}

.loader-header-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 30px;
    width: 100%;
    margin-bottom: 35px;
    z-index: 1;
}

.loader-logo-wrapper {
    position: relative;
    width: 230px;
    height: 76.6px;
    display: inline-block;
    z-index: 1;
}

.loader-logo-svg-combined {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.05));
}

.neural-path {
    fill: none;
    stroke: #ff6600;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-dasharray: 85;
    stroke-dashoffset: 85;
    animation: logo-flow-connection 3s ease-in-out infinite;
    opacity: 0.8;
}

.glowing-node {
    fill: #ff6600;
    animation: logo-node-pulse 1.5s ease-in-out infinite;
}

/* Retrasos escalonados para la fluidez de conexiones */
.line-ul {
    animation-delay: 0s;
}

.node-ul {
    animation-delay: 0.75s;
}

.line-ll {
    animation-delay: 0.4s;
}

.node-ll {
    animation-delay: 1.15s;
}

.line-ur {
    animation-delay: 0.8s;
}

.node-ur {
    animation-delay: 1.55s;
}

.line-lr {
    animation-delay: 1.2s;
}

.node-lr {
    animation-delay: 1.95s;
}

@keyframes logo-flow-connection {
    0% {
        stroke-dashoffset: 85;
        opacity: 0;
    }

    25% {
        opacity: 1;
    }

    75% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 0;
    }
}

@keyframes logo-node-pulse {

    0%,
    100% {
        r: 3px;
        opacity: 0.35;
        fill: #1343a7;
    }

    50% {
        r: 6.5px;
        opacity: 1;
        fill: #ff6600;
    }
}

/* ==========================================================================
   ESTILOS DE LOGOTIPO VECTORIAL Y ANIMADO (PULSOS Y ALETEO DE LIBRO)
   ========================================================================== */
.vector-head {
    fill: #1343a7;
    animation: vector-head-glow 4s ease-in-out infinite alternate;
}

.vector-book-page {
    fill: #ff6600;
    transform-origin: 46px 20px;
    animation: vector-book-flutter 3s ease-in-out infinite alternate;
}

@keyframes vector-head-glow {

    0%,
    100% {
        fill: #1343a7;
        filter: drop-shadow(0 0 1px rgba(19, 67, 167, 0.2));
    }

    50% {
        fill: #0d2c6e;
        filter: drop-shadow(0 0 5px rgba(19, 67, 167, 0.45));
    }
}

@keyframes vector-book-flutter {

    0%,
    100% {
        transform: rotate(0deg) scale(1);
    }

    50% {
        transform: rotate(-2.5deg) scaleY(1.04);
    }
}

.loader-spinner-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

/* === DISEÑO OFICIAL: Anillos Concéntricos SVG === */
.loader-svg-spinner {
    width: 100%;
    height: 100%;
    display: block;
}

/* Efecto de brillo sutil para el diseño oficial concentric-svg */
.loader-svg-spinner.concentric-svg {
    filter: drop-shadow(0 0 8px rgba(19, 67, 167, 0.25)) drop-shadow(0 0 3px rgba(255, 102, 0, 0.15));
}

.svg-ring {
    transform-origin: 50px 50px;
    transition: stroke-dashoffset 0.3s ease;
}

.svg-ring-outer {
    animation: svg-spin-clockwise 1.8s linear infinite;
}

.svg-ring-inner {
    animation: svg-spin-counter-clockwise 1.2s linear infinite;
}

.svg-core {
    animation: svg-pulse 1.8s ease-in-out infinite;
    transform-origin: 50px 50px;
}

@keyframes svg-spin-clockwise {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes svg-spin-counter-clockwise {
    0% {
        transform: rotate(360deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes svg-pulse {

    0%,
    100% {
        transform: scale(0.82);
        opacity: 0.55;
        fill: #1343a7;
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        fill: #ff6600;
    }
}

/* ==========================================================================
   DISEÑOS ADICIONALES DE LOADER IA
   ========================================================================== */

/* 2. Órbitas Cruzadas (orbital-helix) */
.orbital-helix .orbit-1 {
    animation: orbit-spin-clockwise 2.2s linear infinite;
    transform-origin: 50px 50px;
}

.orbital-helix .orbit-2 {
    animation: orbit-spin-counter-clockwise 1.8s linear infinite;
    transform-origin: 50px 50px;
}

@keyframes orbit-spin-clockwise {
    0% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: -220;
    }
}

@keyframes orbit-spin-counter-clockwise {
    0% {
        stroke-dashoffset: 220;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

/* 3. Infinito Fluido (fluid-infinity) */
.infinity-loader-container {
    width: 120px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.fluid-infinity {
    width: 100%;
    height: 100%;
}

.infinity-glow {
    animation: infinity-flow 2s linear infinite;
}

@keyframes infinity-flow {
    0% {
        stroke-dashoffset: 200;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

/* 4. Sonar/Radar Holográfico (hologram-radar) */
.hologram-radar .radar-wave {
    transform-origin: 50px 50px;
    animation: radar-pulse 2.4s cubic-bezier(0.215, 0.610, 0.355, 1) infinite;
    opacity: 0;
}

.hologram-radar .wave-1 {
    animation-delay: 0s;
}

.hologram-radar .wave-2 {
    animation-delay: 0.8s;
}

.hologram-radar .wave-3 {
    animation-delay: 1.6s;
}

@keyframes radar-pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
        stroke-width: 4px;
    }

    100% {
        transform: scale(4);
        opacity: 0;
        stroke-width: 0.5px;
    }
}

/* 5. Red Neuronal de Nodos (neural-network) */
.neural-network .signal-line {
    animation: signal-flow 1.6s linear infinite;
}

.neural-network .sig-1 {
    animation-delay: 0s;
}

.neural-network .sig-2 {
    animation-delay: 0.53s;
}

.neural-network .sig-3 {
    animation-delay: 1.06s;
}

.neural-network .neural-node {
    animation: node-glow 1.6s ease-in-out infinite;
}

.neural-network .node-1 {
    animation-delay: 0s;
}

.neural-network .node-2 {
    animation-delay: 0.53s;
}

.neural-network .node-3 {
    animation-delay: 1.06s;
}

@keyframes signal-flow {
    0% {
        stroke-dashoffset: 68;
    }

    100% {
        stroke-dashoffset: -68;
    }
}

@keyframes node-glow {

    0%,
    100% {
        opacity: 0.7;
        r: 6.5px;
    }

    50% {
        opacity: 1;
        r: 10px;
    }
}

/* 6. ADN Pedagógico (dna-helix) */
.dna-helix {
    width: 120px;
    height: 60px;
}

.dna-dot {
    animation: dna-wave-motion 2.2s ease-in-out infinite;
}

/* Retrasos dinámicos en la cadena A (Azul) */
.dot-a1 {
    animation-delay: 0s;
}

.dot-a2 {
    animation-delay: 0.15s;
}

.dot-a3 {
    animation-delay: 0.3s;
}

.dot-a4 {
    animation-delay: 0.45s;
}

.dot-a5 {
    animation-delay: 0.6s;
}

.dot-a6 {
    animation-delay: 0.75s;
}

/* Retrasos dinámicos en la cadena B (Naranja) - Desfasados 1.1s */
.dot-b1 {
    animation-delay: -1.1s;
}

.dot-b2 {
    animation-delay: -0.95s;
}

.dot-b3 {
    animation-delay: -0.8s;
}

.dot-b4 {
    animation-delay: -0.65s;
}

.dot-b5 {
    animation-delay: -0.5s;
}

.dot-b6 {
    animation-delay: -0.35s;
}

@keyframes dna-wave-motion {

    0%,
    100% {
        transform: translateY(-16px);
        r: 6.5px;
        opacity: 0.95;
    }

    50% {
        transform: translateY(16px);
        r: 3.5px;
        opacity: 0.45;
    }
}

/* 7. Bloques 3D (cube-isometric) */
.cube-isometric {
    width: 80px;
    height: 80px;
}

.cube-isometric .cube-group {
    animation: cube-float-motion 2s ease-in-out infinite alternate;
    transform-origin: 50px 54px;
}

.cube-isometric .face-top {
    animation: face-top-slide 1.8s ease-in-out infinite alternate;
}

.cube-isometric .face-left {
    animation: face-left-slide 1.8s ease-in-out infinite alternate;
}

.cube-isometric .face-right {
    animation: face-right-slide 1.8s ease-in-out infinite alternate;
}

@keyframes cube-float-motion {
    0% {
        transform: translateY(4px) rotate(0deg);
    }

    100% {
        transform: translateY(-6px) rotate(3deg);
    }
}

@keyframes face-top-slide {

    0%,
    15% {
        transform: translate(0, 0);
    }

    85%,
    100% {
        transform: translate(0, -12px);
    }
}

@keyframes face-left-slide {

    0%,
    15% {
        transform: translate(0, 0);
    }

    85%,
    100% {
        transform: translate(-10px, 6px);
    }
}

@keyframes face-right-slide {

    0%,
    15% {
        transform: translate(0, 0);
    }

    85%,
    100% {
        transform: translate(10px, 6px);
    }
}

/* 8. Vórtice Solar (particle-vortex) */
.particle-vortex {
    width: 85px;
    height: 85px;
}

.particle-vortex .vortex-particle {
    transform-origin: 50px 50px;
    animation: vortex-spin-motion 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.particle-vortex .vp-1 {
    animation-duration: 1.2s;
    animation-delay: 0s;
}

.particle-vortex .vp-2 {
    animation-duration: 1.6s;
    animation-delay: -0.4s;
}

.particle-vortex .vp-3 {
    animation-duration: 2s;
    animation-delay: -0.8s;
}

.particle-vortex .vp-4 {
    animation-duration: 2.4s;
    animation-delay: -1.2s;
}

@keyframes vortex-spin-motion {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.95;
    }

    50% {
        transform: rotate(180deg) scale(0.65);
        opacity: 0.35;
    }

    100% {
        transform: rotate(360deg) scale(1);
        opacity: 0.95;
    }
}

/* 9. Hexágono Tecnológico (tech-hexagon) */
.tech-hexagon {
    width: 80px;
    height: 80px;
}

.tech-hexagon .hex-path {
    transform-origin: 50px 50px;
}

.tech-hexagon .hex-1 {
    animation: hex-trace-clockwise 2s linear infinite;
}

.tech-hexagon .hex-2 {
    animation: hex-trace-counter 2s linear infinite;
}

@keyframes hex-trace-clockwise {
    0% {
        stroke-dashoffset: 0;
    }

    100% {
        stroke-dashoffset: -240;
    }
}

@keyframes hex-trace-counter {
    0% {
        stroke-dashoffset: 240;
    }

    100% {
        stroke-dashoffset: 0;
    }
}

.loader-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    z-index: 1;
}

.loader-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #64748b;
    font-weight: 800;
    text-align: center;
}

.loader-status {
    font-size: 1.15rem;
    color: #0f172a;
    font-weight: 600;
    max-width: 320px;
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.5;
    animation: pulseStatus 2s infinite ease-in-out;
}

@keyframes pulseStatus {

    0%,
    100% {
        opacity: 0.75;
    }

    50% {
        opacity: 1;
    }
}

.loader-disclaimer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 12px;
    color: #991b1b;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
    max-width: 380px;
    z-index: 1;
}

.loader-disclaimer i {
    color: #ef4444;
    font-size: 0.9rem;
    flex-shrink: 0;
}

@keyframes pulseLoader {
    0% {
        transform: translateY(0);
        opacity: 0.8;
    }

    50% {
        transform: translateY(-5px);
        opacity: 1;
    }

    100% {
        transform: translateY(0);
        opacity: 0.8;
    }
}

.btn-load-example {
    font-size: 0.85rem;
    color: #b45309;
    cursor: pointer;
    font-weight: 700;
    background: #fef3c7;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid #fde68a;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    animation: gentlePulse 2s infinite;
}

.btn-load-example:hover {
    background: #fde68a;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(180, 83, 9, 0.15);
}

.btn-load-example i {
    color: #d97706;
}

.btn-clear-example {
    font-size: 0.85rem;
    color: #b91c1c;
    cursor: pointer;
    font-weight: 700;
    background: #fee2e2;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid #fca5a5;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-clear-example:hover {
    background: #fca5a5;
    color: #7f1d1d;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(185, 28, 28, 0.15);
}

.btn-clear-example i {
    color: #b91c1c;
}

.btn-clear-example:hover i {
    color: #7f1d1d;
}


@keyframes gentlePulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.2);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 0 0 8px rgba(217, 119, 6, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
    }
}

/* ==========================================================================
   Resultados y Exportación (Premium Layout)
   ========================================================================== */

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
    background: #ffffff;
}

.info-table th {
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 700;
    text-align: left;
    padding: 14px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 30%;
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.main-info-table th {
    background-color: #f8fafc !important;
    color: #0f172a !important;
    border: 1px solid #e2e8f0 !important;
}

.info-table td {
    vertical-align: middle;
    padding: 14px 20px;
    border: 1px solid #e2e8f0;
    line-height: 1.5;
    color: #0f172a;
    font-weight: 500;
}

.info-table tr:hover td {
    background-color: #fcfcfd;
}

.ia-field table {
    width: 100%;
    min-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.ia-field table th {
    background: #1343a7;
    color: #ffffff;
    font-weight: 700;
    text-align: center;
    padding: 12px 16px;
    border: 1px solid #1343a7;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.ia-field table td {
    vertical-align: middle;
    padding: 12px 16px;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.5;
    color: #475569;
    transition: background-color 0.2s ease;
}

.ia-field table tr:last-child td {
    border-bottom: none;
}

.ia-field table tr:nth-child(even) td {
    background: #f8fafc;
}

.ia-field table tr:hover td {
    background: #f1f5f9;
}

.ia-field h1,
.ia-field h2,
.ia-field h3 {
    color: var(--primary);
    margin-top: 25px;
    margin-bottom: 15px;
    border-bottom: 2px solid #eef2ff;
    padding-bottom: 8px;
}

.ia-field ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

/* Acciones Superiores (Sticky Bar) */
.top-actions {
    position: sticky;
    top: 20px;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 16px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    /* Transición suave al flotar */
    transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

/* Estado flotante: se activa cuando el bar se separa de su posición natural */
.top-actions.is-floating {
    background: rgb(255 255 255 / 10%);
    backdrop-filter: blur(24px) saturate(200%);
    -webkit-backdrop-filter: blur(24px) saturate(200%);
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: -1px -1px 32px rgba(13, 44, 110, 0.35), 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* Ajustar colores de botones al flotar */
.top-actions.is-floating .btn-nav {
    background: rgb(255 102 0);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.top-actions.is-floating .btn-nav:hover {
    background: rgb(230 92 0);
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
    transform: translateX(-5px);
}

.top-actions-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    text-decoration: none;
    font-family: 'Outfit', sans-serif;
}

.btn-nav {
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

.btn-nav:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateX(-5px);
    color: var(--primary);
}

.btn-doc {
    background: linear-gradient(135deg, #2b579a 0%, #185abd 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(43, 87, 154, 0.2);
}

.btn-doc:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(43, 87, 154, 0.3);
}

.btn-pdf {
    background: linear-gradient(135deg, #ea4335 0%, #c5221f 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(234, 67, 53, 0.2);
}

.btn-pdf:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 25px rgba(234, 67, 53, 0.3);
}

@media print {

    .sidebar,
    .topbar,
    .header,
    .top-actions,
    .btn-modify-ia {
        display: none !important;
    }

    .main {
        margin-left: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #eee !important;
        margin-bottom: 20px !important;
    }
}

/* ==========================================================================
   Resultados: Planificación Anual (Detalles Específicos)
   ========================================================================== */

.container.a4-preview {
    width: 100%;
    max-width: 1300px;
    margin: 0 auto;
    padding-bottom: 60px;
}

/* Botón Modificar con IA */
.btn-modify-ia {
    background: #ffffff;
    color: var(--primary);
    border: 2px solid #f0f4ff;
    padding: 10px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-modify-ia:hover {
    background: #f0f4ff;
    border-color: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(34, 79, 172, 0.1);
}

.btn-modify-ia i {
    color: #fa6504;
    font-size: 1rem;
}

/* Panel Lateral de IA (Slide-out) */
.ia-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0);
    backdrop-filter: blur(0px);
    pointer-events: none;
    z-index: 10000;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 0;
    visibility: hidden;
}

.ia-panel-backdrop.active {
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    opacity: 1;
    visibility: visible;
}

.ia-panel {
    position: absolute;
    top: 0;
    right: -450px;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    background: #ffffff;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    transition: right 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.ia-panel-backdrop.active .ia-panel {
    right: 0;
}

.ia-panel-header {
    padding: 30px;
    background: var(--primary);
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.ia-panel-header::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    filter: blur(30px);
}

.ia-panel-title-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ia-panel-icon {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.ia-panel-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

.ia-panel-subtitle {
    margin: 3px 0 0;
    font-size: 0.8rem;
    opacity: 0.7;
    font-weight: 500;
}

.close-panel {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.close-panel:hover {
    background: var(--secondary);
    transform: rotate(90deg);
}

.ia-panel-body {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
}

.panel-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

#modifyIaInstructions {
    width: 100%;
    height: 200px;
    padding: 20px;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    background: #f8fafc;
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    transition: all 0.3s;
}

#modifyIaInstructions:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 4px 15px rgba(34, 79, 172, 0.05);
}

.shortcuts-container {
    margin-top: 35px;
}

.ia-panel-shortcuts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 15px;
}

.btn-shortcut {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 12px 15px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-shortcut:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #f0f4ff;
    transform: translateY(-2px);
}

.ia-panel-footer {
    padding: 30px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 15px;
}

.btn-panel-cancel {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-panel-apply {
    flex: 2;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-panel-apply:hover {
    background: #1a3d8b;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 79, 172, 0.2);
}

/* Info Grid (Tarjetas de datos secundarios) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: #ffffff;
    border-radius: 20px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-item:hover {
    box-shadow: 0 15px 30px -10px rgba(15, 23, 42, 0.1);
    transform: translateY(-4px);
    border-color: #e2e8f0;
}

.info-icon {
    min-width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
    border-radius: 16px;
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.info-label {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.info-value {
    font-size: 0.95rem;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.3;
}

/* Optimizaciones de columnas específicas */
.info-table th:nth-child(1),
.info-table td:nth-child(1) {
    width: 8%;
}

.info-table th:nth-child(2),
.info-table td:nth-child(2) {
    width: 10%;
}

.info-table th:nth-child(3),
.info-table td:nth-child(3) {
    width: 15%;
}

.info-table th:nth-child(4),
.info-table td:nth-child(4) {
    width: 12%;
}

.info-table th:nth-child(5),
.info-table td:nth-child(5) {
    width: 25%;
}

.info-table th:nth-child(6),
.info-table td:nth-child(6) {
    width: 15%;
}

.info-table th:nth-child(7),
.info-table td:nth-child(7) {
    width: 15%;
}

#pa_proposito_aprendizaje .info-table th:nth-child(n+3),
#pa_proposito_aprendizaje .info-table td:nth-child(n+3) {
    text-align: center;
}

#pa_calendarizacion .calendarizacion-table th:first-child,
#pa_calendarizacion .calendarizacion-table td:first-child {
    text-align: center;
}

#pa_organizacion_eda table th,
#pa_organizacion_eda table td {
    text-align: center;
}

#pa_evaluacion .info-table,
#pa_recursos_materiales .info-table {
    table-layout: fixed;
}

#pa_evaluacion .info-table th,
#pa_recursos_materiales .info-table th {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
}

#pa_evaluacion .info-table th:nth-child(1),
#pa_evaluacion .info-table td:nth-child(1) {
    width: 14%;
    text-align: center;
    font-weight: 700;
}

#pa_evaluacion .info-table th:nth-child(2),
#pa_evaluacion .info-table td:nth-child(2) {
    width: 18%;
}

#pa_evaluacion .info-table th:nth-child(3),
#pa_evaluacion .info-table td:nth-child(3) {
    width: 24%;
}

#pa_evaluacion .info-table th:nth-child(4),
#pa_evaluacion .info-table td:nth-child(4) {
    width: 44%;
}

#pa_recursos_materiales .info-table th:nth-child(1),
#pa_recursos_materiales .info-table td:nth-child(1) {
    width: 22%;
}

#pa_recursos_materiales .info-table th:nth-child(2),
#pa_recursos_materiales .info-table td:nth-child(2) {
    width: 33%;
}

#pa_recursos_materiales .info-table th:nth-child(3),
#pa_recursos_materiales .info-table td:nth-child(3) {
    width: 45%;
}

.ia-field thead th {
    position: sticky;
    top: 0;
    z-index: 2;
}


/* Helpers para documentos de resultados */
.no-justify td {
    text-align: left !important;
}

.top-actions {
    margin-bottom: 25px;
}

.pa-tool-content .card {
    overflow: hidden;
}

@media print {
    .print-landscape {
        width: 100% !important;
    }
}

/* Regla específica para orientación de página */
@media print {
    .print-landscape-mode {
        /* Esta regla es especial y debe aplicarse con cuidado */
    }
}

/* Sistema de Pestañas (Tabs) */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.tab-link {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.tab-link.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tarjetas de Historial Reciente */
.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recent-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    transition: 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 15px;
}

.recent-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.recent-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.recent-info {
    flex: 1;
    overflow: hidden;
}

.recent-title {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dark);
}

.recent-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}


/* Result Section Cards */
.section-card {
    padding: 30px !important;
    border-left: 4px solid var(--primary) !important;
    margin-bottom: 25px !important;
    transition: all 0.3s ease;
}

.section-card:hover {
    box-shadow: 0 15px 35px rgba(34, 79, 172, 0.1);
}



.loader-logo {
    width: 200px;
    height: auto;
    margin-bottom: 40px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
    animation: pulseLogo 3s infinite ease-in-out;
}

@keyframes pulseLogo {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

/* Estilos específicos para Unidad de Aprendizaje */

.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recent-card {
    background: white;
    border-radius: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    transition: 0.3s;
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 15px;
}

.recent-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.recent-icon {
    width: 42px;
    height: 42px;
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.recent-info {
    flex: 1;
    overflow: hidden;
}

.recent-title {
    display: block;
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-dark);
}

.recent-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
}

.tab-link {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-link:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.tab-link.active {
    background: var(--primary);
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Toast Notifications Premium */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    max-width: 450px;
    background: white;
    padding: 16px 20px;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    border-left: 5px solid #ccc;
    animation: slideInRight 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: 0.3s;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left-color: #10b981;
}

.toast.error {
    border-left-color: #ef4444;
}

.toast.info {
    border-left-color: #3b82f6;
}

.toast.warning {
    border-left-color: #f59e0b;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast.success .toast-icon {
    color: #10b981;
}

.toast.error .toast-icon {
    color: #ef4444;
}

.toast.info .toast-icon {
    color: #3b82f6;
}

.toast.warning .toast-icon {
    color: #f59e0b;
}

.toast-message {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Animación de salida */
.toast.fade-out {
    opacity: 0;
    transform: scale(0.9);
}


/* Estilos Globales para Tablas de Documentos IA */
.ia-field table {
    width: 100%;
    min-width: 1000px;
    border-collapse: collapse;
    margin: 15px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
}

.ia-field th,
.ia-field td {
    border: 1px solid #e2e8f0;
    padding: 12px 15px;
    text-align: left;
    vertical-align: middle;
}

.ia-field th {
    background: #1e40af;
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.calendarizacion-table,
.proposito-table {
    border: 2px solid #1e40af !important;
    border-collapse: collapse !important;
}

.calendarizacion-table td,
.proposito-table td {
    border: 1px solid #cbd5e1 !important;
}

/* Estilo para Celdas Unidas (Rowspan) */
.ia-field td[rowspan] {
    vertical-align: middle !important;
    text-align: center !important;
}

.ia-field table td[rowspan],
.ia-field table th[rowspan] {
    vertical-align: middle !important;
    text-align: center !important;
    display: table-cell !important;
}

/* Estilo para Tablas Informativas (Estructura Etiqueta -> Valor) */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
}

.info-table th {
    background: #f8fafc !important;
    color: #0f172a !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    width: 280px;
    border: 1px solid #e2e8f0 !important;
}

.info-table td {
    background: #ffffff;
    color: #0f172a;
    border: 1px solid #e2e8f0 !important;
}

/* Cabeceras de Tablas Globales (Fila Superior) */
.ia-field table thead th {
    background: #1e40af !important;
    color: #ffffff !important;
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 12px 15px;
    border: 1px solid #1e40af !important;
}

/* Asegurar bordes visibles en todas las tablas */
.ia-field table,
.ia-field th,
.ia-field td {
    border: 1px solid #e2e8f0 !important;
}

/* --- Styles extracted from header.php --- */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-result-item {
    padding: 12px 20px 12px 59px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s;
    border-bottom: 1px solid #f1f5f9;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #f8fafc;
    color: #1343a7;
}

.search-result-item i {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1343a7;
    font-size: 0.9rem;
    flex-shrink: 0;
}


/* Dropdown Profile Menu */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-profile {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary, #1343a7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.user-profile:hover {
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 55px;
    right: 0;
    background-color: white;
    min-width: 250px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
    display: none;
    flex-direction: column;
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.2s ease;
}

.user-dropdown.active {
    display: flex;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    padding: 15px 20px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-header .user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: #e0e7ff;
    color: #4338ca;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
}

.dropdown-header-text h4 {
    margin: 0;
    font-size: 1rem;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
}

.dropdown-header-text p {
    margin: 0;
    font-size: 0.8rem;
    color: #64748b;
    font-family: 'Outfit', sans-serif;
}

.dropdown-menu {
    list-style: none;
    padding: 10px 0;
    margin: 0;
}

.dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #334155;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.2s;
    font-family: 'Outfit', sans-serif;
}

.dropdown-menu li a:hover {
    background-color: #f1f5f9;
    color: var(--primary, #1343a7);
}

.dropdown-menu li a i {
    width: 16px;
    text-align: center;
    color: #64748b;
}

.dropdown-menu li a:hover i {
    color: var(--primary, #1343a7);
}

.dropdown-divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 5px 0;
}


.global-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.global-modal-content {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header-premium {
    background: linear-gradient(135deg, #1343a7, #1e40af);
    height: 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-circle {
    width: 70px;
    height: 70px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #f59e0b;
    position: absolute;
    bottom: -35px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.7;
}

.modal-body-premium {
    padding: 60px 30px 30px;
    text-align: center;
}

.modal-body-premium h3 {
    margin: 0 0 12px;
    font-size: 1.5rem;
    color: #1e293b;
    font-weight: 800;
}

.modal-body-premium p {
    color: #64748b;
    line-height: 1.5;
    font-size: 1rem;
}

.upgrade-benefits {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    background: #f8fafc;
    padding: 15px;
    border-radius: 16px;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
}

.benefit-item i {
    color: #10b981;
}

.modal-footer-premium {
    padding: 0 30px 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary-modal {
    background: #1343a7;
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    transition: 0.2s;
}

.btn-primary-modal:hover {
    background: #1e40af;
    transform: translateY(-2px);
}

.btn-secondary-modal {
    background: #f1f5f9;
    color: #64748b;
    border: none;
    padding: 12px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* Added to prevent header deformation */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.credits-pill {
    background: #f0f7ff;
    padding: 8px 24px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid #e0e7ff;
    box-shadow: 0 2px 10px rgba(19, 67, 167, 0.05);
}

.notif-bell {
    position: relative;
    font-size: 1.2rem;
    color: #64748b;
    cursor: pointer;
    transition: color 0.3s;
}

.notif-bell:hover {
    color: #1343a7;
}

.notif-bell span {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #ff6600;
    border-radius: 50%;
    border: 2px solid white;
}

/* ==========================================================================
   Hero Sections (Main Hero & Tool Hero)
   ========================================================================== */

/* Main Hero (index.php) */
.hero.main-hero {
    background: linear-gradient(135deg, rgba(19, 67, 167, 0.95), rgba(255, 102, 0, 0.3)), url('../img/hero_teacher_ai_wide.webp');
    background-size: cover;
    background-position: center;
    border-radius: 24px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(19, 67, 167, 0.25);
}

.hero-desc {
    position: relative;
    z-index: 2;
    max-width: 650px;
}

.hero-desc h1 {
    font-weight: 800;
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.1;
    letter-spacing: -1.5px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.hero-desc p {
    font-size: 1.2rem;
    opacity: 1;
    margin-bottom: 35px;
    font-weight: 400;
    line-height: 1.6;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.hero-desc .btn-hero {
    background: white;
    color: #1343a7;
    padding: 18px 40px;
    border-radius: 50px;
    font-weight: 800;
    text-decoration: none;
    display: inline-block;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s;
}

.hero-desc .btn-hero:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
    background: #f8fafc;
}

/* Tool Hero (tool_header.php) */
.tool-hero {
    position: relative;
    padding: 60px 48px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 102, 0, 0.25);
    background: #0f172a;
    background-image: linear-gradient(to right, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.4) 60%, rgba(15, 23, 42, 0.1) 100%), var(--th-bg);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
}

.tool-hero-decor {
    position: absolute;
    right: -80px;
    top: -80px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 102, 0, 0.15) 0%, transparent 70%);
    filter: blur(30px);
    border-radius: 50%;
    animation: floatBlob1 15s infinite alternate ease-in-out;
}

.tool-hero::before {
    content: '';
    position: absolute;
    left: -100px;
    bottom: -100px;
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, rgba(19, 67, 167, 0.3) 0%, transparent 70%);
    filter: blur(40px);
    border-radius: 50%;
    z-index: 1;
    pointer-events: none;
    animation: floatBlob2 18s infinite alternate ease-in-out;
}

@keyframes floatBlob1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-30px, 20px) scale(1.15);
    }
}

@keyframes floatBlob2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, -30px) scale(1.1);
    }
}

.tool-hero-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'Outfit', sans-serif;
    position: relative;
    z-index: 2;
}

.tool-hero-nav a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.25s ease;
}

.tool-hero-nav a:hover {
    color: #ff6600;
}

.tool-hero-nav .active {
    color: rgba(255, 255, 255, 0.95);
}

.tool-hero-icon-wrapper {
    width: 75px;
    height: 75px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 2.2rem;
    color: #ffffff;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    position: relative;
    z-index: 2;
}

.tool-hero:hover .tool-hero-icon-wrapper {
    transform: scale(1.06) rotate(3deg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25), 0 0 15px rgba(255, 102, 0, 0.3);
}

.tool-hero h1 {
    margin: 0;
    font-size: 2.8rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1px;
    line-height: 1.1;
    text-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
    position: relative;
    z-index: 2;
}

.tool-hero p {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.18rem;
    font-weight: 400;
    text-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   Styles extracted from mi_plan.php
   ========================================================================== */

.plan-header-card {
    background: linear-gradient(135deg, rgba(19, 67, 167, 0.85) 0%, rgba(14, 50, 125, 0.9) 100%), url('../img/plan_bg_premium.webp');
    background-size: cover;
    background-position: center;
    border-radius: 24px;
    padding: 40px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.plan-header-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.status-badge {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.credits-display {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    margin: 15px 0;
}

/* Planes Grid */
.planes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 50px;
}

.plan-card {
    background: white;
    border-radius: 24px;
    padding: 35px;
    border: 2px solid transparent;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-soft);
}

.plan-card.active {
    border-color: var(--primary);
    background: #f8faff;
}

.plan-card.active::before {
    content: 'PLAN ACTUAL';
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 4px 15px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
}

.plan-price {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 20px 0;
    color: var(--text-dark);
}

.plan-price span {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 400;
}

.plan-features {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    flex: 1;
}

.plan-features li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.plan-features li i {
    color: #10b981;
}

.btn-upgrade {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-primary-custom {
    background: var(--primary);
    color: white;
}

.btn-primary-custom:hover {
    background: #1e40af;
    transform: translateY(-2px);
}

.btn-disabled {
    background: #e2e8f0;
    color: #94a3b8;
    cursor: not-allowed;
}

/* History Table */
.history-section {
    background: white;
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--shadow-soft);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.history-table th {
    text-align: left;
    padding: 15px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
}

.history-table td {
    padding: 15px;
    font-size: 0.9rem;
    border-bottom: 1px solid #f1f5f9;
}

.badge-type {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.type-consumo {
    background: #fef2f2;
    color: #ef4444;
}

.type-recarga {
    background: #ecfdf5;
    color: #10b981;
}

/* ==========================================================================
   Estilos de Tablas de Documentos (Estilo documentos.php)
   ========================================================================== */
.table-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
    overflow: hidden;
    width: 100%;
    margin-top: 20px;
}

.table-card table {
    width: 100%;
    border-collapse: collapse;
}

.table-card th {
    background-color: #f8fafc;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 15px 20px;
    text-align: left;
    border-bottom: 2px solid var(--border);
}

.table-card td {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    font-size: 0.95rem;
}

.table-card tr:hover td {
    background-color: #f8fafc;
}

.doc-name-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-icon-small {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #eff6ff;
    color: #3b82f6;
    font-size: 1.1rem;
}

.doc-title {
    display: block;
    font-weight: 700;
    color: #1e293b;
    font-family: 'Outfit', sans-serif;
}

.doc-type-label {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 2px;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-area {
    background-color: #f1f5f9;
    color: #475569;
}

.badge-status {
    background-color: #dcfce7;
    color: #15803d;
}

.doc-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    background: none;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    font-size: 0.95rem;
    color: #64748b;
    transition: all 0.2s;
    padding: 8px;
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.action-btn:hover {
    background-color: #f1f5f9;
    color: var(--primary);
    border-color: var(--primary);
}

.action-btn.word:hover {
    color: #2563eb;
    border-color: #2563eb;
    background-color: #eff6ff;
}

.action-btn.pdf:hover {
    color: #ef4444;
    border-color: #ef4444;
    background-color: #fef2f2;
}

.action-btn.delete:hover {
    color: #ef4444;
    border-color: #ef4444;
    background-color: #fef2f2;
}

/* Modales */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 24px;
    width: 90%;
    max-width: 500px;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    font-family: 'Outfit', 'Inter', sans-serif;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.btn-primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: 0.2s all;
}

.btn-primary-action:hover {
    transform: translateY(-1px);
}

/* Responsive adjustments for planes */
@media (min-width: 1201px) {
    .plan-card {
        padding: 25px 20px;
    }
}

@media (max-width: 1200px) {
    .planes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .planes-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Landing Page Premium - EducaTech IA
   ========================================================================== */

.landing-body {
    display: block;
    background-color: #ffffff;
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Nav */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
}

.landing-nav.scrolled {
    background: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border-bottom-color: #f1f5f9;
}

.landing-nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.landing-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.landing-brand img {
    height: 40px;
    width: auto;
}

.landing-nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

@media (max-width: 768px) {
    .landing-nav-menu {
        display: none;
    }
}

.landing-nav-link {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.landing-nav-link:hover {
    color: var(--primary);
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Landing Buttons */
.landing-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.landing-btn-outline {
    border: 2px solid var(--border);
    color: var(--text-dark);
    background: transparent;
}

.landing-btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(19, 67, 167, 0.03);
}

.landing-btn-primary {
    background: linear-gradient(135deg, var(--primary), #2563eb);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 79, 172, 0.2);
}

.landing-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(34, 79, 172, 0.35);
    background: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.landing-btn-secondary {
    background: linear-gradient(135deg, var(--secondary), #ea580c);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 102, 0, 0.2);
}

.landing-btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 102, 0, 0.35);
    background: linear-gradient(135deg, #d97706, #f97316);
}

.landing-btn-large {
    padding: 14px 32px;
    font-size: 1rem;
}

/* Sections */
.landing-section {
    padding: 90px 24px;
    position: relative;
}

.landing-section-bg {
    background-color: #f8fafc;
}

.landing-section-container {
    max-width: 1200px;
    margin: 0 auto;
}

.landing-section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 60px auto;
}

.landing-section-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 40px;
    margin-bottom: 12px;
}

.landing-section-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.landing-section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Hero Section */
.landing-hero-section {
    position: relative;
    background-size: contain;
    background-position: bottom;
    background-repeat: no-repeat;
    background-attachment: fixed;
    padding-top: 140px;
    padding-bottom: 80px;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.15) 50%, rgba(15, 23, 42, 0.35) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-glow {
    position: absolute;
    width: 380px;
    height: 380px;
    border-radius: 50%;
    filter: blur(95px);
    z-index: 1;
    pointer-events: none;
    opacity: 0.22;
    animation: floatGlow 12s ease-in-out infinite alternate;
}

.hero-glow-1 {
    background: radial-gradient(circle, var(--primary) 0%, rgba(37, 99, 235, 0.3) 100%);
    top: 15%;
    left: 15%;
}

.hero-glow-2 {
    background: radial-gradient(circle, var(--secondary) 0%, rgba(249, 115, 22, 0.3) 100%);
    bottom: 15%;
    right: 20%;
    animation-delay: -6s;
}

.hero-container-layout {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr 180px;
    gap: 30px;
    align-items: center;
    width: 100%;
}

.hero-glass-card {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 540px;
    z-index: 3;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-glass-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 35px 60px -15px rgba(19, 67, 167, 0.15), 0 20px 45px -10px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.85);
}

.landing-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #ffedd5;
    color: #ea580c;
    border: 1px solid #fed7aa;
    padding: 6px 16px;
    border-radius: 40px;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 24px;
}

.landing-hero-badge i {
    animation: pulseSparkle 2s ease-in-out infinite;
}

.landing-hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #0f172a;
    margin-bottom: 20px;
}

.landing-hero-title .highlight-secondary {
    color: var(--secondary);
    display: block;
    margin-top: 4px;
}

.landing-hero-desc {
    font-size: 1.05rem;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 35px;
    font-weight: 500;
}

.landing-hero-ctas {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.landing-hero-ctas .landing-btn {
    padding: 12px 22px;
    font-size: 0.95rem;
}

.landing-btn-glass {
    background: rgba(255, 255, 255, 0.25);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: #0f172a;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.3s ease;
}

.landing-btn-glass:hover {
    background: rgba(255, 255, 255, 0.45);
    border-color: rgba(255, 255, 255, 0.8);
    color: #000;
    transform: translateY(-2px);
}

/* Floating Elements & Holograms */
.hero-interactive-elements {
    position: relative;
    height: 400px;
    width: 100%;
    z-index: 2;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.hologram-cneb {
    position: absolute;
    top: 5%;
    right: 15%;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.45));
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.hologram-cneb:hover {
    transform: scale(1.12);
    filter: drop-shadow(0 0 25px rgba(56, 189, 248, 0.85));
    color: #ffffff;
}

.hologram-circle {
    position: absolute;
    border-radius: 50%;
    border: 2px dashed rgba(56, 189, 248, 0.4);
    animation: rotateHolo 10s linear infinite;
}

.hologram-circle.ring-1 {
    width: 100%;
    height: 100%;
}

.hologram-circle.ring-2 {
    width: 80%;
    height: 80%;
    border-style: solid;
    border-color: rgba(56, 189, 248, 0.15);
    border-width: 1px;
    animation-duration: 6s;
    animation-direction: reverse;
}

.hologram-text {
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
    background: rgba(15, 23, 42, 0.45);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

@keyframes rotateHolo {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.floating-badge {
    position: absolute;
    background: white;
    border-radius: 16px;
    padding: 10px 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 3;
    border: 1px solid #f1f5f9;
    animation: floatingBadge 4s ease-in-out infinite alternate;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-badge:hover {
    transform: scale(1.08) rotate(-1.5deg);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-soft);
}

.floating-badge .badge-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.floating-badge .badge-icon.icon-success {
    background: #10b981;
}

.floating-badge .badge-icon.icon-warning {
    background: var(--secondary);
}

.floating-badge .badge-title {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dark);
    font-weight: 700;
}

.floating-badge .badge-subtitle {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.hero-badge-sesion {
    top: 35%;
    left: -5%;
    animation-delay: 0s;
}

.hero-badge-rubrica {
    bottom: 10%;
    right: 5%;
    animation-delay: 1.5s;
}

@keyframes floatingBadge {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(-12px);
    }
}

/* Stats panel right */
.hero-stats-panel {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: flex-end;
    text-align: right;
    z-index: 3;
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

.hero-stats-panel .hero-stat-item {
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.hero-stats-panel .hero-stat-item:hover {
    transform: translateX(-8px) scale(1.05);
}

.hero-stats-panel .stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    line-height: 1.1;
}

.hero-stats-panel .stat-lbl {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 700;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-sparkle {
    color: white;
    font-size: 1.5rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    margin-top: 10px;
    animation: rotateHolo 5s linear infinite;
}

/* Keyframes de Efectos Avanzados */
@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(50px, 40px) scale(1.12);
    }

    100% {
        transform: translate(-30px, -50px) scale(0.92);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseSparkle {

    0%,
    100% {
        transform: scale(1);
        filter: brightness(1);
    }

    50% {
        transform: scale(1.2);
        filter: brightness(1.25);
    }
}

/* Responsive grid overrides for Hero */
@media (max-width: 1200px) {
    .hero-container-layout {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 40px;
    }

    .hero-interactive-elements {
        display: none;
    }

    .hero-stats-panel {
        flex-direction: row;
        justify-content: center;
        gap: 40px;
        align-items: center;
        text-align: center;
        width: 100%;
        margin-top: 20px;
    }

    .hero-stats-panel .stat-num {
        font-size: 2rem;
    }
}

@media (max-width: 992px) {
    .landing-hero-section {
        padding-top: 120px;
        padding-bottom: 60px;
    }

    .hero-glass-card {
        padding: 35px 25px;
    }

    .landing-hero-title {
        font-size: 2.3rem;
    }
}

@media (max-width: 600px) {
    .hero-stats-panel {
        flex-direction: column;
        gap: 20px;
    }

    .landing-hero-ctas {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .landing-hero-ctas .landing-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Banner Minedu CNEB */
.minedu-banner {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    color: white;
    padding: 30px 24px;
    text-align: center;
    border-top: 2px solid var(--secondary);
}

.minedu-banner-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.minedu-banner-badge {
    background: var(--secondary);
    color: white;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.minedu-banner-text {
    font-size: 1.1rem;
    font-weight: 500;
}

.minedu-banner-text strong {
    color: #fdba74;
}

/* Landing Features Grid */
.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 992px) {
    .landing-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .landing-features-grid {
        grid-template-columns: 1fr;
    }
}

.landing-feature-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius-l);
    padding: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.landing-feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border-color: var(--primary);
}

.landing-feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.landing-feature-card:hover::before {
    transform: scaleX(1);
}

.landing-feature-card.secondary-line::before {
    background: var(--secondary);
}

.landing-feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.landing-feature-card:hover .landing-feature-icon {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary);
    color: white;
}

.landing-feature-card.secondary-line:hover .landing-feature-icon {
    background: var(--secondary);
    color: white;
}

.landing-feature-card h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.landing-feature-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* How It Works Timeline */
.timeline-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    position: relative;
}

@media (max-width: 992px) {
    .timeline-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

@media (max-width: 480px) {
    .timeline-grid {
        grid-template-columns: 1fr;
    }
}

.timeline-step {
    background: white;
    border-radius: var(--radius-l);
    padding: 24px;
    text-align: center;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
}

.timeline-number {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 4px solid #ffffff;
    box-shadow: 0 4px 10px rgba(19, 67, 167, 0.2);
}

.timeline-step:nth-child(even) .timeline-number {
    background: var(--secondary);
    box-shadow: 0 4px 10px rgba(255, 102, 0, 0.2);
}

.timeline-icon {
    font-size: 1.8rem;
    color: var(--text-muted);
    margin: 15px 0 15px 0;
}

.timeline-step h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.timeline-step p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Pricing Grid */
.landing-pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 1100px) {
    .landing-pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 800px;
        margin: 0 auto;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .landing-pricing-grid {
        grid-template-columns: 1fr;
        max-width: 450px;
        margin: 0 auto;
    }
}

.landing-pricing-card {
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-xl);
    padding: 42px 25px 35px;
    /* added a bit more top padding for breathing room */
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.3s ease;
}

.landing-pricing-card.premium-card {
    border: 2px solid var(--primary);
    box-shadow: 0 20px 40px rgba(19, 67, 167, 0.08);
    transform: scale(1.03);
}

.landing-pricing-card.current-plan {
    border: 2px solid var(--primary);
    box-shadow: 0 20px 40px rgba(19, 67, 167, 0.08);
    background: #f8faff;
}

@media (max-width: 1100px) {
    .landing-pricing-card.premium-card {
        transform: scale(1);
    }
}

.landing-pricing-card:hover {
    transform: translateY(-8px);
    border-color: #94a3b8;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

.landing-pricing-card.premium-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--primary);
    box-shadow: 0 25px 50px rgba(19, 67, 167, 0.12);
}

@media (max-width: 1100px) {
    .landing-pricing-card.premium-card:hover {
        transform: translateY(-8px) scale(1);
    }
}

.pricing-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 10px rgba(19, 67, 167, 0.2);
}

.pricing-card-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 25px;
}

.pricing-card-header h4 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.pricing-card-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.pricing-card-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-dark);
    margin: 15px 0;
}

.pricing-card-price span {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

.pricing-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 35px 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.pricing-features-list li {
    font-size: 0.9rem;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pricing-features-list li i {
    color: #10b981;
}

.pricing-features-list li.unsupported {
    color: #94a3b8;
    text-decoration: line-through;
}

.pricing-features-list li.unsupported i {
    color: #cbd5e1;
}

.pricing-cta {
    margin-top: auto;
    width: 100%;
}

/* Testimonials Carousel Wrapper */
.testimonials-carousel-wrapper {
    position: relative;
    max-width: 1080px;
    margin: 40px auto 0;
    overflow: visible;
    padding: 10px;
}

.testimonials-carousel-container {
    overflow: hidden;
    width: 100%;
    border-radius: var(--radius-xl);
}

.testimonials-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-slide {
    flex: 0 0 50%;
    width: 50%;
    box-sizing: border-box;
    padding: 15px;
}

@media (max-width: 768px) {
    .testimonial-slide {
        flex: 0 0 100%;
        width: 100%;
    }
}

/* Controls */
.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 2px solid #cbd5e1;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    transition: all 0.2s ease;
}

.carousel-control:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(19, 67, 167, 0.2);
}

.carousel-control.prev {
    left: -64px;
}

.carousel-control.next {
    right: -64px;
}

@media (max-width: 1220px) {
    .carousel-control.prev {
        left: -15px;
    }

    .carousel-control.next {
        right: -15px;
    }

    .carousel-control {
        width: 42px;
        height: 42px;
        font-size: 0.95rem;
    }
}

/* Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 25px;
}

.carousel-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.carousel-indicator.active {
    background: #e2e8f0;
    width: 28px;
    border-radius: 5px;
}

.carousel-indicator.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--primary);
    border-radius: 5px;
    animation: indicatorProgress 6s linear infinite;
}

@keyframes indicatorProgress {
    0% {
        width: 0;
    }

    100% {
        width: 100%;
    }
}

.testimonial-card {
    background: white;
    border-radius: var(--radius-l);
    padding: 35px 30px;
    box-shadow: var(--shadow-soft);
    border: 2px solid #e2e8f0;
    border-top: 4px solid var(--primary);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.testimonial-card:nth-child(2) {
    border-top-color: var(--secondary);
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}

.testimonial-card:nth-child(2):hover {
    border-color: #fdba74;
}

.testimonial-rating {
    color: #f59e0b;
    /* bright gold */
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.testimonial-text {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 25px;
    position: relative;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    z-index: 2;
}

.testimonial-author-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #3b82f6);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.testimonial-card:nth-child(2) .testimonial-author-avatar {
    background: linear-gradient(135deg, var(--secondary), #f97316);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.15);
}

.testimonial-author-info h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 2px 0;
}

.testimonial-author-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

/* FAQ Accordion */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.faq-item {
    background: white;
    border-radius: 16px;
    border: 1px solid var(--border);
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-question {
    padding: 22px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.faq-question i {
    color: var(--primary);
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0, 1, 0, 1), padding 0.3s ease;
    padding: 0 28px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    border-top: 1px solid transparent;
}

.faq-item.active {
    border-color: var(--primary);
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 0 28px 22px 28px;
    border-top-color: var(--border);
    transition: max-height 0.3s cubic-bezier(1, 0, 1, 0), padding 0.3s ease;
}

/* Landing CTA Banner */
.landing-cta-banner {
    background: radial-gradient(at 100% 0%, var(--secondary) 0%, transparent 50%), linear-gradient(135deg, var(--primary), #1e1b4b);
    color: white;
    padding: 80px 24px;
    text-align: center;
    border-radius: var(--radius-xl);
    margin: 40px auto;
    max-width: 1200px;
    box-shadow: 0 25px 60px rgba(19, 67, 167, 0.15);
}

.landing-cta-banner-content {
    max-width: 700px;
    margin: 0 auto;
}

.landing-cta-banner h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.landing-cta-banner p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Landing Footer */
.landing-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 80px 24px 30px 24px;
    border-top: 1px solid #1e293b;
}

.landing-footer-container {
    max-width: 1200px;
    margin: 0 auto;
}

.landing-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 50px;
}

@media (max-width: 768px) {
    .landing-footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .landing-footer-grid {
        grid-template-columns: 1fr;
    }
}

.landing-footer-logo-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.landing-footer-logo-col p {
    font-size: 0.9rem;
    line-height: 1.5;
}

.landing-footer-title {
    color: white;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 20px;
}

.landing-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.landing-footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.landing-footer-links a:hover {
    color: white;
}

.landing-footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .landing-footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* Feature Preview Images */
.landing-feature-card-img {
    width: 100%;
    height: 140px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.landing-feature-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.landing-feature-card:hover .landing-feature-card-img img {
    transform: scale(1.08);
}

/* ==========================================================================
   Responsive Layout & Dashboard Adaptations (EducaTech IA)
   ========================================================================== */

/* Botón toggle de Sidebar (Hamburguesa) */
.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.2s;
    outline: none;
}

.sidebar-toggle:hover {
    background-color: var(--primary-soft);
}

/* Fondo oscurecido (Overlay) para móviles */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Ajustes para tabletas y laptops pequeñas */
@media (max-width: 992px) {

    /* Resetear el contexto flex del body para que .main fluya de forma block natural */
    body {
        display: block !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Ocultar sidebar y mover fuera de pantalla */
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        left: 0;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    /* Eliminar el margen lateral del contenido principal */
    .main {
        margin-left: 0 !important;
        padding: 20px 24px 60px !important;
        width: 100% !important;
        min-width: 0 !important;
        /* Permitir encogimiento flex/block */
        box-sizing: border-box !important;
    }

    /* Mostrar toggle y alinear topbar */
    .sidebar-toggle {
        display: block !important;
    }

    .topbar,
    .header {
        gap: 15px;
        align-items: center;
        width: 100% !important;
    }

    .welcome-section {
        flex: 1;
    }

    .welcome-section h2 {
        font-size: 1.4rem !important;
    }

    .welcome-section p {
        font-size: 0.85rem !important;
    }

    .search-bar {
        display: none !important;
        /* Ocultar barra de búsqueda de escritorio */
    }

    .header-actions {
        gap: 12px;
    }

    /* Hero a una columna */
    .hero.main-hero {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 30px;
        padding: 30px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .hero-desc {
        text-align: center;
    }

    .hero-desc h1 {
        font-size: 2.2rem !important;
        letter-spacing: -1px !important;
        margin-bottom: 12px !important;
    }

    .hero-desc p {
        font-size: 1.05rem !important;
        margin-bottom: 25px !important;
        max-width: 100% !important;
    }

    .hero-plan-card {
        width: 100% !important;
        max-width: 320px;
        margin: 0 auto;
    }

    /* Cuadrícula de herramientas a 2 columnas */
    .tool-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
        width: 100% !important;
    }

    /* Tablas responsivas en dashboards */
    .table-card {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        width: 100% !important;
    }

    .table-card table {
        min-width: 700px;
    }

    /* Modales responsivos */
    .modal-content {
        width: 92% !important;
        max-width: 92% !important;
        margin: 10px auto;
    }
}

/* Ajustes para teléfonos móviles */
@media (max-width: 576px) {
    .main {
        padding: 16px 16px 60px !important;
    }

    .topbar,
    .header {
        flex-wrap: wrap;
        margin-bottom: 24px;
        gap: 10px;
        width: 100% !important;
    }

    .welcome-section {
        width: 100%;
        margin-bottom: 10px;
        order: 1;
    }

    .sidebar-toggle {
        order: 0;
        margin-right: 10px;
    }

    .header-actions {
        width: auto;
        order: 2;
        margin-left: auto;
        gap: 8px !important;
    }

    /* Hacer la píldora de créditos más compacta en móviles */
    .credits-pill {
        padding: 4px 10px !important;
        gap: 8px !important;
    }

    .credits-pill span[style*="font-size: 0.7rem"],
    .credits-pill span[style*="font-size: 0.72rem"] {
        display: none !important;
        /* Ocultar etiquetas auxiliares en móviles muy pequeños */
    }

    .credits-pill div[style*="width: 1px"] {
        margin: 0 4px !important;
    }

    .hero-desc h1 {
        font-size: 1.8rem !important;
    }

    .hero-desc p {
        font-size: 0.95rem !important;
    }

    .hero-plan-card {
        width: 100% !important;
        max-width: 100%;
    }

    /* Cuadrícula de herramientas a 1 columna */
    .tool-grid {
        grid-template-columns: 1fr !important;
    }

    .tool-card {
        min-height: auto !important;
        padding: 18px !important;
    }

    /* Ajustar elementos internos del main para pantallas muy pequeñas */
    .page-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 15px;
    }

    .page-header button,
    .page-header a {
        width: 100%;
        justify-content: center;
    }

    div[style*="padding: 30px"] {
        padding: 15px !important;
    }
}

/* ==========================================================================
   Level-based Visual Themes (EducaTech IA)
   ========================================================================== */

/* Tema: Inicial (Educación Temprana) - Rosa Cálido y Ámbar */
:root.theme-inicial {
    --primary: #ec4899;
    --secondary: #f59e0b;
    --primary-soft: #fdf2f8;
}

:root.theme-inicial .btn-upgrade {
    background: linear-gradient(135deg, #ec4899, #f59e0b) !important;
}

/* Tema: Primaria (Educación Primaria) - Verde Energético y Esmeralda */
:root.theme-primaria {
    --primary: #10b981;
    --secondary: #059669;
    --primary-soft: #ecfdf5;
}

:root.theme-primaria .btn-upgrade {
    background: linear-gradient(135deg, #10b981, #059669) !important;
}

/* Tema: Secundaria (Educación Secundaria) - Índigo y Carmesí */
:root.theme-secundaria {
    --primary: #6366f1;
    --secondary: #db2777;
    --primary-soft: #e0e7ff;
}

:root.theme-secundaria .btn-upgrade {
    background: linear-gradient(135deg, #6366f1, #db2777) !important;
}

/* Tema: Superior (Educación Superior) - Pizarra Elegante y Azul Moderno */
:root.theme-superior {
    --primary: #0f172a;
    --secondary: #3b82f6;
    --primary-soft: #f1f5f9;
}

:root.theme-superior .btn-upgrade {
    background: linear-gradient(135deg, #0f172a, #3b82f6) !important;
}

/* Scrollbar horizontal en la parte superior para tablas de IA */
.table-scroll-container {
    overflow-x: auto;
    width: 100%;
    margin: 15px 0;
    transform: rotateX(180deg);
    -ms-transform: rotateX(180deg);
    -webkit-transform: rotateX(180deg);
    cursor: grab;
}

.table-scroll-container:active {
    cursor: grabbing;
}

.table-scroll-container table {
    transform: rotateX(180deg);
    -ms-transform: rotateX(180deg);
    -webkit-transform: rotateX(180deg);
    margin: 0 !important;
}

.table-scroll-container::-webkit-scrollbar {
    height: 14px;
    display: block !important;
    cursor: grab;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
    cursor: grab;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid #f1f5f9;
    cursor: grab;
}

.table-scroll-container::-webkit-scrollbar-thumb:active {
    cursor: grabbing;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==========================================================================
   Responsive: Tool Pages (planificacion_anual, sesion, etc.)
   ========================================================================== */
@media (max-width: 992px) {
    .tool-hero {
        padding: 40px 24px !important;
    }

    .tool-hero::before {
        width: 200px !important;
        height: 200px !important;
        left: -60px !important;
        bottom: -60px !important;
    }

    .tool-hero h1 {
        font-size: 2rem !important;
    }

    .tool-hero p {
        font-size: 1rem !important;
    }

    .tool-hero-icon-wrapper {
        width: 60px !important;
        height: 60px !important;
        font-size: 1.6rem !important;
    }

    .tool-hero .container>div:has(.tool-hero-icon-wrapper) {
        gap: 15px !important;
    }

    .pa-tool-content .container {
        padding: 0 16px;
    }

    .pa-tool-content .card {
        padding: 20px !important;
    }

    .pa-tool-content .card>div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-wrap: wrap;
        gap: 12px;
    }

    .tab-nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        padding-bottom: 12px;
    }

    .tab-link {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 768px) {
    .tool-hero {
        padding: 32px 20px !important;
    }

    .tool-hero h1 {
        font-size: 1.6rem !important;
    }

    .tool-hero p {
        font-size: 0.95rem !important;
    }

    .tool-hero .container>div:has(.tool-hero-icon-wrapper) {
        gap: 12px !important;
    }

    .tool-hero-icon-wrapper {
        width: 52px !important;
        height: 52px !important;
        font-size: 1.4rem !important;
    }

    .tool-hero-nav {
        font-size: 0.82rem !important;
        gap: 6px !important;
        flex-wrap: wrap;
    }

    .tool-hero-decor {
        width: 180px !important;
        height: 180px !important;
        right: -50px !important;
        top: -50px !important;
    }

    .pa-tool-content input[type="text"],
    .pa-tool-content input[type="number"],
    .pa-tool-content select,
    .pa-tool-content textarea {
        color: #0f172a !important;
        background: #ffffff !important;
        -webkit-text-fill-color: #0f172a !important;
    }
}

@media (max-width: 576px) {
    .tool-hero {
        padding: 24px 16px !important;
    }

    .tool-hero::before {
        display: none;
    }

    .tool-hero h1 {
        font-size: 1.3rem !important;
    }

    .tool-hero p {
        font-size: 0.85rem !important;
    }

    .tool-hero .container>div:has(.tool-hero-icon-wrapper) {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    .tool-hero-icon-wrapper {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
    }

    .tool-hero-nav {
        font-size: 0.75rem !important;
        gap: 4px !important;
    }

    .tool-hero-nav a:not(:first-child),
    .tool-hero-nav i {
        display: none;
    }

    .tool-hero-nav .active {
        display: inline !important;
    }

    .tool-hero-decor {
        display: none !important;
    }

    .btn-generate {
        min-width: 0 !important;
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 1rem !important;
    }

    .pa-tool-content .card {
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .pa-tool-content .card>div[style*="display: flex"][style*="justify-content: space-between"] {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .section-label {
        font-size: 0.9rem !important;
    }

    .breadcrumb span.active {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 120px;
    }

    .pa-tool-content input[type="text"],
    .pa-tool-content input[type="number"],
    .pa-tool-content select,
    .pa-tool-content textarea {
        color: #0f172a !important;
        background: #ffffff !important;
        -webkit-text-fill-color: #0f172a !important;
    }

    /* Modales responsivos en tools */
    .modal-overlay .modal-content {
        width: 95% !important;
        max-width: 95% !important;
        margin: 10px auto;
        padding: 24px 16px !important;
        border-radius: 20px !important;
    }

    .modal-content div[style*="display: flex"][style*="gap: 12px"][style*="justify-content: center"] {
        flex-wrap: wrap;
    }

    .modal-content h2 {
        font-size: 1.2rem !important;
    }

    /* Modal de personalización (header + body + footer) */
    .modal-content[style*="max-width: 800px"] {
        width: 95% !important;
        max-width: 95% !important;
        padding: 0 !important;
    }

    .modal-content[style*="max-width: 800px"]>div:first-child {
        flex-wrap: wrap;
        padding: 14px 16px !important;
        border-radius: 20px 20px 0 0 !important;
    }

    .modal-content[style*="max-width: 800px"]>div:first-child h3 {
        font-size: 1rem !important;
    }

    .modal-content[style*="max-width: 800px"]>div:nth-child(2) {
        padding: 16px !important;
        max-height: 50vh !important;
    }

    .modal-content[style*="max-width: 800px"]>div:last-child {
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px !important;
        border-radius: 0 0 20px 20px !important;
    }

    .modal-content[style*="max-width: 800px"]>div:last-child>div:first-child {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* ==========================================================================
   Responsive: Chat page
   ========================================================================== */
@media (max-width: 992px) {
    .chat-container {
        height: calc(100vh - 140px) !important;
        border-radius: 16px !important;
    }

    .chat-history {
        width: 240px !important;
    }

    .history-item span {
        max-width: 140px !important;
    }

    .chat-messages {
        padding: 20px !important;
        gap: 16px !important;
    }

    .chat-input-wrapper {
        padding: 14px 20px !important;
        gap: 10px !important;
    }

    .chat-suggestions {
        padding: 0 20px 12px !important;
    }
}

@media (max-width: 768px) {
    .chat-container {
        height: calc(100vh - 120px) !important;
        border-radius: 12px !important;
        flex-direction: column;
    }

    .chat-history {
        width: 100% !important;
        max-height: 40vh;
        border-right: none !important;
        border-bottom: 1px solid var(--border);
        overflow-y: auto;
    }

    .history-header {
        padding: 14px !important;
    }

    .history-list {
        max-height: 30vh;
    }

    .chat-main {
        flex: 1;
        min-height: 0;
    }

    .chat-messages {
        padding: 16px !important;
        gap: 14px !important;
    }

    .message {
        max-width: 92% !important;
    }

    .msg-bubble {
        padding: 12px 14px !important;
        font-size: 0.9rem !important;
    }

    .chat-input-wrapper {
        padding: 12px 16px !important;
        gap: 8px !important;
    }

    .input-box {
        padding: 6px 16px !important;
        border-radius: 24px !important;
    }

    .input-box textarea {
        font-size: 0.9rem !important;
    }

    .btn-send {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }

    .chat-suggestions {
        padding: 0 16px 10px !important;
        gap: 8px !important;
    }

    .suggestion-chip {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
    }

    .typing-indicator {
        margin-left: 0 !important;
    }
}

@media (max-width: 576px) {
    .chat-container {
        height: calc(100vh - 100px) !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }

    .chat-history {
        max-height: 35vh;
    }

    .history-list {
        max-height: 25vh;
    }

    .chat-messages {
        padding: 12px !important;
        gap: 12px !important;
    }

    .message {
        max-width: 100% !important;
        gap: 8px !important;
    }

    .msg-avatar {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.8rem !important;
    }

    .msg-bubble {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
        border-radius: 14px !important;
    }

    .chat-input-wrapper {
        padding: 10px 12px !important;
        flex-wrap: wrap;
    }

    .input-box {
        padding: 4px 14px !important;
    }

    .input-box textarea {
        font-size: 0.85rem !important;
        min-height: 20px !important;
    }

    .chat-suggestions {
        padding: 0 12px 8px !important;
        gap: 6px !important;
    }

    .suggestion-chip {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }
}

/* ==========================================================================
   Responsive: Prompts page
   ========================================================================== */
@media (max-width: 768px) {
    .discovery-header {
        padding: 28px 20px !important;
    }

    .discovery-header h1 {
        font-size: 1.5rem !important;
    }

    .discovery-header p {
        font-size: 0.95rem !important;
    }

    .search-wrapper {
        flex-wrap: wrap;
        padding: 8px !important;
        border-radius: 14px !important;
    }

    .search-box input {
        font-size: 0.9rem !important;
        padding: 10px 12px 10px 40px !important;
    }

    .prompt-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
        gap: 16px !important;
    }

    .prompt-card {
        padding: 20px !important;
    }

    .results-info {
        flex-wrap: wrap;
        gap: 8px;
    }
}

@media (max-width: 576px) {
    .discovery-header {
        padding: 20px 16px !important;
        border-radius: 16px !important;
        margin-bottom: 20px !important;
    }

    .discovery-header::after {
        display: none;
    }

    .discovery-header h1 {
        font-size: 1.2rem !important;
    }

    .discovery-header p {
        font-size: 0.85rem !important;
    }

    .category-bar {
        gap: 8px !important;
        padding: 0 0 10px 0 !important;
    }

    .cat-btn {
        padding: 8px 14px !important;
        font-size: 0.78rem !important;
    }

    .search-wrapper {
        padding: 6px !important;
        border-radius: 12px !important;
        gap: 6px !important;
    }

    .search-box i {
        left: 10px !important;
    }

    .search-box input {
        font-size: 0.85rem !important;
        padding: 8px 10px 8px 36px !important;
    }

    .prompt-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }

    .prompt-card {
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .prompt-name {
        font-size: 1rem !important;
    }

    .prompt-excerpt {
        font-size: 0.82rem !important;
    }

    .prompt-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .load-more-btn {
        width: 100% !important;
        padding: 12px 20px !important;
        text-align: center;
    }

    .results-info {
        font-size: 0.82rem !important;
    }

    /* Prompt detail panel - full width on mobile */
    #prompt-panel {
        top: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        padding: 20px 16px !important;
        border-radius: 0 !important;
    }

    #prompt-panel .panel-header {
        flex-wrap: wrap;
        gap: 10px;
    }

    #prompt-panel .panel-header h2 {
        font-size: 1.1rem !important;
    }

    #prompt-panel .panel-header button {
        font-size: 0.8rem !important;
        padding: 6px 14px !important;
    }

    #prompt-panel .panel-body {
        font-size: 0.85rem !important;
    }

    .overlay {
        backdrop-filter: blur(2px) !important;
    }
}

/* ==========================================================================
   Responsive: Normative page
   ========================================================================== */
@media (max-width: 992px) {
    .pdf-container {
        height: calc(100vh - 200px) !important;
    }
}

@media (max-width: 768px) {
    div[style*="padding: 24px 30px 10px 30px"] {
        padding: 16px !important;
    }

    .pdf-container {
        height: calc(100vh - 220px) !important;
        border-radius: 14px !important;
    }
}

@media (max-width: 576px) {
    div[style*="padding: 24px 30px 10px 30px"] {
        padding: 0px !important;
    }

    div[style*="display: flex"][style*="gap: 15px"][style*="align-items: center"] {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 12px 14px !important;
    }

    div[style*="display: flex"][style*="gap: 15px"][style*="align-items: center"] label {
        font-size: 0.85rem !important;
    }

    select#pdf_selector {
        min-width: 0 !important;
        width: 100% !important;
        font-size: 0.82rem !important;
    }

    a[style*="padding: 10px 18px"][style*="background: var(--primary-soft)"] {
        width: 100% !important;
        justify-content: center !important;
    }

    .pdf-container {
        height: calc(100vh - 260px) !important;
        border-radius: 12px !important;
    }
}

/* ==========================================================================
   Responsive: Help page
   ========================================================================== */
@media (max-width: 768px) {
    div[style*="padding: 30px"] {
        padding: 16px !important;
    }

    .discovery-header {
        padding: 28px 20px !important;
    }

    .discovery-header h1 {
        font-size: 1.5rem !important;
    }

    .discovery-header p {
        font-size: 0.95rem !important;
    }

    .discovery-header::after {
        width: 120px !important;
        height: 120px !important;
        right: -30px !important;
        bottom: -30px !important;
    }

    .help-container {
        padding: 24px !important;
    }

    .help-accordion-title {
        padding: 16px !important;
        font-size: 1rem !important;
    }

    .title-left i {
        width: 38px !important;
        height: 38px !important;
        font-size: 1rem !important;
    }

    .help-content {
        padding: 0 16px 20px 16px !important;
    }

    .help-accordion[open] .help-content {
        padding-top: 16px !important;
    }

    .search-wrapper {
        padding: 8px !important;
        border-radius: 14px !important;
    }

    .search-box input {
        font-size: 0.9rem !important;
        padding: 12px 12px 12px 40px !important;
    }
}

@media (max-width: 576px) {
    .discovery-header {
        padding: 20px 16px !important;
        border-radius: 16px !important;
    }

    .discovery-header h1 {
        font-size: 1.2rem !important;
    }

    .discovery-header p {
        font-size: 0.85rem !important;
    }

    .discovery-header::after {
        display: none !important;
    }

    .help-container {
        padding: 16px !important;
        border-radius: 16px !important;
    }

    .help-accordion-title {
        padding: 14px !important;
        font-size: 0.9rem !important;
        gap: 8px;
    }

    .title-left {
        gap: 8px !important;
    }

    .title-left i {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.85rem !important;
        flex-shrink: 0;
    }

    .help-content {
        padding: 0 12px 16px 12px !important;
        font-size: 0.85rem !important;
    }

    .help-accordion[open] .help-content {
        padding-top: 12px !important;
    }

    .search-wrapper {
        padding: 6px !important;
        border-radius: 12px !important;
        gap: 6px !important;
    }

    .search-box i {
        left: 12px !important;
        font-size: 0.85rem !important;
    }

    .search-box input {
        font-size: 0.82rem !important;
        padding: 10px 10px 10px 36px !important;
    }

    .no-results {
        padding: 20px !important;
        font-size: 0.9rem !important;
    }
}

/* ==========================================================================
   Responsive: Documents page
   ========================================================================== */
@media (max-width: 768px) {
    .docs-wrapper {
        padding: 16px !important;
    }
}

@media (max-width: 576px) {
    .docs-wrapper {
        padding: 0 !important;
    }
}

/* Style dropdown positioning on mobile */
@media (max-width: 768px) {
    .style-dropdown {
        right: auto !important;
        left: -70px !important;
    }
}

@media (max-width: 576px) {
    .style-backdrop {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(15, 23, 42, 0.5);
        backdrop-filter: blur(4px);
        z-index: 9999;
    }
    .style-backdrop.active {
        display: block;
    }
    .style-dropdown {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        transform: translate(-50%, -50%) !important;
        width: 300px !important;
        box-shadow: 0 25px 60px rgba(0,0,0,0.3) !important;
        z-index: 10000 !important;
        border-radius: 24px !important;
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* ==========================================================================
   Responsive: Profile page
   ========================================================================== */
@media (max-width: 992px) {
    .profile-layout {
        grid-template-columns: 260px 1fr !important;
        gap: 20px !important;
        padding: 20px !important;
    }

    .profile-sidebar {
        position: static !important;
    }
}

@media (max-width: 768px) {
    .profile-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        padding: 16px !important;
    }

    .profile-card {
        border-radius: 20px !important;
    }

    .profile-sidebar {
        padding-bottom: 24px !important;
    }

    .profile-card[style*="padding: 40px"] {
        padding: 24px !important;
    }

    .avatar-circle {
        width: 100px !important;
        height: 100px !important;
        font-size: 2.8rem !important;
    }

    .section-title {
        font-size: 1rem !important;
    }

    .password-section {
        padding: 20px !important;
    }
}

@media (max-width: 576px) {
    .profile-layout {
        padding: 0 !important;
        gap: 12px !important;
    }

    .profile-card {
        border-radius: 16px !important;
        border-left: none !important;
        border-right: none !important;
    }

    .profile-card[style*="padding: 40px"] {
        padding: 16px !important;
    }

    .profile-header-bg {
        height: 100px !important;
    }

    .avatar-circle {
        width: 80px !important;
        height: 80px !important;
        font-size: 2.2rem !important;
        border-width: 4px !important;
    }

    .avatar-badge-add {
        width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem !important;
    }

    .profile-sidebar h2 {
        font-size: 1.2rem !important;
    }

    .section-title {
        font-size: 0.9rem !important;
        margin-bottom: 16px !important;
    }

    .section-title i {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.85rem !important;
    }

    .form-control {
        padding: 12px 14px !important;
        font-size: 0.9rem !important;
    }

    .btn-save {
        width: 100% !important;
        justify-content: center !important;
        padding: 14px 20px !important;
        font-size: 0.95rem !important;
    }

    .password-section {
        padding: 16px !important;
        margin-top: 24px !important;
    }
}




@media (max-width: 576px) {
    div[style*="padding: 30px"] {
        padding: 0 !important;
    }
}

@media (max-width: 768px) {
    .user-menu-container {
        display: none !important;
    }
}