/* ============================================================
   EONIA — Estilos Compartidos
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 50% 0%, #17283a 0%, #07111d 35%, #02060b 100%);
    color: #f4ead0;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: linear-gradient(180deg, #07121e 0%, #03070c 100%);
    border-right: 1px solid rgba(212,170,74,.35);
    padding: 20px;
    overflow-y: auto;
}

.sidebar .logo {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: #e2bc5c;
    letter-spacing: 5px;
    text-align: center;
    margin-bottom: 5px;
}

.sidebar .sub-logo {
    font-size: 10px;
    letter-spacing: 3px;
    color: #8e9aa7;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar .user-info {
    background: rgba(228,189,92,.1);
    border: 1px solid rgba(228,189,92,.3);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar .user-info .nombre {
    font-weight: 700;
    color: #e4bd5c;
    font-size: 14px;
}

.sidebar .user-info .email {
    font-size: 11px;
    color: #9da8b2;
}

.sidebar .nav {
    list-style: none;
}

.sidebar .nav li {
    margin-bottom: 5px;
}

.sidebar .nav li a {
    display: block;
    padding: 10px 15px;
    color: #b9c0c8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all .3s;
}

.sidebar .nav li a:hover,
.sidebar .nav li a.active {
    background: rgba(228,189,92,.15);
    color: #e4bd5c;
}

.sidebar .nav li a .icon {
    margin-right: 10px;
}

.sidebar .logout-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #c89d42, #8b6725);
    border: none;
    border-radius: 8px;
    color: #080b0e;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */

.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
}

.main-content .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.main-content .header .title {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    color: #e4bd5c;
}

.main-content .header .search {
    width: 300px;
    padding: 10px;
    background: #0b141f;
    border: 1px solid rgba(190,150,65,.3);
    border-radius: 8px;
    color: #eee5ce;
    font-size: 14px;
}

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

.main-content .header .user-badge .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e4bd5c;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #080b0e;
    font-weight: 700;
}

.main-content .header .user-badge .info .nombre {
    font-size: 14px;
    font-weight: 700;
    color: #f4ead0;
}

.main-content .header .user-badge .info .nivel {
    font-size: 11px;
    color: #9da8b2;
}

/* ============================================================
   TARJETAS
   ============================================================ */

.card {
    background: linear-gradient(145deg, rgba(20,38,54,.95), rgba(5,12,20,.95));
    border: 1px solid rgba(190,150,65,.4);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}

.card .card-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #e4bd5c;
    margin-bottom: 10px;
}

.card .card-subtitle {
    font-size: 12px;
    color: #9da8b2;
    margin-bottom: 15px;
}

.card .card-content {
    color: #b9c0c8;
    font-size: 14px;
}

.card .card-content .metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card .card-content .metric .value {
    font-size: 24px;
    font-weight: 700;
    color: #e4bd5c;
}

.card .card-content .metric .label {
    font-size: 12px;
    color: #9da8b2;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
    background: linear-gradient(90deg, rgba(2,7,13,.94), rgba(2,7,13,.60), rgba(2,7,13,.30)),
                url('https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1800&q=85');
    background-size: cover;
    background-position: center;
    border-radius: 14px;
    border: 1px solid rgba(212,170,74,.45);
    padding: 50px;
    margin-bottom: 30px;
}

.hero .hero-title {
    font-family: 'Cinzel', serif;
    font-size: 42px;
    color: #f4ead0;
    margin-bottom: 10px;
}

.hero .hero-subtitle {
    font-size: 16px;
    color: #ddd3bb;
    margin-bottom: 20px;
    max-width: 500px;
}

.hero .hero-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #c89d42, #8b6725);
    border: none;
    border-radius: 8px;
    color: #080b0e;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* ============================================================
   GRID
   ============================================================ */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* ============================================================
   BIOMAS (Tarjetas)
   ============================================================ */

.bioma-card {
    background: linear-gradient(145deg, rgba(20,38,54,.95), rgba(5,12,20,.95));
    border: 1px solid rgba(190,150,65,.4);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    transition: all .3s;
}

.bioma-card:hover {
    border-color: rgba(228,189,92,.6);
    transform: translateY(-2px);
}

.bioma-card .bioma-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.bioma-card .bioma-nombre {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #e4bd5c;
    margin-bottom: 5px;
}

