.app {
    display: grid;
    grid-template-rows: var(--header-height) minmax(0, 1fr);
    height: 100vh;
}

.app-header {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-5);
    padding: 0 var(--space-5) 0 0;
    border-bottom: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text);
    border-bottom: 2px solid var(--color-primary);
}

.app-header__brand {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    align-self: stretch;
    width: var(--nav-width);
    padding-left: var(--space-5);
    color: var(--color-primary);
}

.app-header__brand:hover {
    text-decoration: none;
}

.app-header__brand .logo--horizontal {
    height: 1.125rem;
}

.app-header__name {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.app-header__actions {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.app-header__user {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding-right: var(--space-5);
    border-right: 1px solid var(--color-border);
    white-space: nowrap;
}

.app-header__user-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-header__user-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.app-header__user-role {
    color: var(--color-text-muted);
    font-size: 0.7rem;
}

.app-body {
    display: grid;
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
    min-height: 0;
}

.app-nav {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--color-border);
    background-color: var(--color-surface);
    color: var(--color-text);
}

.app-nav__menu {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) 0;
}

/* Zona fija abajo del menú (p. ej. la última actualización) */
.app-nav__footer {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-5);
    border-top: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--font-size-small);
}

.app-main {
    overflow: auto;
}

.error-page {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-4);
    min-height: 100%;
    padding: var(--space-5);
    text-align: center;
}

.error-page__code {
    background-image: var(--brand-gradient);
    background-clip: text;
    color: transparent;
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
}

.error-page__title {
    font-size: 1.5rem;
}

.error-page__message {
    max-width: 32rem;
    color: var(--color-text-muted);
}
