
/* =====================================================
   SONOTECA — ESTRUCTURA COMÚN DE LA APLICACIÓN
   ===================================================== */

:root {
    --app-primary: #245caa;
    --app-primary-light: #eaf1fc;
    --app-ink: #202126;
    --app-muted: #777985;
    --app-paper: #fbfaf8;
    --app-white: #ffffff;
    --app-line: #e8e6e2;
    --app-radius: 14px;
    --app-width: 1240px;
}

/* Estructura general */

.app-body {
    min-height: 100vh;
    margin: 0;
    padding-bottom: 30px;
    background: var(--app-paper);
    color: var(--app-ink);
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.app-shell {
    width: min(100% - 48px, var(--app-width));
    margin: 0 auto;
}

/* Cabecera */

.app-header {
    position: relative;
    z-index: 20;
    background: var(--app-white);
    border-bottom: 1px solid var(--app-line);
}

.app-header-inner {
    width: min(100% - 48px, var(--app-width));
    min-height: 76px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--app-ink);
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
    flex: 0 0 auto;
}

.app-brand-mark {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--app-primary);
    color: #fff;
    font-size: 21px;
    font-weight: 800;
}

/* Navegación principal */

.app-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 10px;
    color: #555762;
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
    transition: background .18s ease, color .18s ease;
}

.app-nav-link:hover {
    background: #f3f4f6;
    color: var(--app-ink);
}

.app-nav-link.is-active {
    background: var(--app-primary-light);
    color: var(--app-primary);
}

/* Área de contenido */

.app-main {
    width: min(100% - 48px, var(--app-width));
    margin: 0 auto;
    padding: 38px 0 60px;
}

.app-page-heading {
    margin-bottom: 30px;
}

.app-page-eyebrow {
    margin: 0 0 10px;
    color: var(--app-primary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
}

.app-page-title {
    margin: 0;
    color: var(--app-ink);
    font-size: clamp(30px, 4vw, 44px);
    line-height: 1.1;
    letter-spacing: -1.8px;
    font-weight: 750;
}

.app-page-description {
    margin: 12px 0 0;
    color: var(--app-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* Superficies y tarjetas */

.app-card {
    padding: 26px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-white);
}

.app-card-title {
    margin: 0 0 18px;
    font-size: 19px;
    font-weight: 750;
    letter-spacing: -.4px;
}

/* Botones */

.app-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: var(--app-primary);
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background .18s ease;
}

.app-button:hover {
    background: #194b91;
}

.app-button-secondary {
    border-color: var(--app-line);
    background: #fff;
    color: var(--app-ink);
}

.app-button-secondary:hover {
    background: #f5f5f7;
}

/* Accesibilidad */

.app-nav-link:focus-visible,
.app-button:focus-visible,
.app-brand:focus-visible {
    outline: 3px solid rgba(36, 92, 170, .3);
    outline-offset: 3px;
}

/* Navegación móvil */

.app-mobile-nav {
    display: none;
}

/* Adaptación a tablet y móvil */

@media (max-width: 760px) {
    .app-header-inner {
        min-height: 64px;
    }

    .app-nav {
        display: none;
    }

    .app-mobile-nav {
        position: fixed;
        z-index: 100;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--app-line);
        background: rgba(255, 255, 255, .97);
        backdrop-filter: blur(12px);
    }

    .app-mobile-nav .app-nav-link {
        min-height: 54px;
        padding: 5px 2px;
        flex-direction: column;
        gap: 4px;
        font-size: 11px;
    }

    .app-main {
        padding-top: 26px;
        padding-bottom: 35px;
    }

    .app-card {
        padding: 20px;
    }

    .app-shell,
    .app-header-inner,
    .app-main {
        width: min(100% - 28px, var(--app-width));
    }

    .app-body {
        padding-bottom: 85px;
    }
}

@media (max-width: 380px) {
    .app-brand {
        font-size: 20px;
    }

    .app-brand-mark {
        width: 35px;
        height: 35px;
    }

    .app-mobile-nav .app-nav-link {
        font-size: 10px;
    }
}

/* Botón común de cerrar sesión */
.library-logout {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid #e8e6e2;
    border-radius: 10px;
    background: #fff;
    color: #555762;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.library-logout:hover {
    background: #f5f5f7;
}

@media (max-width: 480px) {
    .library-logout {
        font-size: 11px;
        padding: 0 8px;
    }
}