.bioma-card .bioma-estado {
    font-size: 12px;
    color: #9da8b2;
    margin-bottom: 10px;
}

.bioma-card .bioma-progreso {
    height: 6px;
    background: #172635;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.bioma-card .bioma-progreso .bar {
    height: 100%;
    background: linear-gradient(90deg, #b8872f, #e4bd5c);
    border-radius: 10px;
}

.bioma-card .bioma-fragmentos {
    font-size: 11px;
    color: #8e9aa7;
}

/* ============================================================
   MENTORES (Chat Eónico)
   ============================================================ */

.mentor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.mentor-card {
    text-align: center;
    padding: 15px 10px;
    border: 1px solid rgba(200,160,70,.25);
    border-radius: 12px;
    background: rgba(5,12,20,.72);
    transition: all .3s;
}

.mentor-card:hover {
    border-color: rgba(228,189,92,.6);
    background: rgba(18,31,44,.90);
}

.mentor-card .mentor-icon {
    font-size: 30px;
    margin-bottom: 5px;
}

.mentor-card .mentor-nombre {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: #e4bd5c;
}

.mentor-card .mentor-rol {
    font-size: 11px;
    color: #9ba8b5;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    text-align: center;
    padding: 30px;
    color: #7f8a95;
    font-size: 12px;
    letter-spacing: 2px;
}

.footer .footer-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #e4bd5c;
    margin-bottom: 5px;
}

/* ============================================================
   EONIA — Estilos Compartidos
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: radial-gradient(circle at 50% 0%, #17283a 0%, #07111d 35%, #02060b 100%);
    color: #f4ead0;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 250px;
    background: linear-gradient(180deg, #07121e 0%, #03070c 100%);
    border-right: 1px solid rgba(212,170,74,.35);
    padding: 20px;
    overflow-y: auto;
}

.sidebar .logo {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: #e2bc5c;
    letter-spacing: 5px;
    text-align: center;
    margin-bottom: 5px;
}

.sidebar .sub-logo {
    font-size: 10px;
    letter-spacing: 3px;
    color: #8e9aa7;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar .user-info {
    background: rgba(228,189,92,.1);
    border: 1px solid rgba(228,189,92,.3);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    margin-bottom: 20px;
}

.sidebar .user-info .nombre {
    font-weight: 700;
    color: #e4bd5c;
    font-size: 14px;
}

.sidebar .user-info .email {
    font-size: 11px;
    color: #9da8b2;
}

.sidebar .nav {
    list-style: none;
}

.sidebar .nav li {
    margin-bottom: 5px;
}

.sidebar .nav li a {
    display: block;
    padding: 10px 15px;
    color: #b9c0c8;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    transition: all .3s;
}

.sidebar .nav li a:hover,
.sidebar .nav li a.active {
    background: rgba(228,189,92,.15);
    color: #e4bd5c;
}

.sidebar .nav li a .icon {
    margin-right: 10px;
}

.sidebar .logout-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #c89d42, #8b6725);
    border: none;
    border-radius: 8px;
    color: #080b0e;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 20px;
}

/* ============================================================
   CONTENIDO PRINCIPAL
   ============================================================ */

.main-content {
    margin-left: 250px;
    padding: 30px;
    min-height: 100vh;
}

.main-content .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.main-content .header .title {
    font-family: 'Cinzel', serif;
    font-size: 28px;
    color: #e4bd5c;
}

.main-content .header .search {
    width: 300px;
    padding: 10px;
    background: #0b141f;
    border: 1px solid rgba(190,150,65,.3);
    border-radius: 8px;
    color: #eee5ce;
    font-size: 14px;
}

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

.main-content .header .user-badge .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e4bd5c;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #080b0e;
    font-weight: 700;
}

.main-content .header .user-badge .info .nombre {
    font-size: 14px;
    font-weight: 700;
    color: #f4ead0;
}

.main-content .header .user-badge .info .nivel {
    font-size: 11px;
    color: #9da8b2;
}

/* ============================================================
   TARJETAS
   ============================================================ */

.card {
    background: linear-gradient(145deg, rgba(20,38,54,.95), rgba(5,12,20,.95));
    border: 1px solid rgba(190,150,65,.4);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
}

