/* Marca compartida del acceso y la navegación principal. */
.app-rail {
    position: relative;
    isolation: isolate;
    padding-top: 4px;
}

.app-rail::before {
    content: "";
    position: absolute;
    z-index: 0;
    inset: 0 0 auto;
    height: 60px;
    background: color-mix(in srgb, var(--surface-primary) 94%, transparent);
    border-bottom: 1px solid var(--border-color);
}

.app-rail > .brand-mark,
.app-rail > .rail-nav,
.app-rail > .rail-footer {
    position: relative;
    z-index: 1;
}

.app-rail > .rail-nav {
    margin-top: 40px;
}

.brand-mark,
.login-brand {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.brand-mark {
    width: 52px;
    height: 52px;
}

.login-brand {
    width: 190px;
    height: 96px;
    margin: 0 auto 18px;
}

.topbar-welcome {
    gap: 9px;
    flex: 1 1 auto;
}

.topbar-actions { flex-shrink: 0; }
.topbar-welcome strong, .topbar-welcome i { flex-shrink: 0; }

.topbar-welcome span {
    font-size: 12px;
}

/* Los módulos usan la escala visual de Notificaciones; Inbox conserva su título compacto. */
.dashboard-header h1,
.admin-header h1,
.schedule-header h1,
.notifications-header h1,
.contacts-list h1 {
    margin: 3px 0;
    font-size: 25px;
    line-height: 1.1;
}

@media (max-width: 767px) {
    /* Visible viewport and safe area apply to every module, not just Templates. */
    .app-shell {
        height: 100dvh;
        grid-template-rows: minmax(0, 1fr) calc(58px + env(safe-area-inset-bottom));
    }

    .app-rail {
        padding-top: 5px;
        padding-bottom: calc(5px + env(safe-area-inset-bottom));
    }

    .app-rail::before {
        display: none;
    }

    .app-rail > .rail-nav {
        margin-top: 0;
    }

    .login-brand {
        width: 168px;
        height: 84px;
    }

    .topbar-welcome span {
        max-width: 55vw;
        font-size: 10px;
    }
}