.card .card-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #e4bd5c;
    margin-bottom: 10px;
}

.card .card-subtitle {
    font-size: 12px;
    color: #9da8b2;
    margin-bottom: 15px;
}

.card .card-content {
    color: #b9c0c8;
    font-size: 14px;
}

.card .card-content .metric {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.card .card-content .metric .value {
    font-size: 24px;
    font-weight: 700;
    color: #e4bd5c;
}

.card .card-content .metric .label {
    font-size: 12px;
    color: #9da8b2;
}

/* ============================================================
   HERO
   ============================================================ */

.hero {
    background: linear-gradient(90deg, rgba(2,7,13,.94), rgba(2,7,13,.60), rgba(2,7,13,.30)),
                url('https://images.unsplash.com/photo-1519608487953-e999c86e7455?auto=format&fit=crop&w=1800&q=85');
    background-size: cover;
    background-position: center;
    border-radius: 14px;
    border: 1px solid rgba(212,170,74,.45);
    padding: 50px;
    margin-bottom: 30px;
}

.hero .hero-title {
    font-family: 'Cinzel', serif;
    font-size: 42px;
    color: #f4ead0;
    margin-bottom: 10px;
}

.hero .hero-subtitle {
    font-size: 16px;
    color: #ddd3bb;
    margin-bottom: 20px;
    max-width: 500px;
}

.hero .hero-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #c89d42, #8b6725);
    border: none;
    border-radius: 8px;
    color: #080b0e;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

/* ============================================================
   GRID
   ============================================================ */

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

/* ============================================================
   BIOMAS (Tarjetas)
   ============================================================ */

.bioma-card {
    background: linear-gradient(145deg, rgba(20,38,54,.95), rgba(5,12,20,.95));
    border: 1px solid rgba(190,150,65,.4);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
    transition: all .3s;
}

.bioma-card:hover {
    border-color: rgba(228,189,92,.6);
    transform: translateY(-2px);
}

.bioma-card .bioma-icon {
    font-size: 40px;
    margin-bottom: 10px;
}

.bioma-card .bioma-nombre {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #e4bd5c;
    margin-bottom: 5px;
}

.bioma-card .bioma-estado {
    font-size: 12px;
    color: #9da8b2;
    margin-bottom: 10px;
}

.bioma-card .bioma-progreso {
    height: 6px;
    background: #172635;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.bioma-card .bioma-progreso .bar {
    height: 100%;
    background: linear-gradient(90deg, #b8872f, #e4bd5c);
    border-radius: 10px;
}

.bioma-card .bioma-fragmentos {
    font-size: 11px;
    color: #8e9aa7;
}

/* ============================================================
   MENTORES (Chat Eónico)
   ============================================================ */

.mentor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.mentor-card {
    text-align: center;
    padding: 15px 10px;
    border: 1px solid rgba(200,160,70,.25);
    border-radius: 12px;
    background: rgba(5,12,20,.72);
    transition: all .3s;
}

.mentor-card:hover {
    border-color: rgba(228,189,92,.6);
    background: rgba(18,31,44,.90);
}

.mentor-card .mentor-icon {
    font-size: 30px;
    margin-bottom: 5px;
}

.mentor-card .mentor-nombre {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: #e4bd5c;
}

.mentor-card .mentor-rol {
    font-size: 11px;
    color: #9ba8b5;
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    text-align: center;
    padding: 30px;
    color: #7f8a95;
    font-size: 12px;
    letter-spacing: 2px;
}

.footer .footer-title {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: #e4bd5c;
    margin-bottom: 5px;
}

/* ============================================================
   EONIA — RESPONSIVE REAL (corrección móvil)
   Se añade al final para prevalecer sobre los estilos base.
   ============================================================ */

html, body {
    width: 100%;
    max-width: 100%;
}

body {
    overflow-x: hidden;
}

img, video, iframe, canvas, svg {
    max-width: 100%;
}

.main-content,
.main-content * {
    min-width: 0;
}

@media screen and (max-width: 768px) {
    .sidebar {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        padding: 16px !important;
        border-right: 0 !important;
        border-bottom: 1px solid rgba(212,170,74,.35) !important;
    }

    .sidebar .logo {
        font-size: 24px;
    }

    .sidebar .sub-logo {
        margin-bottom: 14px;
    }

    .sidebar .user-info {
        margin-bottom: 14px;
        overflow-wrap: anywhere;
    }

    .sidebar .nav {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    .sidebar .nav li {
        min-width: 0 !important;
        margin: 0 !important;
    }

    .sidebar .nav li a {
        display: flex !important;
        align-items: center;
        min-height: 42px;
        padding: 10px 8px !important;
        font-size: 13px !important;
        overflow-wrap: anywhere;
        white-space: normal;
    }

    .sidebar .nav li a .icon {
        flex: 0 0 auto;
        margin-right: 7px;
    }

    .sidebar .logout-btn {
        display: block;
        width: 100% !important;
        margin-top: 14px !important;
    }

    .main-content {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 16px !important;
        overflow: visible !important;
    }

    .main-content .header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        width: 100% !important;
        margin-bottom: 20px !important;
    }

    .main-content .header .title {
        width: 100% !important;
        max-width: 100% !important;
        font-size: clamp(21px, 6vw, 28px) !important;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .main-content .header .search {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    .main-content .header .user-badge {
        width: 100%;
        max-width: 100%;
        flex-wrap: wrap;
        overflow-wrap: anywhere;
    }

    .grid {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100% !important;
        max-width: 100% !important;
        gap: 14px !important;
    }

    .card,
    .bioma-card,
    .mentor-card,
    .hero,
    .grid > *,
    .card > * {
        width: auto;
        max-width: 100% !important;
        min-width: 0 !important;
        overflow-wrap: anywhere;
    }

    .card,
    .bioma-card {
        padding: 16px !important;
    }

    .card .card-title,
    .bioma-card .bioma-nombre {
        overflow-wrap: anywhere;
        word-break: normal;
    }

    .card textarea,
    .card input,
    .card select,
    .card button,
    .main-content textarea,
    .main-content input,
    .main-content select,
    .main-content button {
        box-sizing: border-box !important;
        max-width: 100% !important;
    }

    .card textarea,
    .main-content textarea {
        display: block;
        width: 100% !important;
        min-width: 0 !important;
    }

    .hero {
        padding: 24px !important;
    }

    .hero .hero-title {
        font-size: clamp(26px, 7vw, 36px) !important;
        line-height: 1.25;
    }

    .hero .hero-subtitle {
        max-width: 100% !important;
    }

    .mentor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .footer {
        padding: 24px 8px !important;
        overflow-wrap: anywhere;
    }
}

@media screen and (max-width: 380px) {
    .sidebar .nav {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .main-content {
        padding: 12px !important;
    }

    .card,
    .bioma-card {
        padding: 13px !important;
    }

    .mentor-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* ============================================================
   EONIA — CORRECCIÓN FINAL RESPONSIVE (sobrescribe reglas previas)
   ============================================================ */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

@media screen and (max-width: 768px) {
    body {
        display: block !important;
        min-width: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    body > .sidebar {
        position: relative !important;
        inset: auto !important;
        display: block !important;
        float: none !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
        padding: 16px !important;
        box-sizing: border-box !important;
    }

    body > .sidebar .nav {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
        width: 100% !important;
    }

    body > .sidebar .nav li,
    body > .sidebar .nav li a {
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        box-sizing: border-box !important;
    }

    body > .main-content {
        position: relative !important;
        inset: auto !important;
        display: block !important;
        float: none !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 16px !important;
        box-sizing: border-box !important;
        overflow: visible !important;
    }

    body > .main-content .header {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        width: 100% !important;
        min-width: 0 !important;
    }

    body > .main-content .header > *,
    body > .main-content .card,
    body > .main-content .card-content,
    body > .main-content .footer {
        min-width: 0 !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        overflow-wrap: anywhere !important;
    }

    body > .main-content .header .title {
        font-size: clamp(22px, 6vw, 28px) !important;
        line-height: 1.25 !important;
    }

    body > .main-content .header .search {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    body > .main-content .card {
        padding: 16px !important;
    }

    body > .main-content .card p {
        overflow-wrap: anywhere !important;
        word-break: normal !important;
    }
}

@media screen and (max-width: 380px) {
    body > .sidebar .nav {
        grid-template-columns: minmax(0, 1fr) !important;
    }
    body > .main-content {
        padding: 12px !important;
    }
}

